Getting imaginary values when applying a 2D bandpass filter

6 views (last 30 days)
I am trying to bandpass filter a 2D matrix Q. I create my bandpass filter by following the steps in fwind2 such that my final filter h looks sensible.
I then simply try Q_filtered=ifft2(fft2(Q).*h); but Q_filtered now has imaginary values. I have tried fftshift without success.
Any ideas on how to do this properly?
Thanks

Answers (1)

Image Analyst
Image Analyst on 18 Jan 2014
If you don't have a real and symmetric signal, then your FT will be Hermitian (complex). See the table on this page for properties such as this: http://www.cv.nrao.edu/course/astr534/FourierTransforms.html
Time Domain Frequency Domain
real hermitian (real=even, imag=odd)
imaginary anti-hermitian (real=odd, imag=even)
even even
odd odd
real and even real and even (i.e. cosine transform)
real and odd imaginary and odd (i.e. sine transform)
imaginary and even imaginary and even
imaginary and odd real and odd
  2 Comments
Roy
Roy on 20 Jan 2014
My matrix is real so the only reason I can see to get an imaginary result after I IFT is because I somehow design the filter wrong.
If I take my matrix A and type ifft2(fft2(A)) I get the same answer (up to machine precision). Even if I design a simple boxcar filter F in frequency space and then try ifft2(fft2(A).*F) I get an imaginary result. I suspect that it has to do with the way the zeros and ones in my filter are written. Can you give me an example, even of a 1D bandpass filter F1 such that for a 1D matrix A1 if I try (ifft(fft(A1).*F1)) will give a real result?
Thanks
Image Analyst
Image Analyst on 20 Jan 2014
Edited: Image Analyst on 20 Jan 2014
According to the table, a real signal gives a Hermitian fft. Hermitian means complex, meaning it has an imaginary component. The only way you'd get a purely real output is if you have a completely symmetrical input, which I doubt you have. So, after that explanation, can you explain why you think you should have a purely real signal (no imaginary component)?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!