adamgreig / labrador-ldpc

LDPC encoding and decoding for Labrador
MIT License
35 stars 4 forks source link

decode_ms with some bits I know are correct #9

Closed scd31 closed 9 months ago

scd31 commented 9 months ago

Hello,

I'm using this library with packets that are sometimes smaller than my LDPC code requires. To work around this, I'm padding the data with 0xAA, then I'm transmitting the data (without padding) and parity. On the decode side, I pad the data again and run through the usual decode flow.

I'm now wanting to implement soft decoding. I know the 0xAA bits can't flip, since they're hardcoded and not sent over the channel. Should I just set these bits to DecodeFrom::maxval()? I think that would be the most elegant, except for this in the documentation:

Internally, variables of type T are used to accumulate messages, so it is useful to leave some headroom in T after the range of your LLRs. For T=i8 you might assign -32 to 31 for LLR inputs, so that several full-scale messages can be accumulated before saturation occurs. On floating point types this is less of a concern.

I'm unsure if this affects me here since I know these padding bits will never need to be corrected.

Thanks!

adamgreig commented 9 months ago

Interesting question. I'm afraid I don't remember the specifics, but I think you should be fine using maxval() for the bits that definitely won't need correcting. Still, give it a few test runs to check you're getting the performance you expect.

scd31 commented 9 months ago

Thanks!