Expand description
§blip25-mbe
A clean-room implementation of the MBE vocoder family.
§Quick start
Most consumers should use the chip-shaped vocoder::Vocoder
façade:
use blip25_mbe::vocoder::{Rate, Vocoder};
// Open a P25 Phase 1 (full-rate IMBE) channel.
let mut tx = Vocoder::new(Rate::Imbe7200x4400);
let pcm: [i16; 160] = [0; 160];
let bits = tx.encode_pcm(&pcm).unwrap();
assert_eq!(bits.len(), 18);
let mut rx = Vocoder::new(Rate::Imbe7200x4400);
let out = rx.decode_bits(&bits).unwrap();
assert_eq!(out.len(), 160);Three streaming variants on top of the per-frame primitive:
vocoder::Vocoder::encode_stream/vocoder::Vocoder::decode_stream— slice →Iterator<Item = Result<…>>, drops trailing partial frames.vocoder::LiveEncoder/vocoder::LiveDecoder— chunk-driven with internal residue buffer for audio-callback / socket use.vocoder::VocoderBuilder— fluent configuration of optional knobs (tone detection, beyond-spec repeat reset).
See vocoder for the full API and INTEGRATION.md for the
AMBE-3000R protocol → Vocoder operation correspondence.
§Module organization
See DESIGN.md at the repository root for
the architectural model. The public API is organized around four
orthogonal axes joined at a common parameter type:
vocoder— chip-shaped façade. Recommended entry point.mbe_params— the parameter model. The interchange type and the center of gravity of the crate.codecs— analysis and synthesis algorithms, one submodule per codec generation (mbe_baseline,ambe,ambe_plus,ambe_plus2).- Wire formats, one module per protocol-rate combination:
imbe_wire(P25 Phase 1 IMBE, 144-bit),ambe_plus2_wire(P25 Phase 2 AMBE+2, 72-bit), anddvsi_3000(DVSI chip protocol, r0..r63). Future protocols (DMR, D-STAR, NXDN, …) become sibling modules. rate_conversion— parameter-domain bits-to-bits conversion, a peer of the codec and wire layers, not a sub-concern of either.
Primitives shared across layers live in fec and bits.
§Cargo features
serde(off by default) — deriveSerialize/Deserializeon the diagnostic types invocoder(Rate,FrameStats,AnalysisStats,AnalysisOutputKind,DecodeStats) plusmbe_params::MbeParamsandcodecs::mbe_baseline::FrameDisposition. Useful for shipping stats / params over a future RPC layer (gRPC / protobuf / WS) without hand-rolled converters.
Modules§
- ambe_
plus2_ wire - P25 Phase 2 TDMA half-rate vocoder wire format.
- bits
- Bit-packing and bit-slicing primitives shared across wire formats.
- codecs
- Codec generations: analysis (PCM → MbeParams) and synthesis (MbeParams → PCM).
- dvsi_
3000 - DVSI AMBE-3000 chip protocol — 64 rate configurations (
r0..r63). - enhancement
- Post-decoder PCM enhancement — optional classical DSP filter chain
applied to decoded PCM before it leaves the
crate::vocoder::Vocoder. - fec
- Forward-error-correction primitives shared across wire formats.
- imbe_
wire - P25 Phase 1 FDMA full-rate vocoder wire format.
- mbe_
params - The MBE parameter model — the crate’s interchange type.
- rate_
conversion - Parametric rate conversion — the bits-to-bits operation in parameter space.
- vocoder
- Unified
Vocoderhandle — chip-shaped façade over the rate-specific pipelines.