資源簡介
可見光通信中,采用OOKNRZ調制方式時的系統誤碼率,沒問題的。
代碼片段和文件信息
clear
clear?all
close?all
q=1.6e-19;
%?Charge?of?Electron
Ib=202e-6;
%?Background?Noise?Current+interfernce
N0=2*q*Ib;
%?Noise?Spectral?Density?2*q*Ib
Rb=1e6;
%?bit?rate.
Tb=1/Rb;
%?bit?duration
R=1;
%?Receiver?responsivity.
sig_length=1e5;
%?No.?of?bits?in?the?input?OOK?symbols.
snr_dB=0:9;
%?signal-to-noise?ratio?in?dB.
SNR=10.^(snr_dB./10);
%?signal-to-noise?ratio
for?i=1:length(snr_dB)
P_avg(i)=sqrt(N0*Rb*SNR(i)/(2*R^2));
%?average?optical?power
i_peak(i)=2*R*P_avg(i);
%?peak?photocurrent
Ep(i)=i_peak(i)^2*Tb;
%?Peak?Energy
sgma(i)=sqrt(N0*Ep(i)/2);
%?sigma?standard?deviation?of?noise?after?matched?filter
th=0.5*Ep(i);
%?threshold?level
Tx=randint(1sig_length);
%?transmitted?bit
for?j=1?:?sig_length;
MF(j)=Tx(j)*Ep(i)+gngauss(sgma(i));
%matched?filter?output
end
Rx=zeros(1sig_length);
Rx(find(MF>th))=1;
%threshold?detection
[No_of_Error(i)?ber(i)]=biterr(TxRx);
end
figure;
semilogy(snr_dBber‘b‘);
hold?on
semilogy(snr_dBqfunc(sqrt(10.^(snr_dB/10)))‘r-X‘‘linewidth‘2);
%?theoretical?ber?‘mx-‘);
grid?on
legend(‘simulation‘‘theory‘);
xlabel(‘snr_dB?dB‘);
ylabel(‘Bit?Error?Rate‘);
title(‘Bit?error?probability?curve?for?OOK?modulation?using?Matched‘)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1235??2020-09-20?14:57??SimulateBERofOOKNRZ.m
評論
共有 條評論