comparison FIRFilter.cpp @ 35:c8dd1049b2d3

* FIRFilter::process now returns N+M-1 samples, rather than IFFT length as before.
author Carl Bussey <c.bussey@se10.qmul.ac.uk>
date Thu, 04 Sep 2014 14:12:03 +0100
parents de7213b35755
children 4cf2d163127b
comparison
equal deleted inserted replaced
30:36cffe6493e4 35:c8dd1049b2d3
78 FFT::inverse(m_lengthFIRFFT, m_pFftFilteredReal, m_pFftFilteredImag, m_pFftOutputReal, m_pFftOutputImag); 78 FFT::inverse(m_lengthFIRFFT, m_pFftFilteredReal, m_pFftFilteredImag, m_pFftOutputReal, m_pFftOutputImag);
79 79
80 //copy to output 80 //copy to output
81 int offset = 0; 81 int offset = 0;
82 int outputLength = m_lengthInput; 82 int outputLength = m_lengthInput;
83 if (outputType == all) outputLength = (int)m_lengthFIRFFT; 83 if (outputType == all) outputLength = m_lengthInput+m_numberOfCoefficients-1;
84 else if (outputType == middle) offset = floor(m_numberOfCoefficients/2.0f); 84 else if (outputType == middle) offset = floor(m_numberOfCoefficients/2.0f);
85 else if (outputType != first) cerr << "FIRFilter::process(params) - " << outputType << " is not a valid argument. outputType is set to first." << endl; 85 else if (outputType != first) cerr << "FIRFilter::process(params) - " << outputType << " is not a valid argument. outputType is set to first." << endl;
86 86
87 for (int i = 0; i < outputLength; i++){ 87 for (int i = 0; i < outputLength; i++){
88 pOutput[i] = m_pFftOutputReal[i + offset]; 88 pOutput[i] = m_pFftOutputReal[i + offset];