miral_07
Newbie level 1
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;
%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]);
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;
%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]);