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

📄 bpsk_ber1.m

📁 this is simulation program for baseband bpsk modem
💻 M
字号:
clearN = 10^5 % number of bits or symbols% Transmitterip = rand(1,N)>0.5; % generating 0,1 with equal probabilitys = 2*ip-1; % BPSK modulation 0 -> -1; 1 -> 1 t=1000;b=(12/t)^0.5;for j=1:N        u=rand(1,t);        K=sum(u-0.5);        n(j)=b*K;% n:gnoise signalendEb_N0_dB = [-3:10]; % multiple Eb/N0 valuesfor ii = 1:length(Eb_N0_dB)   % Noise addition   y = s + 10^(-(Eb_N0_dB(ii)+3)/20)*n; % additive white gaussian noise      % receiver - hard decision decoding   y1=y>0;       % counting the errors   e=xor(y1,ip);   nErr(ii)=sum(e);endsimBer = nErr/N; % simulated bertheoryBer = 0.5*erfc(sqrt(10.^(Eb_N0_dB/10))); % theoretical ber% plotclose allfiguresemilogy(Eb_N0_dB,theoryBer,'b.-');hold onsemilogy(Eb_N0_dB,simBer,'mx-');axis([-3 10 10^-5 0.5])grid onlegend('theory', 'simulation');xlabel('Eb/No, dB');ylabel('Bit Error Rate');title('Bit error rate curve for BPSK modulation');

⌨️ 快捷键说明

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