Skip to main content

How to Plot BER vs SNR Graph in MATLAB


MATLAB Code

clc;
clear all;
close all;
snr = 0:2:16;
for i = 1:length(snr)
rng(10)
M = 8; % M = 2, 4, 8, 16, 32, etc.
N_Bits = 2520;
Phase = 0;
data_info_bit = randi([0,1],N_Bits,1);
data_temp = bi2de(reshape(data_info_bit,N_Bits/log2(M),log2(M)));
modData = pskmod(data_temp,M,Phase);



rxData2 = awgn(modData, snr(i));

Received_info = pskdemod(rxData2,M,Phase);

Received_info2 = de2bi(Received_info);
Received_info2 = [Received_info2(:,1)' Received_info2(:,2)' Received_info2(:,3)']


            




errors(i) = [(sum(xor(data_info_bit', Received_info2)))]



err_ber_fram(i) = errors(i)/length(Received_info2)


end

semilogy(snr, err_ber_fram,'-*','LineWidth',2);
title(sprintf('8-PSK'))
ylabel('BER'); xlabel('SNR in dB');grid on

 Output

 
 

 Copy the MATLAB Code from here

 

 

 

Read more about

 [1] MATLAB Code for BER vs SNR for m-ary QAM, m-ary PSK, QPSK, BPSK ...

[2] MATLAB Code for BER vs SNR for QAM 

[3] MATLAB Code for BER vs SNR for ASK, FSK, and PSK 

More ...

People are good at skipping over material they already know!

View Related Topics to







Contact Us

Name

Email *

Message *

Popular Posts

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 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 figure of merit for a...

Online Simulator for ASK, FSK, and PSK

Try our new Digital Signal Processing Simulator!   •   Interactive ASK, FSK, and BPSK tools updated for 2025. Start Now Interactive Modulation Simulators Visualize binary modulation techniques (ASK, FSK, BPSK) in real-time with adjustable carrier and sampling parameters. ๐Ÿ“ก ASK Simulator ๐Ÿ“ถ FSK Simulator ๐ŸŽš️ BPSK Simulator ๐Ÿ“š More Topics ASK Modulator FSK Modulator BPSK Modulator More Topics Simulator for Binary ASK Modulation Digital Message Bits Carrier Freq (Hz) Sampling Rate (...

Constellation Diagrams of ASK, PSK, and FSK (with MATLAB Code + Simulator)

Constellation Diagrams: ASK, FSK, and PSK Comprehensive guide to signal space representation, including interactive simulators and MATLAB implementations. ๐Ÿ“˜ Overview ๐Ÿงฎ Simulator ⚖️ Theory ๐Ÿ“š Resources Definitions Constellation Tool Key Points MATLAB Code ๐Ÿ“‚ Other Topics: M-ary PSK & QAM Diagrams ▼ ๐Ÿงฎ Simulator for M-ary PSK Constellation ๐Ÿงฎ Simulator for M-ary QAM Constellation BASK (Binary ASK) Modulation Transmits one of two signals: 0 or -√Eb, where Eb​ is the energy per bit. These signals represent binary 0 and 1. BFSK (Binary FSK) Modulation Transmits one ...

Online Simulator for Frequency Modulatiuon

Frequency Modulation Message Frequency (Hz): Generate Message Carrier Frequency (Hz): Generate Carrier Message Signal Amplitude: Carrier Signal Amplitude: Generate Modulated Signal Demodulate Further Reading  Amplitude Modulation Simulator Phase Modulation Simulator  Explore DSP Simulations   Online Signal Processing Simulations Home Page >

UGC NET Electronic Science Previous Year Question Papers

Home / Engineering & Other Exams / UGC NET 2022 PYQ ๐Ÿ“ฅ Download UGC NET Electronics PDFs Complete collection of previous year question papers, answer keys and explanations for Subject Code 88. Start Downloading UGC-NET (Electronics Science, Subject code: 88) Subject_Code : 88; Department : Electronic Science; ๐Ÿ“‚ View All Question Papers UGC Net Electronic Science Question Paper With Answer Key Download Pdf [June 2025] with full explanation UGC Net Electronic Science Question Paper With Answer Key Download Pdf [December 2024] UGC Net Paper 1 With Answer Key Download Pdf [Sep 2024] with full explanation UGC Net Electronic Science Question Paper With Answer Key Download Pdf [Aug 2024] with full explanation UGC Net Paper 1 With Answer Key Download...

Time / Frequency Separation for Orthogonality

๐Ÿ“˜ Theory ๐Ÿ“ Derivation ๐Ÿ“Š Examples ๐Ÿงฎ Simulator Try the Interactive BFSK / FM Simulator Visualize modulation and understand concepts faster. Launch BFSK Simulator Launch FM Simulator BFSK Orthogonality Simulator Derivation of Frequency Separation for Orthogonality Step 1: Define BFSK Signals Copy s₁(t) = √(2E b /T) cos(2ฯ€f₁t) Copy s₂(t) = √(2E b /T) cos(2ฯ€f₂t) Defined over: 0 ≤ t ≤ T For orthogonality: Copy ∫₀แต€ s₁(t)s₂(t) dt = 0 Step 2: Remove Constants Copy ∫₀แต€ cos(2ฯ€f₁t) cos(2ฯ€f₂t) dt = 0 Step 3: Use Trigonometric Identity Copy cos A cos B = ½ [ cos(A − B) + cos(A + B) ] Applying identity: Copy ½ ∫₀แต€ [ cos(2ฯ€(f₁ − f₂)t) + cos(2ฯ€(f₁ + f₂)t) ] dt Ste...

FM Modulation Online Simulator

Frequency Modulation Simulator Message Frequency (fm): Hz Carrier Frequency (fc): Hz Carrier Amplitude (Ac): Modulation Index (ฮฒ): Frequency deviation ฮ”f = ฮฒ × fm Online Signal Processing Simulations Home Page >

Theoretical vs. simulated BER vs. SNR for ASK, FSK, and PSK (MATLAB Code + Simulator)

๐Ÿ“˜ Overview ๐Ÿงฎ Simulator for calculating BER ๐Ÿงฎ MATLAB Codes for calculating theoretical BER ๐Ÿงฎ MATLAB Codes for calculating simulated BER ๐Ÿ“š Further Reading BER vs. SNR denotes how many bits in error are received for a given signal-to-noise ratio, typically measured in dB. Common noise types in wireless systems: 1. Additive White Gaussian Noise (AWGN) 2. Rayleigh Fading AWGN adds random noise; Rayleigh fading attenuates the signal variably. A good SNR helps reduce these effects. Simulator for calculating BER vs SNR for binary ASK, FSK, and PSK Calculate BER for Binary ASK Modulation Enter SNR (dB): Calculate BER Calculate BER for Binary FSK Modulation Enter SNR (dB): Calculate BER Calculate BER for Binary PSK Modulation Enter SNR (dB): Calculate BER BER vs. SNR Curves MATLAB Code for Theoretical BER % The code is written by SalimWireless.Com clc; clear; close all; % SNR va...