Skip to main content

demodulate

Function demodulate 

Source
pub fn demodulate(
    symbols: &[f32],
    n_bits: usize,
    noise_var: f32,
    scale: f32,
    llr: &mut [i16],
)
Expand description

Demodulate BPSK symbols to soft-decision i16 LLRs.

noise_var is σ² (noise variance = N₀/2). The scale factor converts floating-point LLRs to the i16 range used by the LDPC decoder. A value of 100–500 works well.

The exact LLR is 2 · y / σ², quantized as clamp(round(scale · 2 · y / σ²), −32767, 32767).