Module biquad::frequency

source ·
Expand description

frequency

A helper module for creating type-safe frequencies, while also allowing to create frequencies from float and integer literals.

Examples

fn main() {
    use biquad::frequency::*;

    // Integer literals
    let one_hz = 1.hz();
    let one_khz = 1.khz();
    let one_mhz = 1.mhz();

    // Float literals
    let one_hz = 1.0.dt();
    let ten_hz = 0.1.dt();
}

Errors

Hertz::from_hz(...) will error if the frequency is negative.

Panics

x.hz(), x.khz(), x.mhz(), x.dt() will panic for f32 if they are negative.

Structs

Base type for frequency, everything is based on Hertz

Traits

Used to implement conversions to the Hertz struct