### Welcome to EDAboard.com

#### Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Status
Not open for further replies.

#### Nourhan Soliman

##### Newbie level 1
fsk modulator and demodulator with noise

%%%%%%%%%%%%%fsk mod and demod%%%%%%%%%%%%%%%%%%%%

M = 2;
k = log2(M);
EbNo = 5;
Fs = 16;
nsamp = 17;
freqsep = 8;
n=100;

msg = randint(n,1,M); % Random signal
txsig = fskmod(msg,M,freqsep,nsamp,Fs); % Modulate.

ab=abs(txsig);
ps=(sum(ab.^2))/n;
snr=30;
pn=10.^(-0.1.*snr).*ps;
noise= sqrt(pn)*randn(1,n);

%generation of Gaussian noise

A= sqrt(randn^2+randn^2);
theta=2*pi*rand;

msg_rx = A*exp(j*theta)*txsig + noise(2) ; %fading

msg_rrx = fskdemod(msg_rx,M,freqsep,nsamp,Fs); % Demodulate

[num,BER] = biterr(msg,msg_rrx) % Bit error rate

BER_theory = berawgn(EbNo,'fsk',M,'noncoherent') % Theoretical BER

does anyone know why the BER is zero although i added noise??

Last edited:

Status
Not open for further replies.

Replies
0
Views
1K
Replies
4
Views
3K
Replies
10
Views
28K
Replies
5
Views
1K
Replies
2
Views
3K