I wanted to know the reasoning behind a conflict ONLY in imaginary parts after IFFT.
For both my C/C++ implementation and Matlab implemenation I am doing the same following steps.
- My signal x is of dimension Mx1 and I perform an N-point FFT (where N = 2*M) on that signal to get N-point signal in frequency domain.
- Apply a customized filter on this frequency domain signal (both real and imaginary parts are changed in step).
- Perform in N-point inverse FFT.
Both C/C++ and Matlab implementations generate exactly the same result except the after the inverse IFFT step, imaginary parts do not match but real parts do match.
If I skip step 2 above, IFFT output of both implementation match without any problem. It is intended that my input signal to IFFT (i.e., after step2 filter) is not required to be conjugate symmetric. Infact this signal may even not be a Hermitian/symmetric.
Currently, I am using C-implementation of FFT/IFFT defined as a function smbFft
available in this CPP-FILE.
Any clues, why this could be happening?
PS: It would be great, if someone can point me to an FFT implementation in C/C++, which is exactly aligned with corresponding Matlab implementation.
Thanks.
Edit: I just tested FFTW implementation instead of smbFfT
(I mentioned above). FFTW implementation also has the same problem, which suggest that both of these tested C-implementations perform IFFT with hermitian symmetry setting. I need to perform the same IFFT in C as Matlab does with IFFT(..., 'nonsymmetric')
.