Pages

Friday, 9 November 2012

Comparison of Error Probability Curve of M-ary PSK & M-ary PAM (Matlab 2012a)

Program
clc;
clear all;
m = input('Enter the value of m = ');
eb_no = 0:0.001:25;
k = log2(m);
nsample = 1;
es_db = eb_no + 10*log(k) + 10*log(nsample);
es = db2mag(es_db);
z = sqrt(6*es/(m*(m-1)));
p_pam = 2*((m-1)/m)*qfunc(z);
semilogy(eb_no,p_pam,'g');
hold on;
p_mpsk = 2*qfunc(sqrt(2*es)).*sin(pi/m);
semilogy(eb_no,p_mpsk,'r');
xlabel('SNR ----->');
ylabel('Probability of Error ----->');
title('Comparison of Probability of error of MPAM & MPSK');
grid on;
legend('MPSK','MPAM');


Output:

Enter the value of m = 4

OutputGraph:

 

1 comment:

  1. Undefined function 'qfunc' for input arguments of type 'double'.
    iam having the above error when i run this.
    can you help me out
    thanks

    ReplyDelete