0% found this document useful (0 votes)
771 views1 page

Code Matlab BPSK

The document describes simulating binary phase-shift keying (BPSK) modulation in MATLAB. It generates a random digital message using M-ary PSK, modulates the message using BPSK, transmits the signal over an additive white Gaussian noise channel, recovers the message using demodulation, and calculates the symbol error rate.

Uploaded by

mugilank
Copyright
© Attribution Non-Commercial (BY-NC)
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 (0 votes)
771 views1 page

Code Matlab BPSK

The document describes simulating binary phase-shift keying (BPSK) modulation in MATLAB. It generates a random digital message using M-ary PSK, modulates the message using BPSK, transmits the signal over an additive white Gaussian noise channel, recovers the message using demodulation, and calculates the symbol error rate.

Uploaded by

mugilank
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 1

code matlab bpsk

clc;
clear all;
disp('M-Array PSK Modulation')
%create a random digital message
M=input ('M= '); %alphabet size
x=randint(input('Number of binary bit stream = '),1,M);
nsample=40; %oversampling rate.
%%

%%
%use M-PSK modulation to produce y
y=modulate(modem.pskmod(M),x);
%%
%follow with rectangular pulse shaping.
ypulse=rectpulse(y,nsample);
stem(y(1:10),'filled'),grid;
%%
%%transmit signal through an AWGN Channel
ynoisy=awgn(ypulse,input('SNR in dB = '),'measured');
%%
%Create scattet plot from noisy data
scatterplot(ynoisy),grid;
%%
%Downsample at the reciever.
ydownsample=intdump(ynoisy,nsample);
%%
%Demodulate ynoisy to recover the message.
z=demodulate(modem.pskdemod(M),ydownsample);
figure;
subplot(2,1,1);
stem(x(1:10),'filled'),grid;
subplot(2,1,2);
stem(z(1:10),'filled'),grid;
%%
%Check symbole erroe rate.
[num ty]=symerr(x,z)

You might also like