How to discern if the codeword being sent in the C code is correctable?

2 views (last 30 days)
I have written a function in MATLAB that creates a comm.RSDecoder object. I generate C code for this function and want to find out if the codeword being sent in the C code is correctable. Also, which variable should I look at to get this information?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 31 Mar 2024 at 0:00
Edited: MathWorks Support Team on 31 Mar 2024 at 20:59
The step() method of "comm.RSDecoder" has an optional second output (please refer to the first link below), which returns the number of corrected errors. If there is a decoding failure, "-1" will be returned in this ERR output argument. A "-1" value of this output indicates that the codeword is not correctable. This is explained in the details of the "NumCorrectedErrorsOutputPort" property in both the links below:
You need to change your step() call and specify this second output. For example:
>> [msg, numErr] = step(dec,codeword);
Then generate the C code and track down the C variable that corresponds to the "numErr" MATLAB variable.

More Answers (0)

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!