Expand description
§melpe-rs
Pure Rust implementation of the MELPe (Mixed Excitation Linear Prediction — enhanced) vocoder, conforming to STANAG 4591 / NATO narrowband voice coding at 600 bps.
§Quick start
use melpe::encoder::Encoder;
use melpe::decoder::Decoder;
use melpe::core_types::{SUPERFRAME_SAMPLES, SUPERFRAME_BYTES_600};
let mut enc = Encoder::new();
let mut dec = Decoder::new();
let samples = [0.0f32; SUPERFRAME_SAMPLES];
let mut bitstream = [0u8; SUPERFRAME_BYTES_600];
enc.encode(&samples, &mut bitstream);
let mut output = [0.0f32; SUPERFRAME_SAMPLES];
dec.decode(&bitstream, &mut output);§Feature flags
std(default) — nativef32math, hardware-backed on x86_64embedded—#![no_std], routes math throughlibm
Modules§
- bitstream
- Bit-level packing and unpacking of 41-bit superframes into 6 bytes.
- core_
types - Constants, frame geometry, and superframe data structures.
- decoder
- Top-level decoder: 6 bytes → 540 samples.
- encoder
- Top-level encoder: 540 samples → 6 bytes.
- lpc
- LPC analysis: autocorrelation, Levinson-Durbin, LPC↔LSF conversion, windowing.
- math
- Floating-point math shim — dispatches to
stdorlibmbased on feature flags. - pitch
- Pitch detection via normalized autocorrelation with parabolic interpolation.
- quantize
- Scalar quantization of LSFs, pitch, gain, and voicing for 600 bps superframes.
- synthesis
- All-pole synthesis filter, de-emphasis, and frame-level synthesis processor.
- voicing
- 5-band bandpass voicing analysis and mixed excitation generation.