Skip to main content

Band

Enum Band 

Source
pub enum Band {
    Rectangular {
        start: f64,
        end: f64,
    },
    RaisedCosine {
        start: f64,
        end: f64,
        transition: f64,
    },
    Kaiser {
        start: f64,
        end: f64,
        beta: f64,
    },
    Gaussian {
        start: f64,
        end: f64,
        sigma: f64,
    },
}
Expand description

A frequency-domain window: which bins survive a reconstruction, and how sharply the surviving band ends.

Every shape is zero outside start..=end. They differ in what happens inside it, which is the difference between a brick-wall filter and one whose edges do not ring.

Variants§

§

Rectangular

A brick wall: full pass inside the band, nothing outside it.

Fields

§start: f64

The lowest frequency the band keeps, in Hz.

§end: f64

The highest frequency the band keeps, in Hz.

§

RaisedCosine

Raised-cosine edges of a stated width, flat in between.

Fields

§start: f64

The lowest frequency the band keeps, in Hz.

§end: f64

The highest frequency the band keeps, in Hz.

§transition: f64

The width of each cosine edge, in Hz.

§

Kaiser

A Kaiser shape, whose beta trades edge width against sidelobe height.

Fields

§start: f64

The lowest frequency the band keeps, in Hz.

§end: f64

The highest frequency the band keeps, in Hz.

§beta: f64

The shape parameter: larger is smoother and wider-edged.

§

Gaussian

A Gaussian shape of a stated standard deviation, centred in the band.

Fields

§start: f64

The lowest frequency the band keeps, in Hz.

§end: f64

The highest frequency the band keeps, in Hz.

§sigma: f64

The standard deviation, in Hz.

Implementations§

Source§

impl Band

Source

pub fn coefficient(&self, frequency: f64) -> f64

What fraction of one bin at frequency this band lets through, 0.0..=1.0.

Source

pub fn bounds(&self) -> (f64, f64)

The band’s frequency bounds, in Hz.

Trait Implementations§

Source§

impl Clone for Band

Source§

fn clone(&self) -> Band

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 Copy for Band

Source§

impl Debug for Band

Source§

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

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

impl PartialEq for Band

Source§

fn eq(&self, other: &Band) -> 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 StructuralPartialEq for Band

Auto Trait Implementations§

§

impl Freeze for Band

§

impl RefUnwindSafe for Band

§

impl Send for Band

§

impl Sync for Band

§

impl Unpin for Band

§

impl UnsafeUnpin for Band

§

impl UnwindSafe for Band

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.