필터 지우기
필터 지우기

FSK mod and demod with fading and noise

조회 수: 1 (최근 30일)
Salma
Salma 2011년 4월 28일
I'm trying to design FSK modulator and demodulator with noise and flat fading but the graph of snr vs ber with fading in wrong, any idea how to fix it??
clear all;clf;clc;close all;
M = 2;
k = log2(M);
EbNo = 5;
Fs = 16;
nsamp = 17;
freqsep = 8;
n=10000;
msg = randint(n,1,M);
txsig = fskmod(msg,M,freqsep,nsamp,Fs);
ab=abs(txsig);
ps=(sum(ab.^2))/n;
for snr=1:30
pn=10.^(-0.1.*snr).*ps;
noise= sqrt(pn)*randn(1,n*nsamp);
G1=randn(1,n); %generating fading coefficients
G2=randn(1,n);
v= sqrt(power(G1,2)+ power(G2,2));
A=v(2);
theta=2*pi*rand;
alph=A*exp(j*theta);
msg_rx = alph*txsig + noise'; % txsig is 1700x1 and noise is 1x1700, so need transpose
msg_rxx=msg_rx.*(1/A)*conj(alph);
msg_rrx = fskdemod(msg_rxx,M,freqsep,nsamp,Fs);
[num,BER] = biterr(msg,msg_rrx); % Bit error rate
w(snr)=BER;
end
d=[1:30];
figure
semilogy(d,w)

답변 (0개)

카테고리

Help CenterFile Exchange에서 FSK에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by