DSPRelated.com
Forums

Eb_N0 vs ber for BPSK demodulation

Started by muhammad avais January 19, 2011
Dear everybody,
I want to plot Eb/N0 vs BER bpsk demodulation in
Matlab. I am using BPSK modulated signal @ carrier frequencey 8KHz, data
rate 1KHz. Sampling rate is set to 96000Hz.
I have tried to use 'awgn function' for adding noise. This signal accepts
Signal to noise ratio (SNR)in parameters. In order to convert into Eb/N0 for
BPSK signal. I have used following relation
SNR = Eb/N0 + 10log(R/B)
Ra rate (1KHz in our case)
B= channel width (I have found in some literature that B=sampling
rate=1/2*sampling rate)
Sampling rate = 96000Hz in our case

Using these values, for Eb/ N0=0 dB, SNR appears to be -19.22dB

When I plot Eb/N0 vs BER using these Eb/N0 values the plot does not match
with ideal BPSK plot.

Can anybody suggest mistake in this formula or guide me how to plot Eb/N0
vs BER for BPSK demodulation?
Thanks,
Avais
Dear Avais
In BER performance simulations in baseband, you are not concerned with carrier
frequency. Here the code which might help you. I am attaching two functions,
save them in same folder and run the first function.

Kind Regards
Anser

_______________________________________________________________________________________________________________

%First function, save it as BER_BPSK

EbNodB =  0:0.1:12;
EbNo   = 10.^(EbNodB./10);
Pe = qfunc(sqrt(EbNo));
semilogy(EbNodB,Pe); title('Error Rate: Theoritical and Simulated Results');
ylabel('Probability of Error');
xlabel('Eb/No (dB)');
hold
%__________________________________________________________________________

Eb = 1;
sgma = Eb./sqrt(2*EbNo);

N = 10000;
s=zeros(1,N);
sa=zeros(1,N);
for n = 1:N,
temp = rand;
if temp >=0.50
s(n) = 1;
else
s(n) = 0;
end
end

numoferr = zeros(1,length(sgma));
for i=1:length(sgma);
for n = 1:N,
       
        %all possibilities have been incorporated
       
        if s(n) == 0,
            rogngauss(sgma(i));  %if 0 is sent this term wiil be maximum
            r1=gngauss(sgma(i));
        else
            ro=gngauss(sgma(i));    
            r1gngauss(sgma(i));  %if 1 is sent this term will be maximum
        end
       
        %the detector will detect on the basis of received power
        if ro>r1
            decflag = 0;
        else
            decflag = 1;
        end
       
        if decflag ~= s(n)
            numoferr(i) = numoferr(i)+1;
        end
end
p(i)= numoferr(i)/N;
end
semilogy(EbNodB,p,'*');
______________________________________________________________________________________________________________

%Second function save it saparately but in same folder as  gngauss

function [gsrv1, gsrv2] = gngauss(m, sgma)
if nargin ==0,
     m=0; sgma=1;
elseif nargin ==1,
    sgma = m; m=0;
end;
u = rand;
z = sgma*(sqrt(2*log(1/(1-u))));
u = rand;
gsrv1 = m+z*cos(2*pi*u);
gsrv2 = m+z*sin(2*pi*u);
 

________________________________
From: muhammad avais
To: c6x
Sent: Wed, 19 January, 2011 9:46:07
Subject: [c6x] Eb_N0 vs ber for BPSK demodulation

 
Dear everybody,
                     I want to plot Eb/N0 vs BER bpsk demodulation in Matlab. I
am using BPSK modulated signal @ carrier frequencey 8KHz, data rate 1KHz.
Sampling rate is set to 96000Hz.

I have tried to use 'awgn function' for adding noise. This signal accepts Signal
to noise ratio (SNR)in parameters. In order to convert into Eb/N0 for BPSK
signal. I have used following relation
         SNR = Eb/N0 + 10log(R/B)
Ra rate (1KHz in our case)
B= channel width (I have found in some literature that B=sampling
rate=1/2*sampling rate)
Sampling rate = 96000Hz in our case

Using these values, for Eb/ N0=0 dB, SNR appears to be -19.22dB

When I plot Eb/N0 vs BER using these Eb/N0 values the plot does not match
with ideal BPSK plot.

 Can anybody suggest mistake in this formula or guide me how to plot Eb/N0 vs
BER for BPSK demodulation?
Thanks,
Avais
Dear anser bhai,
Thank you for your guidance,
In the provided function, i think you have used baseband BPSK. can this method be used for modulated BPSK signal with carrier frequency 8KHz.

I have one more question?
As, I used the awgn function from matlab that accepts snr instead of Eb/N0. I found the following relation in Matlab help
'Comparing Theoratical and Emperical Error rates' between SNR and Eb/No
snr = Eb/N0 + 10log10(k)+3dB
When using this information, I compared plots empirical ber is better than theoretical curve(Which is impossible)

Can you suggest something about this conversio or plots.

Thanks once again.

Allah hafiz
Avais
Dear everybody,
> I want to plot Eb/N0 vs BER bpsk demodulation in
>Matlab. I am using BPSK modulated signal @ carrier frequencey 8KHz, data
>rate 1KHz. Sampling rate is set to 96000Hz.
>I have tried to use 'awgn function' for adding noise. This signal accepts
>Signal to noise ratio (SNR)in parameters. In order to convert into Eb/N0 for
>BPSK signal. I have used following relation
> SNR = Eb/N0 + 10log(R/B)
>Ra rate (1KHz in our case)
>B= channel width (I have found in some literature that B=sampling
>rate=1/2*sampling rate)
>Sampling rate = 96000Hz in our case
>
>Using these values, for Eb/ N0=0 dB, SNR appears to be -19.22dB
>
>When I plot Eb/N0 vs BER using these Eb/N0 values the plot does not match
>with ideal BPSK plot.
>
> Can anybody suggest mistake in this formula or guide me how to plot Eb/N0
>vs BER for BPSK demodulation?
>Thanks,
>Avais

_____________________________________