Code covered by the BSD License  

Highlights from
AM_communication_blocks_codes

image thumbnail

AM_communication_blocks_codes

by

 

AM & other communication systems basic blocksets

error_probability.m
%This calculates bit probability of error (or upper limit) for different types
%of modulation schemes contaminated by white gaussian noise. Note that by
%using 'input, data can be entered by user at the command prompt. Press
%'Enter' after entering input data.

choice=input('Enter 1:BPSK, 2:QPSK, 3:MSK, 4:16-QASK, 5:QPR, 6:MPSK, 7:ortho.MFSK - ');
SNR=input('Enter Eb/eta ratio i.e. bit energy to twice of PSD - ');

if choice > 5,
    M=input('Enter no. of symbols in integer power of 2 - ');
end

if choice < 4,
    Pe = 0.5*erfc(sqrt(SNR));
end

if choice == 4,
    Pe = 2*erfc(sqrt(0.4*SNR));
end

if choice == 5,
    Pe = 0.5*erfc(sqrt(pi*pi*SNR/16));
end

if choice == 6,
    N = log2(M);
    Pe = erfc(sqrt(N*SNR)*sin(pi/M));
end

if choice == 7,
    N = log2(M);
    Pe = ((M-1)/2)*erfc(sqrt(N*SNR/2));
end

Error_Probability = Pe

Contact us