尝试简单地在 MATLAB 中创建飞秒脉冲,就像在所附图像中一样,

载波频率在374THz左右,我的采样频率是载波的10倍。fft 的结果没有任何可以理解的结果......试图改变一些变量,fs,t-around 零,fftshift......但无法断定代码有什么问题。
我的代码遵循 matlab fft 示例:
clear all ; close all ; clc
f=374.7e12;%Thz
fs=f*10; %sampling frequency
T=1/fs;
L=1000;
sigma=5e-15;
t=(0:L-1)*T; %time base
x=(exp(-(t-50e-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([10e-15 90e-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)|');
结果是:


