Skip to main content

ASK, FSK, and PSK (with MATLAB + Online Simulator)


ASK or OFF ON Keying

ASK is a simple (less complex) Digital Modulation Scheme where we vary the modulation signal's amplitude or voltage by the message signal's amplitude or voltage. We select two levels (two different voltage levels) for transmitting modulated message signals.

Example: "+5 Volt" (upper level) and "0 Volt" (lower level). To transmit binary bit "1", the transmitter sends "+5 Volts", and for bit "0", it sends no power.

The receiver uses filters to detect whether a binary "1" or "0" was transmitted.

Output of ASK, FSK, and PSK modulation using MATLAB
Fig 1: Output of ASK, FSK, and PSK modulation using MATLAB for a data stream "1 1 0 0 1 0 1 0" (Get MATLAB Code)

FSK (Frequency Shift Keying)

In Frequency Shift Keying (FSK), the message signal is modulated using a high-frequency carrier. Binary "1" and "0" are represented by two different frequencies close to the carrier frequency.

For example, using frequencies f1 and f2 (where f1 > f2):

S₁(t) = A cos(2Ï€fc1t) for binary 1
S₂(t) = A cos(2Ï€fc2t) for binary 0

Here, fc1 is different from fc2.

PSK (Phase Shift Keying)

In Phase Shift Keying (PSK), the phase of the carrier signal is changed to represent data bits. Binary "1" is transmitted by shifting the signal’s phase by 180°, while binary "0" keeps the same phase.

s(t) = A cos(2πfct + π) for binary 1
s(t) = A cos(2Ï€fct) for binary 0

Bit Rate Comparison

PSK (Phase Shift Keying)

PSK can use various phase shifts to encode more bits per symbol (e.g., QPSK, 16-PSK). It is the most efficient for high bit rates.

FSK (Frequency Shift Keying)

FSK requires more bandwidth, making it less bit-efficient than PSK for high-speed applications.

ASK (Amplitude Shift Keying)

ASK is highly susceptible to noise and is typically less effective than PSK for high-speed transmission.

Conclusion: PSK can achieve the highest bit rates, especially using higher-order modulation techniques.

MATLAB Code: ASK, FSK, and PSK

This single script generates a random binary sequence and applies all three digital modulation techniques (Amplitude, Frequency, and Phase Shift Keying) for side-by-side comparison.

% DIGITAL MODULATION (ASK, FSK, PSK) 
% Source: SalimWireless.Com 

clc; clear all; close all;

% --- 1. Parameters Configuration ---
Fs = 1000;              % Sampling Frequency
Tb = 1;                 % Bit Duration (seconds)
N_bits = 8;             % Number of bits to transmit
fc = 10;                % Base Carrier Frequency (Hz)
fc2 = 30;               % Secondary Frequency for FSK (Hz)
Ts = 1/Fs;              % Sampling Period
t_bit = 0:Ts:Tb-Ts;     % Time vector for one bit
rng(42);                % For reproducible results

% Generate Random Binary Data
binary_data = randi([0, 1], 1, N_bits);

% --- 2. Signal Generation ---
message_sig = [];
ask_sig = [];
fsk_sig = [];
psk_sig = [];

for bit = binary_data
    % Message Signal (Square wave)
    m_segment = bit * ones(1, length(t_bit));
    message_sig = [message_sig m_segment];
    
    % ASK Logic: Bit 1 = Carrier ON, Bit 0 = Carrier OFF
    ask_seg = bit * sin(2*pi*fc*t_bit);
    ask_sig = [ask_sig ask_seg];
    
    % FSK Logic: Bit 1 = fc2 (High), Bit 0 = fc (Low)
    if bit == 1
        fsk_seg = sin(2*pi*fc2*t_bit);
    else
        fsk_seg = sin(2*pi*fc*t_bit);
    end
    fsk_sig = [fsk_sig fsk_seg];
    
    % PSK Logic: Bit 1 = 180 deg phase, Bit 0 = 0 deg phase
    if bit == 1
        psk_seg = sin(2*pi*fc*t_bit + pi);
    else
        psk_seg = sin(2*pi*fc*t_bit + 0);
    end
    psk_sig = [psk_sig psk_seg];
end

% Total Time Vector for Plotting
t_total = 0:Ts:(N_bits*Tb)-Ts;

% --- 3. Visualization ---
figure('Name', 'Digital Modulation Comparison', 'Color', 'w');

subplot(4,1,1);
plot(t_total, message_sig, 'LineWidth', 2, 'Color', 'k');
title(['Binary Message: ', num2str(binary_data)]); grid on; axis([0 N_bits*Tb -0.5 1.5]);

subplot(4,1,2);
plot(t_total, ask_sig, 'LineWidth', 1, 'Color', 'b');
title('ASK (Amplitude Shift Keying)'); grid on;

subplot(4,1,3);
plot(t_total, fsk_sig, 'LineWidth', 1, 'Color', 'r');
title('FSK (Frequency Shift Keying)'); grid on;

subplot(4,1,4);
plot(t_total, psk_sig, 'LineWidth', 1, 'Color', [0 0.5 0]);
title('PSK (Phase Shift Keying)'); grid on;
xlabel('Time (seconds)');

Interactive Modulation Simulator

Test your binary data (1,0,1,0) and adjust carrier frequencies in our web-based simulator tool.

Launch Full Simulator →

📚 Try Online Interactive Simulators

📚 Further Reading



Contact Us

Name

Email *

Message *

Popular Posts

FFT Butterfly Method Explained (with Simulations)

4-Point FFT Using Butterfly Method Given: x[n] = {0, 1, 2, 3} Step 1: Split into Even & Odd Even indices: x e = {x[0], x[2]} = {0, 2} Odd indices: x o = {x[1], x[3]} = {1, 3} Step 2: 2-point DFT For any {a, b}: DFT = {a + b, a - b} Even Part (E): {0+2, 0-2} = {2, -2} Odd Part (O): {1+3, 1-3} = {4, -2} Step 3: Combine Using Butterfly X[k] = E[k] + W 4 k O[k] X[k + 2] = E[k] - W 4 k O[k] Twiddle Factors (N=4): W 4 0 = 1, W 4 1 = -j Final Calculations: X[0] = E[0] + W 4 0 O[0] = 2 + (1)(4) = 6 X[2] = E[0] - W 4 0 O[0] = 2 - (1)(4) = -2 X[1] = E[1] + W 4 1 O[1] = -2 + (-j)(-2) = -2 + 2j X[3] = E[1] - W 4 1 O[1] = -2 - (-j)(-2) = -2 - 2j Final Answer: X[k] = {6, -2 + 2j, -2, -2 - 2j} 8-Point FFT Using Butterfly Method Given: x[n] = {0,1,2,3,4,5,6,7} Step 1: Split into Bit-Reversed Order To perform DIT-FFT, split the 8 points into pairs of two: Group A: {x[0], x[4]} = {0, 4}...

Design of CMOS Flip-Flops (SR, D, JK)

Design of CMOS Flip-Flops (SR, D, JK) A flip-flop or latch is a circuit with two stable states, used to store state information. It is the basic storage element in sequential logic and a fundamental building block in digital electronics systems, including computers and communication devices. Flip-flops and latches act as data storage elements for states, pulse counting, and synchronization of variably-timed input signals to a reference clock. Flip-flops can be transparent/opaque (latches) or clocked (synchronous, edge-triggered). Latches are level-sensitive, while flip-flops are edge-sensitive. In sequential logic, the output depends on current inputs and previous states. Fig.1 shows a sequential circuit combining a combinational block and a memory element. ...

Pulse Amplitude Modulation and Demodulation

📘 Overview & Theory of Pulse Amplitude Moduation (PAM) 🧮 Pulse Amplitude Demoduation 🧮 MATLAB Code for PAM 📚 Further Reading 📂 Other Topics on Pulse Amplitude Modulation ... 🧮 Simulation results for comparison of PAM, PWM, PPM, DM, and PCM 🧮 Other Pulse Modulation Techniques (e.g., PWM, PPM, DM, and PCM) 🧮 MATLAB Code for Pulse Amplitude Modulation and Demodulation of an Analog Signal (2) 🧮 MATLAB Code for Pulse Amplitude Modulation and Demodulation of Digital data  Pulse Amplitude Modulation (PAM) Sampling allow us to represent real world continuous signal, such as audio or video, in a format suitable for digital processing and storage. This sampled discrete-time signal is inherently digital. A digital signal is a discrete-time signal that is further quantized in amplitude. Pulse Amplitude modulation (PAM) is the modulation technique in which amplitude of carrier pulses is...

