I'm trying to generate a modulated Gaussian pulse. First I'm generating the pulse in the time domain perform FFT and displaying both in time and frequency, then I'm multiplying it with cosine term (which is related to distance measurement - Interferometry). The modulated pulse seems undersampled, I tried to increase 'L', still doesn't look to what I look for. I also trying to rescale all the parameters, but I stuck with some of them.
clear all; close all;
f=374.7e12;%Hz
fs=f*10; %sampling frequency
T=1/fs;
L=4000;
sigma=40e-15;
t=(0:L-1)*T; %time base
x=(exp(-(t-400e-15).^2/(2*sigma)^2)).*exp(1i*2*pi*f*t);
subplot(2,1,1)
plot(t,real(x),'b');
title(['Gaussian Pulse \sigma=', num2str(sigma),'s']);
xlabel('Time(s)');
ylabel('Amplitude');
ylim([-1 1])
% xlim([1e-15 9e-15])
NFFT = 2^nextpow2(L);
X = fft(x,NFFT)/L;
Pxx=X.*conj(X)/(NFFT*NFFT); %computing power with proper scaling
f = fs/2*linspace(0,1,NFFT/2+1); %Frequency Vector
subplot(2,1,2)
plot(f,2*abs(X(1:NFFT/2+1)))
title('Magnitude of FFT');
xlabel('Frequency (Hz)')
ylabel('Magnitude |X(f)|');
Cav_len=0.3;%Meter
delta_L=-40e-6;
fr=1e9; %Hz
c=3e8; %m/s
n=1:1:NFFT;
m=500;
S_w=abs(X).^2.*(1+cos((2.*pi.*n.*m.*fr.*Cav_len./c)+(2.*pi.*fr.*n.*delta_L./c)));
figure()
plot(f,2*S_w(1:NFFT/2+1))
xlim([3.6e14 3.9e14])
The attached images: The first is what I expected , The second is what I get. The terms source is from thesis that I am reading and trying to implement some of the theory. I will attach to relevant pages,