Friday, 10 July 2015

fft - How to make a signal conjugate symmetric?


Take the simple frequency-domain band-pass filtering operation below . . .


NFFT = 128;
x = randn(NFFT,1);
H = zeros(NFFT,1);

H(10:20) = 1;
y = ifft(H.*fft(x), 'symmetric');

This gives a real output because I'm using the conjugate symmetric flag to the ifft operation.


I want a function that returns the conjugate symmetric version of H, so I do not have to rely on the builtin symmetric option in Matlab's ifft. NFFT can be any positive integer. This could be called something like this . .


H(10:20) = 1;
H = MakeConjSym(H);

Answer



Conjugate symmetric means


$$f(-x) = f^{\ast}(x)$$



i.e. the sign of the imaginary part is opposite when $x<0$


The FFT of a real signal is conjugate symmetric. One half of the spectrum is the positive frequencies, and the other half is the negative. The negative coefficients are conjugate of the positive.


So if you do filtering, your envelope must do both the positive frequencies and their corresponding negative frequencies, so that the imaginary bits cancel out.


In your example, H does only one half. That is why the output has imaginary bits in it. What you want is


NFFT = 128;
x = randn(NFFT,1);
H = zeros(NFFT,1);
H(10:20) = 1;
H(end-20+2:end-10+2) = 1; % Other half
y = ifft(H.*fft(x));

No comments:

Post a Comment

readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...