- qamdemod: https://www.mathworks.com/help/comm/ref/qamdemod.html
- de2bi: https://www.mathworks.com/help/comm/ref/de2bi.html
Calculate Bit Error Rate and Block Error Rate using MATLAB
조회 수: 7 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
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 );
fprintf('Block Error Rate (BLER): %.2f\n', BLER );
Refer to the following documentations for more details about the functions:
Hope this helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 QAM에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!