neff=1.47;
lamda=1.55*10^-6;
thetar=pi/4;
theta2=pi/4;
theta1=pi/4;
detaL=6.00547*10^-3;
Lr=2*detaL+lamda/2;
alpha=0.1;
k=exp(-alpha*Lr);
fair=2*pi*neff*Lr/lamda;
T=[cos(thetar)-k*exp(-j*fair)]/[1-cos(thetar)*k*exp(-j*fair)];
detaq=2*pi*neff*detaL/lamda;
es1=es.*[T*cos(theta2)*cos(theta1)-sin(theta2)*sin(theta1)*exp(-j*detaq)];[/color】
[fes,ews]=ospect(fs,es)
[fes,ews1]=ospect(fs,es1);
p=es1.*conj(es1);
[ft,pws1]=spectrum(fs,p);
figure(5)
[N,BW]=simBWchaos(ft,pws1)
figure(6)
fes=(fes-vs)*10^-9;
plot(fes,ews,'black','LineWidth',1.3)
%set(gca,'XLim',[-50 50]);
xlabel('frequency(ghz)');ylabel('power dBm');
figure(7)
fes=(fes-vs)*10^9;
plot(fes,ews1,'black','LineWidth',1.3)
%set(gca,'XLim',[-50 50]);
xlabel('frequency(ghz)');ylabel('power dBm');
save ch t Ps N BW ft pws c lag fes ews
fprintf('\n');
fprintf('\t');
fprintf('CPUTIME IS');
lll=etime(clock,T1);
disp(lll);
红颜色的部分是我的透过率函数,里面光谱画图部分的程序以VS作为一个任意值来画横轴的,不知怎么修改还请指教!