Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
20Activity
0 of .
Results for:
No results containing your search query
P. 1
Matlab Code for PSK Demodulator

Matlab Code for PSK Demodulator

Ratings: (0)|Views: 1,404|Likes:
Published by Dilshini Jayamaha

More info:

Categories:Types, School Work
Published by: Dilshini Jayamaha on Feb 08, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

07/14/2013

pdf

text

original

 
% ----------------------------------------
 
% +++++ Simulation of PSK Demodulator +++++++
 
% For simplicity only the detector (after sampling) is simulated.
 
% ----------------------------------------clearall; closeall;
 
E = 1 ;% normalized to unit energy
 
snr_dB = 20 ;
 
N = 10000 ;% no of bits ...
 
M = 8 ;% no. of levels ...
 
phi = 0*pi/180 ;% carrier phase off-set in radian ..
 
snr = exp(snr_dB*log(10)/10) ;
 
sig = E/sqrt(2*snr) ;% this is detector noise std deviation
 
% the detector signals and symbol error ....
 
err = 0 ;
 
fori=1:N
 
tt = rand;% tt is uniformly distributed in 0->1 .
 
src = floor(rand*M) ;% simulate symbols 0 -- M-1 ....
 
r0(i) = cos(phi+2*pi*src/M) + sig*randn ;% WGNr1(i) = sin(phi+2*pi*src/M) + sig*randn ;
 
ang = atan2(r1(i),r0(i)) ;
 
if(ang < 0)
 
ang = ang + 2*pi ;% angle in 0 --> 2*pi
 
end;
 
det = round(M*ang/(2*pi)) ;
 
if(det == M )det = 0 ;
 
end;
 
if(det ~= src)err = err + 1 ;
 
end;
 
end;
 
SER = err/N ;
 
% calculte therotical BER ...in a SNR (db) range
 
dbR = 0:1:20 ;
 
fori = 1:length(dbR)
 
snr = exp(dbR(i)*log(10)/10) ;
 
SERT(i) = erfc(sqrt(snr)*sin(pi/M)) ;
 
end;
 
figure(1); plot(r0,r1,'.');
 
holdon;fork=1:M
 
plot([0 2*cos((2*k-1)*pi/M)], [0 2*sin((2*k-1)*pi/M)],'r--') ;end;
 
holdoff;
 
axis([-1.5 1.5 -1.5 1.5]);grid;
 
title('Signal constellations (normalized by Energy)');
 
xlabel('real part');
 

Activity (20)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Milruwan Perera liked this
Shruti Saikumar liked this
Epinso Merum liked this
hkcaptainas liked this
Nourhan Elbadri liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->