Calculate Bit Error Rate and Block Error Rate using MATLAB

조회 수: 7 (최근 30일)
Sukshith Shetty
Sukshith Shetty 2021년 5월 31일
답변: Shashi Kiran 2024년 9월 17일
I require a way to calculate Block Error and Bit Error Rate of QAM Signals. How should I take the approach.
eg: I have a TxData = [0.707+0.707*j,0.707-0.707*j, -0.707-0.707*j, -0.707+0.707*j] and RxData = [0.707-0.707*j,0.707-0.707*j, +0.707-0.707*j, -0.707-0.707*j]
I require Matlab code to calculate the Block and Bit error rate of these Tx and Rx Data.

답변 (1개)

Shashi Kiran
Shashi Kiran 2024년 9월 17일
Hi Sukshith,
I see you are interested in calculating the Bit Error Rate (BER) and Block Error Rate (BLER) using MATLAB for your given transmit and receive data.
Here is how you can achieve that:
% Parameters
M = 4;
k = log2(M);
% TxData and RxData
TxData = [0.707+0.707j, 0.707-0.707j, -0.707-0.707j, -0.707+0.707j];
RxData = [0.707-0.707j, 0.707-0.707j, 0.707-0.707j, -0.707-0.707j];
% Demodulate transmitted symbols to bits
TxSymbols = qamdemod(TxData, M);
TxBits = de2bi(TxSymbols, k, 'left-msb');
TxBits = TxBits(:); % Reshape to a column vector
% Demodulate received symbols to bits
RxSymbols = qamdemod(RxData, M);
RxBits = de2bi(RxSymbols, k, 'left-msb');
RxBits = RxBits(:); % Reshape to a column vector
% Calculate Bit Error Rate (BER)
numBitErrors = sum(TxBits ~= RxBits);
totalBits = numel(TxBits);
BER = numBitErrors / totalBits;
% Calculate Block Error Rate (BLER)
numBlockErrors = sum(TxSymbols ~= RxSymbols);
totalBlocks = numel(TxSymbols);
BLER = numBlockErrors / totalBlocks;
% Display results
fprintf('Bit Error Rate (BER): %.2f\n', BER );
Bit Error Rate (BER): 0.38
fprintf('Block Error Rate (BLER): %.2f\n', BLER );
Block Error Rate (BLER): 0.75
Refer to the following documentations for more details about the functions:
  1. qamdemod: https://www.mathworks.com/help/comm/ref/qamdemod.html
  2. de2bi: https://www.mathworks.com/help/comm/ref/de2bi.html
Hope this helps.

카테고리

Help CenterFile Exchange에서 QAM에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by