// Provides nice unit conversions

pub mod frequency {
    use std::f32::consts::PI;

    pub fn hz_to_rad_per_sample(hz: f32, sample_rate: f32) -> f32 {
        2. * PI * hz / sample_rate
    }

    pub fn rad_per_sample_to_hz(rad: f32, sample_rate: f32) -> f32 {
        (rad * sample_rate) / (2. * PI)
    }
}