MATLAB Code for BER performance of QPSK with BPSK, 4-QAM, 16-QAM, 64-QAM, 256-QAM, etc

📘 Overview 🧮 MATLAB Codes 🧮 Online Simulator for Calculating BER of M-ary PSK and QAM 🧮 QPSK vs BPSK and QAM: A Comparison of Modulation Schemes in Wireless Communication 🧮 Are QPSK and 4-PSK same? 📚 Further Reading   QPSK offers double the data rate of BPSK while maintaining a similar bit error rate at low SNR when Gray coding is used. It shares spectral efficiency with 4-QAM and can outperform 4-QAM or 16-QAM in very noisy channels. QPSK is widely used in practical wireless systems, often alongside QAM in adaptive modulation schemes [Read more...] What is the Gray Code? Gray Code: Gray code is a binary numeral system where two successive values differ in only one bit. This property is called the single-bit difference or unit distance code. It is also known as reflected binary code. Let's convert binary 111 to Gray code: Binary bits: B = 1 1 1 Apply the rule: G[0] = B[0] = 1...

MATLAB Code for QPSK Modulation and Demodulation

📘 Overview 🧮 MATLAB Codes 🧮 Theory 🧮 BER performance of QPSK with BPSK, 4-QAM, 16-QAM, 64-QAM, 256-QAM, etc 📚 Further Reading QPSK Passband Signal Generation Spectral Efficiency in QPSK   Quadrature Phase Shift Keying (QPSK) is a digital modulation scheme that conveys two bits per symbol by changing the phase of the carrier signal. Each pair of bits is mapped to one of four possible phase shifts: 0°, 90°, 180°, or 270° 00  ===> 0 degree phase shift of carrier signal 01  ===> 90 degree 11  ===> 180 degree 10  ===> 270 degree   MATLAB Script clc; clear all; close all; clc; M = 4; data = randi([0 (M-1)], 1000, 1); Phase = 0; modData=pskmod(data,M,Phase); figure(1); scatterplot(modData); channelAWGN = 15; rxData2 = awgn(modData, channelAWGN); figure(2); scatterplot(rxData2); demodData = pskdemod(rxData2,M,Phase);   Result data 1 0 2 2 0 2 1 . . . modData -1.0...

BER vs SNR for M-ary QAM, M-ary PSK, QPSK, BPSK, ...(MATLAB Code + Simulator)

Bit Error Rate (BER) & SNR Guide Analyze communication system performance with our interactive simulators and MATLAB tools. 📘 Theory 🧮 Simulators 💻 MATLAB Code 📚 Resources BER Definition SNR Formula BER Calculator MATLAB Comparison 📂 Explore M-ary QAM, PSK, and QPSK Topics ▼ 🧮 Constellation Simulator: M-ary QAM 🧮 Constellation Simulator: M-ary PSK 🧮 BER calculation for ASK, FSK, and PSK 🧮 Approaches to BER vs SNR Calculation What is Bit Error Rate (BER)? The BER indicates how many corrupted bits are received compared to the total number of bits sent. It is the primary figur...

Frequency Bands : EHF, SHF, UHF, VHF, HF, MF, LF, VLF and Their Uses

Frequency Bands >> EHF, SHF, UHF, VHF, HF, MF, LF... Frequency Bands and Their Uses 1. Extremely High Frequency (EHF) 30 - 300 GHz Uses 5G Networks 5G millimeter wave band 6G and beyond (Experimental) RADAR 2. Super High Frequency (SHF) 3 - 30 GHz Uses Ultra-wideband (UWB) Airborne RADAR Satellite Communication Microwave Link Communication or SATCOM 3. Ultra High Frequency (UHF) 300 - 3000 MHz Uses Satellite Communication Television Surveillance Navigation aids Also, read important wireless communication terms 4....

FM Bandwidth and FM Band Explained

FM radio uses the frequency band from 88 MHz to 108 MHz , which is a 20 MHz-wide spectrum . This is the range of carrier frequencies available to stations. 108 MHz − 88 MHz = 20 MHz However, a single FM station occupies only about 200 kHz . This is the bandwidth of the modulated FM signal. 1. Why One FM Station Needs ~200 kHz FM uses frequency modulation . The bandwidth depends on how far the carrier swings. Carson's Rule gives the approximate FM bandwidth: B = 2 ( Δf + f m ) ...