Hi, I'm not sure how to get my scaling right in my ifft from frequency to time when I plot it. I've tried below, but I know something is off from the graph. Thanks.
% Constants
c = 299792458; % speed of light in a vacuum
FWHM = 30e-15; % pulse duration
T = FWHM/(2*(sqrt(log(2)))); % (T=tau)
lambda0 = 800e-9; % central wavelength
w0 = (2*pi*c)/lambda0; % central angular frequency
eta = 0; % chirp (2nd derivitive of phase)
% electric field and intensity in wavelength domain
nfft = 2^12;lambda = (740e-9:((120e-9)/(nfft-1)):860e-9);w = (2.*pi.*c)./lambda;E_w = (1/(sqrt((1/T.^2)+i*eta)))*exp((-(w-w0).^2)/((2/T.^2)+2*i*eta));I_lambda= (abs(E_w)).^2; % IFFT
Fs = w/(2*pi); % sampling frequency
df = Fs/nfft;dw = 2*pi*df;dt = 1./Fs; % increments of time
T1 = (nfft*dt);t = (-T1/2+dt:dt:T1/2);ifftE_t = ifft(E_w); % ifft
% PLOT
subplot(2, 1, 1);plot(w, I_lambda);title('Gaussian Pulse Signal'); xlabel('Wavelength'); ylabel('I_\lambda'); subplot(2, 1, 2)plot(t, abs(ifftE_t))
Best Answer