Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

Problems with program for PSK modulation

Status
Not open for further replies.

miral_07

Newbie level 1
Joined
Dec 20, 2007
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,296
need help

hi can anybody sen me a program for psk modulation over frequencey selective channel........plzzzzzz
thank u vey much in advance
clear all;
clc;
%%
M=2; % size of signal constellation
k= log2(M); % bits per symbol
n= 1000000; % number of bits to process
nsamp=1; % oversampling rate
E =1;
ber =0;
EbNo= 0:2:40; % Signal to noise ration in db
x = randint(n,1); % genarating Random data
xsym = bi2de(reshape(x,k,length(x)/k).','left-msb'); % converting To symbols.
y = modulation(xsym,M); % Modulation

for i=1:length(EbNo);

SNR(i)= 10^((EbNo(i)+10*log10(k))/10); % dB to linear Convertion
sigma = sqrt(E/(2*SNR(i))); % noise variance

yr =distribution(y);
%scatterplot(yr);
ynoisy = noise(yr,sigma); % adding noise to Signal
%scatterplot(ynoisy);

zsym= demodulation(ynoisy,M); % Demodulation
z = de2bi(zsym,'left-msb'); % decimal to binary coversion
z = reshape(z.',prod(size(z)),1); % Symbol to bit converstion

[number_of_errors,bit_error_rate] = biterr(x,z); % calculation of BER
ber(i) = bit_error_rate;
SNR=10^(EbNo(i)/10);
% SNR=exp(EbNo(i)/10); %signal to noise ratio
theo_err_prb(i)= 1/2*(1-sqrt(SNR/(1+SNR))); %theoretical symbol error rate
end
semilogy(EbNo,ber,'b*',EbNo,theo_err_prb,'-*r') % compare the simulated result with theoratical result
grid on;
xlabel('-------EbNo(dB)--------');
ylabel('--------BER----------');
legend(' simulated result',' theoretical result');
hold on;
scatterplot(y,1,0,'g*')
axis([-3 3 -3 3]);
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top