37 N=(int)(2.*floor((
fs*
TAU)/2.));
48 for (
int i=1; i<chCnt; i++)
56 template<
typename Derived>
66 for (
int i=0; i<(
M-1)*
NO2; i++) {
69 if (measureTest<bestMeasure) {
70 bestMeasure=measureTest;
113 output.block(0,0,chCnt,NO2)*=
wnd.block(0,NO2,chCnt,NO2);
117 output.block(0,
NO2,chCnt,
NO2)=Matrix<FP_TYPE, Dynamic, Dynamic>::Zero(chCnt,
NO2);
146 if (n>
input.rows()-1 || n<0)
148 if (m>
input.cols()-1 || m<0)
155 if (n>
output.rows()-1 || n<0)
157 if (m>
output.cols()-1 || m<0)
169 #ifdef HAVE_EMSCRIPTEN 170 EMSCRIPTEN_BINDINGS(WSOLA_ex) {
171 emscripten::class_<WSOLA>(
"WSOLA")
177 .function(
"process", &WSOLA::processOurInput)
int inputSamplesRequired
The number of audio samples required for the next call to process.
int NO2
Half the window size.
int N
The size of the window.
#define WSOLA_COLS_ERROR
Occurs when trying to access a col > the input or output Array cols.
virtual int evaluateError(int errorNum)
Array< FP_TYPE, Dynamic, Dynamic > nextOutput
The output vector to search for, each channel per row.
double rem
The remainder fraction of a sample to remember for next time (can't move on by fractions of a sample)...
int m
The current row index into the buffer.
#define FS_DEFAULT
Hz the sample rate.
virtual ~WSOLA()
Destructor.
void OLAWnd(void)
Generate the overlap add window based on the window size N.
#define WSOLA_ROWS_ERROR
Occurs when trying to access a row > the input or output Array rows.
#define TAU
ms The window size
FP_TYPE unloadOutput(int n, int m)
#define DEFAULT_CH_CNT
The default number of channels to use.
Array< FP_TYPE, Dynamic, Dynamic > wnd
The overlap add window.
FP_TYPE findSimilarity(const ArrayBase< Derived > &outputIn)
int getSamplesRequired(void)
#define M_DEFAULT
The default number of buffers to search.
Array< FP_TYPE, Dynamic, Dynamic > input
The input vector, each row is a channel.
Array< FP_TYPE, Dynamic, Dynamic > output
The output vector, each row is a channel.
#define WSOLA_MOD2_ERROR
< Provided by GTKIOStream on sf.net
int loadInput(int n, int m, FP_TYPE val)
int findSimilarityInBuffer(const DenseBase< Derived > &buffer)
int getMaxInputSamplesRequired(void)
int M
The number of windows in the search buffer.
float fs
The sample rate in Hz.
Array< FP_TYPE, Dynamic, Dynamic > buffer
The buffer of audio, each channel on its own row.