Skip to main content

Alamouti Scheme for 2x2 MIMO in MATLAB


 

 Read about the Alamouti Scheme first

MATLAB Code for Alamouti's Precoding Matrix for 2 X 2 MIMO

% Clear any existing data and figures
clc;
clear;
close all;

% Define system parameters
transmitAntennas = 2; % Number of antennas at the transmitter
receiveAntennas = 2; % Number of antennas at the receiver
symbolCount = 1000000; % Number of symbols to transmit
SNR_dB = 15; % Signal-to-Noise Ratio in decibels

% Generate random binary data for transmission
rng(10); % Set seed for reproducibility
transmitData = randi([0, 1], transmitAntennas, symbolCount);

% Perform Binary Phase Shift Keying (BPSK) modulation
modulatedSymbols = 1 - 2 * transmitData;

% Define Alamouti's Precoding Matrix
precodingMatrix = [1 1; -1i 1i];

% Encode and transmit data using Alamouti scheme
transmittedSymbols = zeros(transmitAntennas, symbolCount);
for idx = 1:2:symbolCount
transmittedSymbols(:, idx:idx+1) = precodingMatrix * modulatedSymbols(:, idx:idx+1);
end

% Simulate Rayleigh fading channel
channelMatrix = (randn(receiveAntennas, transmitAntennas) + 1i * randn(receiveAntennas, transmitAntennas)) / sqrt(2);

% Receive signal and add AWGN
receivedSignal = awgn(channelMatrix * transmittedSymbols, SNR_dB, 'measured');

% Decode and demodulate received symbols
decodedSymbols = zeros(transmitAntennas, symbolCount);
for idx = 1:2:symbolCount
% Estimate received symbols using channel information
receivedEstimation = channelMatrix' * receivedSignal(:, idx:idx+1);
% Decode symbols using Alamouti decoding
decodedSymbols(:, idx:idx+1) = precodingMatrix' * receivedEstimation;
end

% Perform BPSK demodulation to retrieve received binary data
receivedBinaryData = decodedSymbols < 0;

% Calculate error rate
errorCount = sum(sum(transmitData ~= receivedBinaryData));
errorRate = errorCount / (transmitAntennas * symbolCount);

% Display the error rate
disp(['Error rate: ', num2str(errorRate)]);

 

Output

 Error rate: 0

You can run a loop by varying the SNR values. You can plot the BER vs SNR graph easily.

 

Copy the MATLAB Code from Here

 

 

Alamouti Scheme Transmission Table

 

 

 

 

 

 

 

 

The above table illustrates how two orthogonal, time-diversity data streams are transmitted using two different time slots to improve the signal-to-noise ratio (SNR) at the receiver.

For a symbol stream S1,S2,S3,S4,,Sn1,SnS_1, S_2, S_3, S_4, \ldots, S_{n-1}, S_n, we first transmit S1S_1 and S2S_2 from antenna 1 and antenna 2, respectively. In the next time slot, we transmit S2-S_2^* and S1S_1^* from antenna 1 and antenna 2, respectively.

Note: To enable the Alamouti scheme, at least two transmit antennas and one receive antenna are required.

In the third time slot, S3S_3 and S4S_4 are transmitted from antenna 1 and antenna 2. In the fourth time slot, S4-S_4^* and S3S_3^* are transmitted from antenna 1 and antenna 2, respectively — and this pattern continues. [Read More ...]

 

Further Reading

  1.  Modified Alamouti's Scheme (STBC) in MATLAB (using QPSK)
  2. Alamouti's Scheme for MIMO Communication
  3. Theoretical Ber vs Snr for Alamouti Scheme 
  4. MATLAB Code for Multi-User STBC (using Alamouti's Scheme)
  5. Alamouti Scheme Simulator

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...

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

📘 ASK Theory 📘 FSK Theory 📘 PSK Theory 📊 Comparison 🧮 MATLAB Codes 🎮 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. 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 ) ...

Calculation of SNR from FFT bins in MATLAB

📘 Overview 💻 FFT Bin Method 💻 Kaiser Window 📚 Further Reading SNR Estimation Overview In digital signal processing, estimating the Signal-to-Noise Ratio (SNR) accurately is crucial. Below, we demonstrate how to calculate SNR from periodogram and FFT bins using the Kaiser Window . The beta (β) parameter is the key—it allows you to control the trade-off between main-lobe width and side-lobe levels for precise spectral analysis. 1 Define Sampling rate and Time vector 2 Compute FFT and Periodogram PSD 3 Identify Signal Bin and Frequency resolution 4 Segment Signal Power from Noise floor 5 Logarithmic calculation of SNR in dB Method 1: Estimation from FFT Bins This approach uses a Hamming window to estimate SNR directly from the spectral bins. MATLAB Source Code Copy Code clc...

MATLAB Code for ASK, FSK, and PSK (with Online Simulator)

MATLAB Code for ASK, FSK, and PSK Comprehensive implementation of digital modulation and demodulation techniques with simulation results. 📘 Theory 📡 ASK Code 📶 FSK Code 🎚️ PSK Code 🕹️ Simulator 📚 Further Reading Amplitude Shift Frequency Shift Phase Shift Live Simulator ASK, FSK & PSK HomePage MATLAB Code MATLAB Code for ASK Modulation and Demodulation COPY % The code is written by SalimWireless.Com clc; clear all; close all; % Parameters Tb = 1; fc = 10; N_bits = 10; Fs = 100 * fc; Ts = 1/Fs; samples_per_bit = Fs * Tb; rng(10); binar...

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 ...

LDPC Encoding and Decoding Techniques

📘 Overview & Theory 🧮 LDPC Encoding Techniques 🧮 LDPC Decoding Techniques 📚 Further Reading 'LDPC' is the abbreviation for 'low density parity check'. LDPC code H matrix contains very few amount of 1's and mostly zeroes. LDPC codes are error correcting code. Using LDPC codes, channel capacities that are close to the theoretical Shannon limit can be achieved.  Low density parity check (LDPC) codes are linear error-correcting block code suitable for error correction in a large block sizes transmitted via very noisy channel. Applications requiring highly reliable information transport over bandwidth restrictions in the presence of noise are increasingly using LDPC codes. 1. LDPC Encoding Technique The proper form of H matrix is derived from the given matrix by doing multiple row operations as shown above. In the above, H is parity check matrix and G is generator matrix. If you consider matrix H as [-P' | I] then matrix G will b...

Comparing Baseband and Passband Implementations of ASK, FSK, and PSK

📘 Overview 🧮 Baseband and Passband Implementations of ASK, FSK, and PSK 🧮 Difference betwen baseband and passband 📚 Further Reading 📂 Other Topics on Baseband and Passband ... 🧮 Baseband modulation techniques 🧮 Passband modulation techniques   Baseband modulation techniques are methods used to encode information signals onto a baseband signal (a signal with frequencies close to zero). Passband techniques shift these signals to higher carrier frequencies for transmission. Here are the common implementations: Amplitude Shift Keying (ASK) [↗] : In ASK, the amplitude of the signal is varied to represent different symbols. Binary ASK (BASK) is a common implementation where two different amplitudes represent binary values (0 and 1). ASK is simple but susceptible to noise. ASK Baseband (Digital Bits) ASK Passband (Modulated Carrier)     Fig 1:  ASK Passband Modulation (...