Problem with FFT and IFFT back to time doman, not exactly the first signal.

조회 수: 7 (최근 30일)
Filippos
Filippos 2014년 10월 3일
답변: SK 2014년 10월 3일
Hello all.
I am trying to reproduce the changes on a ~30 femtosecond laser pulse. I create and display this pulse in time just fine. Also, the fft of this pulse apperas fine on matlab (central frequency and width are very fine). But when I backtransform the transformed one using the ifft() function, the pulse is moved in time (posssibly due to phase change?? I don't know) and also the peak maxima are different.. What could be the cause of this? I am using ifft the wrong way?
The code I am using is this :
atto=1e-18;
c = 299792458;
femto=1e-15;
lamda0=800e-9;
f_0=c/lamda0;
omega0=2*pi*c/lamda0;
T=2*pi/omega0;
a=2*log(2)/((36.32*femto)^2);
Fs=3/atto; %samplying rate
t=-200*femto:1/Fs:200*femto;
Efield=exp(-a.*(t-T).^2).*exp(1j.*omega0.*(t-T));
nfft=2^nextpow2(length(Efield));
Efieldfft=fft(Efield,nfft);
f=(0:nfft-1)*Fs/nfft;
omega=2*pi*f;
figure(1)
plot(t,Efield)
xlabel('s [fs]')
ylabel('Amplitude')
figure(2)
plot(omega,abs(Efieldfft))
xlim([2e15 2.8e15])
xlabel('omega [rad]')
ylabel('Amplitude')
figure(3)
plot(f,abs(Efieldfft))
xlim([3.3e14 4.1e14])
xlabel('frequency [Hz]')
ylabel('Power')
test=ifft(Efieldfft,length(t));
figure(4)
plot(t,test)
xlabel('s[fs]')
ylabel('amplitude')
Test is the backtransformed function to time... Looking forward for your answers

채택된 답변

SK
SK 2014년 10월 3일
You have padded the original function with zeros upto the next power of 2. But when you take the inverse fft you only use the length of the original function. You need to put the full length of the fft back into the ifft function.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by