veeresht / CommPy

Digital Communication with Python
http://veeresht.github.com/CommPy
BSD 3-Clause "New" or "Revised" License
538 stars 176 forks source link

Trellis termination for (Recursive Systematic Convolutional) codes #125

Open xerpi opened 4 months ago

xerpi commented 4 months ago

At https://github.com/veeresht/CommPy/blob/master/commpy/channelcoding/convcode.py#L546, I see that the bits from the RSC FFs are taken individually and utilized as if they were the message input bits to determine the next branch. However, I believe this might not be the correct approach, as it appears to overlook the consideration of the feedback polynomial: when performing the trellis termination, the "switch" ((a), (b) on the picture) that goes into the flip-flops (FFs) of the RSC memory is turned to (b) to force zeros in, achieved by XORing the feedback bit by itself. image

If I'm not mistaken the calculation of the "input" bit to select the next branch should be something like: parity(current_state & feedback_polynomial).