| 15 | |
| 16 | |
| 17 | void StandardFFTProcessor::process(const FftDecimal* input, FftDecimal* output, int blockSize){ |
| 18 | |
| 19 | fill_in_passOut(input, output, blockSize); |
| 20 | m_offset += blockSize; |
| 21 | |
| 22 | // when the input buffer reaches the fft block size we can fft |
| 23 | if( m_offset >= m_fftSize ){ |
| 24 | applyWindow(m_input); |
| 25 | // here is a good location for a zero padding function |
| 26 | // zeroPadding(m_input, int(m_fftSize*0.8)); |
| 27 | //m_input.resize(m_fftSize, 0.f); |
| 28 | float2Cpx(m_input, m_cpxInput); |
| 29 | |
| 30 | fft->transform(&m_cpxInput[0], &m_fftOut[0]); |
| 31 | |
| 32 | normalise(m_fftOut); |
| 33 | utilities::car2Pol(m_fftOut, m_polarOut, m_halfSize); |
| 34 | |
| 35 | spectral_process(m_polarOut, m_polarIn, m_halfSize); |
| 36 | |
| 37 | utilities::pol2Car(m_polarIn, m_ifftin, m_halfSize); |
| 38 | m_ifftin[0] = 0.f; |
| 39 | |
| 40 | ifft->transform(&m_ifftin[0], &m_cpxOutput[0]); |
| 41 | |
| 42 | cpx2Float(m_cpxOutput, m_output); |
| 43 | applyWindow(m_output); |
| 44 | m_offset = 0; //reset count |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | void StandardFFTProcessor::setWindowType(FftWindowType newType) { |
| 49 | m_windowType = newType; |