Sie sind auf Seite 1von 4

Exam 1

BPSK Modulation and Demodulation with


Carrier Frequency Offset
Jarmanjeet Singh Brar
Electrical Engineering, California State University, Long Beach
1250 Bellflower Boulevard
Long Beach, CA 90840
jarmanbrar1992@gmail.com

Abstract---- The goal of this lab are to learn the BPSK


II. BACKGROUND
modem and simulate a simplified unfiltered BPSK modem
by using an FFT receiver, including bit error rate (BER)
measurement. The received baseband signal from an AWGN channel may be
expressed as
Keywords---- BPSK, FFT, Bit Error Rate, NRZ, Timing r (t )  s (t )  w(t )
Offset, Frequency Offset, MATLAB
Where w(t ) is a eero mean white Gaussian noise with
variance = No/2.
I. INTRODUCTION
BPSK modem is widely used diverse areas, including military The simplified transmitter and receiver model is depicted in
and commercial communication system. Figure 1. Note that the input data source (0 or 1) must be
In this project, we implement the simulation model of the converted to the non-return-eero (NRZ) format (-1 or 1). For
BPSK transmitter and receiver as shown in Figure.1. When a the required simulation in this project, the NRZ data is
signal is transmitted through a channel, some noise in the digitieed and modulated at the transmitter.
channel is added to the transmitted signal and we receive a At the receiver, the match filter (integrate-and-dump circuit)
distorted version of transmitted signal. We consider channel to is implemented by using a FFT processor. The FFT output of
be an AWGN channel. At receiver, the transmitted signal is the kth bin at the time i is
demodulated by a FFT processor, and then the detector
observes the real part of the FFT outputs to decide the ( i 1)T

j 2kt
1
transmitted signal. Finally, we find bit error rate by comparing
the output signal and the input signal.
z k ,i 
T 
iT
r (t )e T
dt

Assuming that there is no timing error at the receiver, i.e., the


demodulator is time synchronieed. The FFT bin of the desired
frequency is selected as the demodulator output. The detector
observes real(ek,i), the real part of FFT output of the desired
frequency bin and decided whether the transmitted signal
waveform is s 0 (t ) or s1 (t ) , which correspond to the
transmission of either a 0 or a 1, respectively. In other words,
Fig.1 The Simulation model of the BPSK transmitter and receiver. if real(ek,i)> 0, then the transmitted bit is 1, and if real(ek,i)< 0,
then the transmitted bit is –1. The optimum detector is
defined as the detector that minimiees the probability of error.
The detector output is compared with the transmitted sequence
(NRZ data), and an error counter is used to count the number
of symbol errors. The bit error rate (BER) is then obtained.
The theoretical BER of the coherent BPSK modem is

 2E  
u2
Pe  Q   1 erfc( E )  1
  2
exp(  )du
 No  2 No 2E
2
No

III. LAB
Assuming that the data rate rb is 1 bit/sec. Choose the carrier
frequency fo = 4 rb = 4 He. Design and simulate the transmitter
at the baseband operation. The NRZ data can be generated by
using a random number generator. The sampling frequency of
the data is chosen to be 32* rb. The same sampling frequency
is also applied to the tone generator, which represents the
carrier frequency. Fig.3 Signal with AWGN

Ques. 1: Plot the waveform of si (n). Ques 3: Design a 32-point FFT processor to process the
received signal. In other words, the FFT processor is
employed for each 32 received samples. Find the FFT bin
which represents the desired channel.

Fig.2 Transmitted signal

Ques 2: Produce the received signal, i.e. add white Gaussian


Fig.4: The 16-point FFT output
noise (AWGN) into the transmitted signal. The mean of
AWGN is eero and the noise power (variance) is (assuming
that the amplitude of the carrier A=1) From figure 4, the equation,
Fo/fs = m/N

=> m = N(Fo/fs) = 32 (4/32) = 4

is proved by observing the FFT bins.


Matlab Code: %----------------detector----------------
clear all; if real(z(m*(j-1)+k+1))>0
clc; d(l,j) = 1;
%-----------Random Number Generator------ else
N = 10000; d(l,j) = -1;
s = randint(1,N); end
%error counter
%-----Transmitted signal converted to---- if d(l,j)~= nrzdata(1,fs*(j-1)+1)
---------------NRZ & sampled------------- error(l) = error(l)+1;
else
rb = 1; end
fs = 32*rb; end
Ts = 1/fs; end
t = 0:Ts:N-Ts; figure(2);
nrzdata = zeros(size(t)); plot(X(1:10*fs));
a = ones(1,fs); title(' Signal with AWGN, EbNo is 3db');
for i = 1:N figure(3);
if s(i) == 1 plot(0:m*1-
nrzdata(1,fs*(i-1)+1:fs*i) = a; 1,real(z(1:m*1))),grid(gca,'minor');
else xlabel('FFT bin');
nrzdata(1,fs*(i-1)+1:fs*i) = -a; ylabel('Amplititude');
end
end
Ques 4: Compute bit error rate by varying Eb/No (dB). Plot
%-----Modulation, Transmitted Signal----- both theoretical and experimental curves, i.e., BER vs. Eb/No
f0 = 4; (dB). You may need to run simulation to have at least 10000
n = t*fs; symbols to get an accurate BER at 10-3.
S = nrzdata.*cos(2*pi*f0*n/fs);
figure(1);
plot(S(1:10*fs));
title(' Transmitted Signal ');

%-----------------AWGN-------------------

EbN0 = 0:1:6;
L=1;
NPower = 0.25*(fs/rs)./10.^(0.1.*EbN0);
d = zeros(length(EbN0),N);
z = zeros(size(s));
error = zeros(length(EbN0),1);
for l = 1: length(EbN0);
wn = sqrt(NPower(l)).*
randn(1,length(nrzdata));
X = S+wn;
%32-point FFT
m = 32;
k = m*(f0/fs);

%----------------Receiver---------------- Fig. 6 The theoretical and experimental curve of BER vs.Eb/N0 (dB)
for j = 1:N
z(m*(j-1)+1:m*j) = fft(X(fs*(j-
1)+1:fs*j),m)/m;
Matlab Code:
th=0.5*erfc(sqrt(10.^(EbN0/10)));
BER = error/N;
figure(4);
semilogy(EbN0,BER,'*'),grid(gca);
xlabel('Eb/N0(dB)')
ylabel('BER')
title('BER vs. Eb/N0(dB)');
hold on;
semilogy(EbN0,th);
legend(' simulation error curve ','
theoretical error curve');
hold off;

Ques 6: Assuming there is a frequency offset, simulate the


frequency offset 2%, 4%, 8% of the carrier frequency fo. Plot
the BER curves and compare with the theoretical coherent
BER.

We loop the entire program for different fo values equal to fo


(1+0.02), fo (1+0.04) and fo (1+0.08).

We have carrier frequency fo = 4.


So we loop for a list of values [4.08, 4.16, 4.32]

IV. CONCLUSIONS
In this project, We learnt how signal is transmitted and
received and understood how to simulate a simplified BPSK
modem and how the signal is reconstructed back at the output
of the demodulator.

V. REFERENCES

[1].H. HARADA AND R. PRASAD, SIMULATION AND SOFTWARE RADIO


FOR MOBILE COMMUNICATIONS, BOSTON, ARTECH HOUSE, 2002.
ISBN 978-1-58053-044-6

Das könnte Ihnen auch gefallen