필터 지우기
필터 지우기

BCH Encoder - Error Locations

조회 수: 1 (최근 30일)
Rishi Balasubramanian
Rishi Balasubramanian 2022년 4월 6일
답변: Pooja Kumari 2024년 1월 13일
Hello All,
I am using the 'Communications Toolbox' and there is this 'comm.BCHDecoder' that I intend to use.
A deeper study about that function by Matlab reveals that it is apparently perfect for use.
So it uses this 'Berklamp Massey' algorithm to decode and find the error locations in the transmitted binary vector.
I was wondering on how to extract those error locations (indices).
The available functions kinda works out everything internally and giver out the error free binary vector, which is great, but I also want the locations of the errors.
Please let me know. Thanks
  댓글 수: 2
Rishi Balasubramanian
Rishi Balasubramanian 2022년 4월 6일
Another sub question. The result of the decoder returns the binary vector sans the parity bits. I want the enitre corrected code with parity bits too, atleast.
Walter Roberson
Walter Roberson 2022년 4월 7일
Unfortunately that is a .p file so we cannot see the code.
The features you request do not appear to be available.

댓글을 달려면 로그인하십시오.

답변 (1개)

Pooja Kumari
Pooja Kumari 2024년 1월 13일
Hello rishi,
As per my understanding, you wanted to know error locations in the transmitter binary vector but comms.BCHDecoder does not have this option. BCH decoder is a .p file and you cannot edit the code or see the code. If you wanted to extract exact location in the transmitted Binary vector, you can write custom code for BCHDecoder in which you can edit the code. You can refer to below code for possible inverse workaround in which you already know the error location and you can check error locations by comparing the original encoded message and the received message.
An example code for the same given below:
% Define BCH code parameters
n = 15; % Codeword length
k = 5; % Message length
% Create BCH encoder and decoder objects
bchEncoder = comm.BCHEncoder('CodewordLength', n, 'MessageLength', k);
bchDecoder = comm.BCHDecoder('CodewordLength', n, 'MessageLength', k);
msg = randi([0 1], k, 1); % Generate a random message
encodedMsg = step(bchEncoder, msg); %Encoded message
receivedMsg = encodedMsg;
errorPositions = [3, 7]; % Example error positions
receivedMsg(errorPositions) = ~receivedMsg(errorPositions); % Flip bits to introduce errors
[decodedMsg, errorStats] = step(bchDecoder, receivedMsg); % Decoded message
% Find error locations by comparing the original encoded message and the received message
errorLocations = find(encodedMsg ~= receivedMsg);
BCH decoder typically outputs the corrected message bits, excluding the parity bits. This is because the main purpose of the decoder is to retrieve the original message, and the parity bits are used during the error correction process.
Hope this helps!

카테고리

Help CenterFile Exchange에서 Error Detection and Correction에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by