PSK Modulation in MATLAB: Code and Explanation
Advertisement
This page provides MATLAB source code for PSK (Phase Shift Keying) modulation. The output plots and mathematical equations are also discussed.
PSK modulation is a digital modulation technique where the phase of the carrier signal varies according to the digital binary data (1 or 0).
Introduction:
- Binary logic-1 typically represents a 180-degree phase shift of the carrier.
- Binary logic-0 represents a 0-degree phase shift.
This type of PSK is also known as BPSK (Binary Phase Shift Keying).

Fig.3 PSK Modulation
Figure 1 depicts the PSK modulation process. The inputs are digital binary data and an analog carrier signal, while the output is the analog PSK modulated signal.
PSK is a power-efficient system but offers lower bandwidth efficiency compared to other modulation schemes. Variants of PSK, such as 16-QAM, 64-QAM, and 256-QAM, are widely used in wireless communication for high data rate modulation.
Also, see the 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. Provide the input as prompted:

After entering the input and pressing the “ENTER” key, you will see the output MATLAB image as shown below:

Explore MATLAB Wireless Communications & Modulation
- AM/FM/PM Modulation in MATLAB
- ASK Modulation in MATLAB
- FSK Modulation in MATLAB
- MSK Modulation in MATLAB
- GMSK Modulation in MATLAB
- PSK Modulation (MATLAB Code)
- BPSK, QPSK, 16-QAM, 64-QAM (MATLAB Code)
- On-Off Keying (OOK) (MATLAB Code)
- OFDM (MATLAB Code)
- OFDMA Basics (MATLAB Code)
- SC-FDMA Basics (MATLAB Implementation)
- WiMAX OFDM Basics (MATLAB Code)
- WLAN OFDM Basics (MATLAB Code)
- LTE Basics (MATLAB Code)
- OFCDM (MATLAB Code)
- Beamforming (MATLAB Code QAM)
- 2x2 MIMO & STBC (MATLAB Code)
- CDMA (MATLAB Code)
- Zigbee Transceiver (MATLAB Code)
Continue Learning Modulation Types
- AM Vs. FM Vs. PM : Difference between Analog Modulation Techniques
- ASK Vs. FSK Vs. PSK : Difference between Digital Modulation Techniques
- PAM Vs. PWM Vs. PPM : Difference between Pulse Modulation Techniques
- BPSK Vs. QPSK : Key Differences
- 16-QAM Vs. 64-QAM Vs. 256-QAM : Key Differences
- 512-QAM Vs. 1024-QAM Vs. 2048-QAM Vs. 4096-QAM
- 4096QAM Modulation Used in Wi-Fi 7
- MSK Vs. GMSK : Modulation Technique used in GSM
- LORa Modulation Used in LoRaWAN
- 10% ASK & 100% ASK Modulation used in NFC
- OOK Vs. VPPM Vs. CSK : Visible Light Communication (VLC) Modulation Techniques
- QPSK Vs. OQPSK Vs. PI/4 QPSK
- PAM4 Modulation Used in Gigabit Ethernet
- CCK Vs. DSSS Vs. OFDM Used in WLAN (Wi-Fi) Standards
