Getting imaginary values when applying a 2D bandpass filter

2 次查看(过去 30 天)
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

回答(1 个)

Image Analyst
Image Analyst 2014-1-18
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 个评论
Roy
Roy 2014-1-20
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 2014-1-20
编辑:Image Analyst 2014-1-20
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)?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Frequency Transformations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by