⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hw2a.asv

📁 To calculation the BER of BPSK over AWGN ang Rayleigh Fading channel.
💻 ASV
字号:
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	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -