Merge "Splitting analysis window in frequency implementation. Other fixes."

gugelfrei
Ricardo Garcia 5 years ago committed by Gerrit Code Review
commit 60c33d85d0

@ -62,11 +62,6 @@ void ChannelBuffer::initBuffers(unsigned int blockSize, unsigned int overlapSize
cBInput.resize(mBlockSize * CIRCULAR_BUFFER_UPSAMPLE);
cBOutput.resize(mBlockSize * CIRCULAR_BUFFER_UPSAMPLE);
//fill input with half block size...
for (unsigned int k = 0; k < mBlockSize/2; k++) {
cBInput.write(0);
}
//temp vectors
input.resize(mBlockSize);
output.resize(mBlockSize);
@ -170,6 +165,11 @@ void DPFrequency::configure(size_t blockSize, size_t overlapSize,
fill_window(mVWindow, RDSP_WINDOW_HANNING_FLAT_TOP, mBlockSize, mOverlapSize);
//split window into analysis and synthesis. Both are the sqrt() of original
//window
Eigen::Map<Eigen::VectorXf> eWindow(&mVWindow[0], mVWindow.size());
eWindow = eWindow.array().sqrt();
//compute window rms for energy compensation
mWindowRms = 0;
for (size_t i = 0; i < mVWindow.size(); i++) {
@ -666,6 +666,11 @@ size_t DPFrequency::processLastStages(ChannelBuffer &cb) {
//##ifft directly to output.
Eigen::Map<Eigen::VectorXf> eOutput(&cb.output[0], cb.output.size());
mFftServer.inv(eOutput, cb.complexTemp);
//apply rest of window for resynthesis
Eigen::Map<Eigen::VectorXf> eWindow(&mVWindow[0], mVWindow.size());
eOutput = eOutput.cwiseProduct(eWindow);
return mBlockSize;
}

Loading…
Cancel
Save