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!