Skip to main content

Rate

Enum Rate 

Source
#[non_exhaustive]
pub enum Rate { Imbe7200x4400, Imbe4400x4400, AmbePlus2_3600x2450, AmbePlus2_2450x2450, }
Expand description

Vocoder rate selection — picks both the codec generation and the wire-FEC framing.

More variants will land as additional carriers are added. The values themselves are also stable Wire-format choices: a Rate is enough to know how many FEC bytes a frame is, what codec generation drives the synth, and which dequantize tables to use.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Imbe7200x4400

P25 Phase 1 FDMA full-rate IMBE. 18-byte FEC frame (72 dibits). 7 200 bps total / 4 400 bps voice + 2 800 bps FEC.

§

Imbe4400x4400

IMBE info-only — same codec as Self::Imbe7200x4400 with the Annex H Golay/Hamming/PN FEC layer stripped. 11-byte wire frame (88 prioritized info bits packed MSB-first). 4 400 bps total (= voice). Byte layout matches JMBE / OP25 / DVSI p25_nofec convention bit-for-bit (validated against DVSI tv-rc references at 100% bit-exact). Use this for storage when you specifically need an info-only IMBE archive; otherwise prefer the FEC-bearing Self::Imbe7200x4400 format — see docs/wire_formats_and_storage.md.

§

AmbePlus2_3600x2450

P25 Phase 2 TDMA half-rate AMBE+2. 9-byte FEC frame (36 dibits). 3 600 bps total / 2 450 bps voice + 1 150 bps FEC. Also the vocoder-layer format for DMR Tier II/III voice frames (modulo carrier-specific burst framing).

§

AmbePlus2_2450x2450

AMBE+2 half-rate info-only — same 49 info bits as Self::AmbePlus2_3600x2450 with the Golay/Hamming/PN FEC layer stripped. 7-byte wire frame (49 info bits packed MSB-first in u₀..u₃ order, 7 trailing pad bits). 2 450 bps total (= voice).

Byte layout caveat. DVSI’s chip rate-index 34 emits the same 49 info bits in a different (chip-internal, permuted) byte order. This crate’s layout is self-consistent (ours-to- ours round-trip is lossless) but is not byte-equal to DVSI’s r34 stream. If you need byte-exact DVSI r34 interop, see the future blip25-chip-shim crate; here this variant is for compact ours-to-ours archival. Recommended storage format is the FEC-bearing Self::AmbePlus2_3600x2450 — see docs/wire_formats_and_storage.md.

Implementations§

Source§

impl Rate

Source

pub const fn fec_frame_bytes(self) -> usize

Number of bytes in one wire frame at this rate. Includes FEC for the FEC-bearing variants (Self::Imbe7200x4400, Self::AmbePlus2_3600x2450) and is just the packed info bits for the no-FEC variants (Self::Imbe4400x4400, Self::AmbePlus2_2450x2450).

Source

pub const fn frame_samples(self) -> usize

PCM samples per frame (always 160 at 8 kHz / 20 ms; provided for symmetry with Self::fec_frame_bytes).

Trait Implementations§

Source§

impl Clone for Rate

Source§

fn clone(&self) -> Rate

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Rate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for Rate

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Rate

Source§

fn eq(&self, other: &Rate) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Rate

Source§

impl Eq for Rate

Source§

impl StructuralPartialEq for Rate

Auto Trait Implementations§

§

impl Freeze for Rate

§

impl RefUnwindSafe for Rate

§

impl Send for Rate

§

impl Sync for Rate

§

impl Unpin for Rate

§

impl UnsafeUnpin for Rate

§

impl UnwindSafe for Rate

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.