Skip to main content

manchester_decode_simd

Function manchester_decode_simd 

Source
pub fn manchester_decode_simd(samples: &[i16], threshold: i16) -> Vec<u8> 
Expand description

Decode Manchester-coded audio samples back to a bit stream.

Each pair of consecutive samples is examined:

  • (HIGH, LOW) → bit 0
  • (LOW, HIGH) → bit 1
  • Ambiguous / noisy pair → bit value is determined by the majority level (the sample further from zero wins).

threshold is the absolute amplitude level that distinguishes a meaningful HIGH/LOW from noise near zero. Typical value: 8192 for 25% of full-scale i16.

Returns one u8 per decoded bit (value 0 or 1). If samples.len() is odd the trailing unpaired sample is ignored.