matlab 超短脉冲展宽器和压缩器代码资料
时间: 2023-11-03 11:05:55 浏览: 204
以下是 MATLAB 中超短脉冲展宽器和压缩器的代码资料:
超短脉冲展宽器:
```matlab
clear all;
clc;
close all;
format long;
%定义初始参数
c=3e8;
tau0=0.1e-12;
fwhm0=0.441e-12;
t=-5*tau0:tau0/20:5*tau0; %时间范围
omega=2*pi./t;
%初始脉冲
E0=exp(-(t/tau0).^2);
%傅里叶变换
E0w=fftshift(fft(E0));
%高斯窗函数
G=exp(-(omega/fwhm0).^2);
%展宽后的频谱
Ew=E0w.*G;
%展宽后的脉冲
Et=ifft(ifftshift(Ew));
%画图
subplot(2,1,1);
plot(t,E0);
xlabel('t(s)');
ylabel('E(t)');
title('初始脉冲');
grid on;
subplot(2,1,2);
plot(t,abs(Et));
xlabel('t(s)');
ylabel('E(t)');
title('展宽后脉冲');
grid on;
```
超短脉冲压缩器:
```matlab
clear all;
clc;
close all;
format long;
%定义初始参数
c=3e8;
tau0=0.1e-12;
fwhm0=0.441e-12;
t=-5*tau0:tau0/20:5*tau0; %时间范围
omega=2*pi./t;
%初始脉冲
E0=exp(-(t/tau0).^2);
%傅里叶变换
E0w=fftshift(fft(E0));
%高斯窗函数
G=exp(-(omega/fwhm0).^2);
%展宽后的频谱
Ew=E0w.*G;
%展宽后的脉冲
Et=ifft(ifftshift(Ew));
%压缩器
Gc=exp(1i*omega.^2*(2*pi*c/(1.55e-6))/2/100);
%压缩后的频谱
Ewc=Ew.*Gc;
%压缩后的脉冲
Etc=ifft(ifftshift(Ewc));
%画图
subplot(3,1,1);
plot(t,E0);
xlabel('t(s)');
ylabel('E(t)');
title('初始脉冲');
grid on;
subplot(3,1,2);
plot(t,abs(Et));
xlabel('t(s)');
ylabel('E(t)');
title('展宽后脉冲');
grid on;
subplot(3,1,3);
plot(t,abs(Etc));
xlabel('t(s)');
ylabel('E(t)');
title('压缩后脉冲');
grid on;
```
阅读全文
相关推荐
















