plotting SNR VS BER
1 次查看(过去 30 天)
显示 更早的评论
i want to plot the SNR and BER of this code, any idea???
clear all;clf;clc;close all;
M = 2;
k = log2(M);
EbNo = 5;
Fs = 16;
nsamp = 17;
freqsep = 8;
n=100000;
msg = randint(n,1,M);
txsig = fskmod(msg,M,freqsep,nsamp,Fs);
ab=abs(txsig);
ps=(sum(ab.^2))/n; %for SNR
%Impulsive noise
A=0.01;
gama=0.01;
sigma=0.4;
% and pn= ps/sigma
sigma0= sigma * (gama/(1+gama));
sigma1=sigma*((1/A)+gama /(1+gama));
sigma2=sigma*((2/A)+gama /(1+gama)) ;
nongas= exp(-0.01).* (sqrt(sigma0)*randn(1,n*nsamp)+sqrt(sigma1)*randn(1,n*nsamp)* A +sqrt(sigma2)*randn(1,n*nsamp)*A^2 );
ngnoise= txsig+ nongas';
msg_rrx = fskdemod(ngnoise,M,freqsep,nsamp,Fs);
[num,BER] = biterr(msg,msg_rrx)
end
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 BFSK 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!