ASK Modulation using MATLAB: Code and Explanation
Advertisement
This document provides MATLAB source code for Amplitude Shift Keying (ASK) modulation, along with output plots and relevant mathematical equations.
Introduction to ASK Modulation
ASK modulation is a digital modulation technique where the amplitude of the carrier signal is varied according to the digital binary data (1 or 0).
- Binary logic-1 is represented by one level of carrier amplitude (A2).
- Binary logic-0 is represented by another level of carrier amplitude (A1).

Figure 1: ASK Modulation
As illustrated in Figure 1, the inputs are digital binary data and an analog carrier signal. The output is an analog ASK modulated signal.
ASK offers high bandwidth efficiency and a relatively simple receiver design.
See also: Difference between ASK, FSK, and PSK modulation types, and Advantages and Disadvantages of ASK Modulation.
ASK 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
for j = i:.1:i+1
bw(x(i*100:(i+1)*100)) = b(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])
title('Binary Waveform');
xlabel('Time');
ylabel('Amplitude');
subplot(3,1,2)
plot(t,sint)
grid on;
axis([0 n -2 +2])
title('Carrier Signal');
xlabel('Time');
ylabel('Amplitude');
subplot(3,1,3)
plot(t,st)
grid on;
axis([0 n -2 +2])
title('ASK Modulated Signal');
xlabel('Time');
ylabel('Amplitude');
Input and Output of ASK Modulation MATLAB Source Code
-
Provide Input: When prompted, enter the bit stream.

-
Press Enter: After entering the bit stream, press the “ENTER” key. You should get an output similar to the figure below.

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
