%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This file shows the propagation of a trapezoidal pulse
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%(1) Calculate the frequency spectrum of the pulse
w=linspace(-10e11,10e11,401); %calculated frequency range
%trapezoidal specs
a=40e-12;
b=60e-12;
% plot the trapezoidal pulse
figure(1)
t=linspace(-1.1*b,1.1*b,1001);
f=zeros(size(t));
I=find(abs(t)>a & abs(t)**a & abs(tt-L/vg)**