# RF Wireless World

## Home of RF and Wireless Vendors and Resources

One Stop For Your RF and Wireless Need

## PSK matlab code | PSK modulation matlab source code

This page of MATLAB source code covers PSK matlab code. The output plots and mathematical equations of PSK modulation matlab code are mentioned. PSK modulation stands for Phase Shift Keying Modulation.

Introduction:
The PSK modulation is a digital modulation technique in which phase of the carrier signal varies in accordance to the digital binary data (1 or 0). Binary logic-1 represents 180 degree phase of the carrier and logic-0 represents 0 degree phase. This type of PSK is also known as BPSK (Binary Phase Shift Keying). Fig.3 PSK Modulation

The figure-1 depicts PSK modulation type. As shown inputs are digital binary data and analog carrier while output is analog PSK modulated signal. It is power efficient system but offers low bandwidth efficiency. The variants of PSK such as 16-QAM, 64-QAM and 256-QAM are widely used in wireless communication as high data rate modulation. Also refer difference between ASK, FSK and PSK modulation types>>.

### PSK matlab code

clear;
clc;
b = input('Enter the Bit stream \n '); %b = [0 1 0 1 1 1 0];
n = length(b);
t = 0:.01:n;
x = 1:1:(n+1)*100;
for i = 1:n
if (b(i) == 0)
b_p(i) = -1;
else
b_p(i) = 1;
end
for j = i:.1:i+1
bw(x(i*100:(i+1)*100)) = b_p(i);
end
end
bw = bw(100:end);
sint = sin(2*pi*t);
st = bw.*sint;
subplot(3,1,1)
plot(t,bw)
grid on ; axis([0 n -2 +2])
subplot(3,1,2)
plot(t,sint)
grid on ; axis([0 n -2 +2])
subplot(3,1,3)
plot(t,st)
grid on ; axis([0 n -2 +2])

### Input and Output of PSK modulation matlab source code

Run the downloaded PSKModulation.m file after unzipping the folder. and provide input as follows. After the input is given press "ENTER" key, you will get output matlab image as below. 