?? hw2a.asv
字號(hào):
close all;
clear all;
clc
echo on
%Input snr_in_db for test
snr_in_db=0:0.2:10;
%thorey BER
for i=1:length(snr_in_db)
snr=10^(snr_in_db(i)/10);
theory_Pe(i)=erfc(sqrt(snr))/2;
end
%simulated BER
for i=1:length(snr_in_db)
simulated_Pe(i)=bpsk_over_awgn(snr_in_db(i));
echo off;
end
%plot in log(db)
semilogy(snr_in_db,theory_Pe);
xlabel('SNR(dB)');
hold;
semilogy(snr_in_db, simulated_Pe,'*');
legend(' theoretical result',' simulated result');
hold off
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -