0% found this document useful (1 vote)
2K views

Matlab Code For BPSK Modulation

BPSK modulation encodes digital data by changing the phase of a carrier wave. There are two phases - one for a 1 and another for a 0. The phase is shifted by 180 degrees between the two data levels. The MATLAB code generates a BPSK signal by multiplying a carrier wave by a data sequence, where the data is mapped to +1 or -1 values and the carrier phase is shifted according to the data level. The modulated signal and its components are then plotted.

Uploaded by

MithunKumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
2K views

Matlab Code For BPSK Modulation

BPSK modulation encodes digital data by changing the phase of a carrier wave. There are two phases - one for a 1 and another for a 0. The phase is shifted by 180 degrees between the two data levels. The MATLAB code generates a BPSK signal by multiplying a carrier wave by a data sequence, where the data is mapped to +1 or -1 values and the carrier phase is shifted according to the data level. The modulated signal and its components are then plotted.

Uploaded by

MithunKumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

BPSK Modulation

IIn phase shift keying (PSK), the phase of a carrier is changed according to the
modulating waveform which is a digital signal. InBPSK, the transmitted signal is a
sinusoid of !ed amplitude. It has one !ed phase when the data is at one level
and when thedata is at the other level, phase is di"erent #y $%& degree.
MATLAB CODE:-
% Generation of BPSK waveforms
d=[1 0 1 1 0]; % Data sequence
b=2*d-1; % Convert unipolar to bipolar
T=1; % Bit duration
b=T!2; % T"is #ill result in unit a$plitude #ave%or$s
%c=&!T; % Carrier %requenc'
t=linspace(0)*)1000+; % discrete ti$e sequence bet#een 0 and **T (1000 sa$ples+
,=len-t"(t+; % ,u$ber o% sa$ples
,sb=,!len-t"(d+; % ,u$ber o% sa$ples per bit
dd=rep$at(d.)1),sb+; % replicate eac" bit ,sb ti$es
bb=rep$at(b.)1),sb+;
d#=dd.; % Transpose t"e ro#s and colu$ns
d#=d#(/+.; % Convert d# to a colu$n vector (colu$ b' colu$n+ and convert to a
ro# vector
b#=bb.;
b#=b#(/+.; % Data sequence sa$ples
#=sqrt(2*b!T+*cos(2*pi*%c*t+; % carrier #ave%or$
bps01#=b#2*#; % $odulated #ave%or$
% plottin- co$$ands %ollo#
subplot(3)1)1+;
plot(t)d#+; a4is([0 * -12* 12*]+
subplot(3)1)2+;
plot(t)b#+; a4is([0 * -12* 12*]+
subplot(3)1)&+;
plot(t)#+; a4is([0 * -12* 12*]+
subplot(3)1)3+;
plot(t)bps01#).2.+; a4is([0 * -12* 12*]+
4label(.ti$e.+

You might also like