Why ifft results of analytic signal spectrum don't match with theoretical time formula?
조회 수: 4 (최근 30일)
이전 댓글 표시
Dear all,
I need to convert a spectrum data back to time domain. Before it, I use a simple Gaussian pulse as a test. However, I found that results computed by ifft don't match with theoretical time equation. Why it happened? How to resolve it?
Fs=200;
T=1/Fs;
L=1200;
tau=0.4;
t0=2.8;
mag=10;
t=(0:L-1)*T;
f=Fs*(-L/2:L/2-1)/L;
Xf=@(x)sqrt(pi).*mag.*tau.*exp(-(2.*pi.*tau.*x).^2).*exp(-1i.*2.*pi.*x.*t0);
figure;
plot(f,real(Xf(f)));
% shift spectrum starting from 0 frequency
signal_comp=ifft(fftshift(Xf(f)).*L);
signal_theoretical=mag.*exp(-(t-t0).^2/tau^2);
figure;
plot(t,signal_theoretical);
hold on;
plot(t,real(signal_comp),'r--');
댓글 수: 0
채택된 답변
Matt J
2022년 9월 22일
편집: Matt J
2022년 9월 22일
The IFFT and the continuous inverse Fourier transform are not the same thing.
tau=0.4;
t0=2.8;
mag=10;
Fs=200;
dT=1/Fs;
L=2000;
dF=1/dT/L;
f=dF*(-L/2:L/2-1);
t=dT*(-L/2:L/2-1);
Xf=@(x)sqrt(pi).*mag.*tau.*exp(-(2.*pi.*tau.*x).^2).*exp(-1i.*2.*pi.*x.*t0);
% shift spectrum starting from 0 frequency
signal_comp= fftshift(ifft(ifftshift(Xf(f))) ) /dT; %note factor of 1/dT
signal_theoretical=mag.*exp(-((t-t0)/2).^2/tau^2)/2; %fix the theoretical formula
figure;
plot(t(1:20:end),signal_theoretical(1:20:end),'o',...
t,real(signal_comp),'r--');
legend('Theoretical','Computed',location='northwest')
추가 답변 (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!