フィルターのクリア

plotting SNR VS BER

1 回表示 (過去 30 日間)
Salma
Salma 2011 年 5 月 5 日
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 件)

カテゴリ

Help Center および File ExchangeBFSK についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by