Skip to main content

hard_to_llr

Function hard_to_llr 

Source
pub fn hard_to_llr(
    bits: &[u8],
    num_bits: usize,
    magnitude: i16,
    llrs: &mut [i16],
)
Expand description

Converts hard bits (packed bytes, MSB-first) to LLR values.

Each bit becomes an i16: bit 0 → +magnitude, bit 1 → −magnitude. This is useful for testing the Viterbi decoder with hard-decision input.