?? comp_exam6_3.m
字號:
clear all % be safe
n = [4 8 12]; % wordlengths
snrtdB = 0:0.1:30; % predetection snr in dB
snrt = 10.^(snrtdB/10); % predetection snr
Pb =0.5*exp(-snrt/2); % bit error probability
hold on % hold for multiple plots
for k=1:length(n)
Pw = 1-(1-Pb).^n(k); % current value of Pw
a = 2^(-2*n(k)); % temporary constant
snrd = 1./(a+Pw*(1-a)); % postdetection snr
snrddB = 10*log10(snrd); % postdetection snr in dB
plot(snrtdB,snrddB)
end
hold off % release
xlabel('Predetection SNR in dB')
ylabel('Postdetection SNR in dB')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -