FFT / IFFT question .
9 views (last 30 days)
I have a 4000 points time history rectangular pulse described as
for i=1:4000 if t(i)>=0&t(i)<=0.01 r(i)=1e5; else r(i)=0; end end
in the frequency domain i have :
y=r; L=length(y); Fs=L/0.4; NFFT = L; % Next power of 2 from length of y Y = fft(y,NFFT); f = Fs/2*linspace(0,1,NFFT/2);
The issue is :
If i use ifft(Y) i got the original time history (obviously) - no problem
but if i take half of the frequency domain vector and use ifft with the symmetric argument i got messed up time hystory . WHY ????
J=Y(1:NFFT/2+1); TD=ifft(J, 'symmetric');
TD is not the original time domain pulse . What am i missing here ?
Wayne King on 5 Dec 2011
Hi Marcelo, Even if you use 'symmetric' option, you still have to provide the entire frequency vector input. 'symmetric' just takes care of the rounding errors that can yield nonzero imaginary parts in the inverse Fourier transform of a conjugate symmetric Fourier representation.
You should input Y and not J. By inputtting
J = Y(1:/NFFT/2+1), you are giving ifft() an input vector that is not conjugate symmetric.