feat(LDPC Rate Matching): Fix Bit Selection starting position
Description
Fixes issue #6 (closed)
In the rate matching function, the starting position of bit selection k0 is calculated in the way instructed by 3GPP TS 38.212 and then used to copy the selected part of the encoder output.
But, this k0 is the starting position of bit selection in the encoder output including the filler bits. While bits are selected from a buffer in_bits where filler bits were previously removed.
The result is that if k0 falls within or after the filler bits then bits selection starts at the wrong position which introduces an offset in the bit selection output with regard to the expected output.
This commit fixes this behavior in the library at src/UpperPHY/LDPC/arm_ldpc_rate_matching.cpp but also in the reference implementation at test/UpperPHY/LDPC/RateMatching/main.cpp.
The fix is to test where k0 falls relatively to the filler bits and reduce it accordingly before proceeding with bit selection.
Checklist
-
Contribution meets RAL's licence terms -
New functions adhere to RAL's naming scheme -
Contribution conforms to RAL's directory structure - [] Documentation updated -> not relevant
-
"Unreleased" section of the Changelog updated -
clang-formatandclang-tidyrun and changes included (C/C++ code) - []
flake8run and changes included (Python code) -> no python code, only c -
cmake-formatrun and changes included (CMake code) -> no CMake code, only c -
Tests added or updated -
Tests pass when run with AddressSanitizer - [] Benchmarks added or updated -> not relevant