資源簡介
ook_nrz matlab代碼,用matlab實現利用雙MZI結構產生NRZ-OOK信號
代碼片段和文件信息
clear
%%?定義參數
Define_Parameters
global?Vpi?BitNum?SampBit?N?T?F
global??Pcw?VmoduN?VbiasN
%%?輸入信號
Code_In=randint(1BitNum);
a=Code_In*2-1;
%%?NRZ
%Modulation
VinN?=?VmoduN*a;
E_Out_NRZ=ones(1N);
for?k=1:BitNum
????for?j=1:SampBit
????????E_Out_NRZ((k-1)*SampBit+j)=sqrt(Pcw)*cos(pi/2/Vpi*(VinN(k)-VbiasN))...
????????????*exp(1i*pi*VbiasN/2/Vpi);
????end
end
plot(T*10^9abs(E_Out_NRZ))????????????????????????????????????????????????%時域圖
axis([0.5?1.5?-0.5?2.5])
title(‘NRZ-OOK?時序圖‘)
xlabel(‘t(ns)‘)
ylabel(‘E‘)
E_F_NRZ=fftshift(fft(E_Out_NRZ));
figure
plot(F10*log10(abs(E_F_NRZ).^2))??????????????????????????????????????????%頻域圖
%?axis([-200?200?5?-250])
title(‘NRZ-OOK?頻譜圖‘)
xlabel(‘f(GHz)‘)
ylabel
- 上一篇:Matlab分類準確率代碼
- 下一篇:SAR自聚焦算法
評論
共有 條評論