oscillating phases when using fft and ifft
17 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I noticed that I get oscillations in the phases of the fourier transform of my gaussian function and also in the inverse transform of the transform, this is illustrated in the following code:
tm=10*10^-4; dt=10^-6; t=-tm:dt:tm; t0=3*10^-5; lt=length(t); f=(-lt/2:lt/2-1)*1/(lt*dt); y=exp(-t.^2/t0.^2); ft=fftshift(fft(ifftshift(y))); y2=ifftshift(ifft(fftshift(ft)));
figure subplot(3,2,1); plot(t,y); title('Initial time profile') subplot(3,2,2); plot(t,phase(y)); title('Initial time phase'); subplot(3,2,3); plot(f,abs(ft)); title('Fourier transform, magnitude') subplot(3,2,4); plot(f,unwrap(phase(ft))); title('Fourier transform, phase') subplot(3,2,5); plot(t,abs(y2)); title('Second time profile') subplot(3,2,6); plot(t,unwrap(phase(y2))); title('Second time phase')
I'm wondering if there's any way to get rid of these or if I need to use some sort of filter? In my real program, I need to be able to affect the spectral content of the fourier transform before I invert it back to time space.
Thanks in advance Robert
0 件のコメント
回答 (2 件)
Cindy Solomon
2015 年 5 月 6 日
編集済み: Cindy Solomon
2015 年 5 月 6 日
Hi Robert,
Is there a reason you're defining ft and y2 by first performing fftshift or ifftshift on those signals? These functions are intended to shift the zero-frequency component to the center of the spectrum. For example, you would use fftshift after FFT if you want to center the plot and view it as a 2-sided spectrum with the axis -Fs/2 to +Fs/2.
In addition, the values that you are calculating are not symmetric, which leads to phase offsets. A signal with non-zero phase means that your frequency amplitudes will oscillate.
Hope this helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Fourier Analysis and Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!