pub enum FrequencyLimit {
    All,
    Min(f32),
    Max(f32),
    Range(f32f32),
}
Expand description

Can be used to specify a desired frequency limit. If you know that you only need frequencies f <= 1000Hz, 1000 <= f <= 6777, or 10000 <= f, then this can help you to accelerate overall computation speed and memory usage.

Please note that due to frequency inaccuracies the FFT result may not contain a value for 1000Hz but for 998.76Hz!

Variants

All

Interested in all frequencies. [0, sampling_rate/2] (Nyquist theorem). Semantically equivalent to “None” limit at all).

Min(f32)

Only interested in frequencies Frequency <= x. Limit is inclusive. Supported values are 0 <= x <= Nyquist-Frequency.

Max(f32)

Only interested in frequencies x <= Frequency. Limit is inclusive. Supported values are 0 <= x <= N.

Range(f32f32)

Only interested in frequencies 1000 <= f <= 6777 for example. Both values are inclusive. The first value of the tuple is equivalent to FrequencyLimit::Min and the latter equivalent to FrequencyLimit::Max. Furthermore, the first value must not be bigger than the second value.

Implementations

Returns the minimum value, if any.

Returns the maximum value, if any.

Returns the minimum value, panics if it’s none. Unwrapped version of Self::maybe_min.

Returns the minimum value, panics if it’s none. Unwrapped version of Self::maybe_max.

Verifies that the frequency limit has sane values and takes the maximum possible frequency into account.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.