Struct irapt::Parameters[][src]

pub struct Parameters {
    pub sample_rate: f64,
    pub harmonics_estimation_interval: f64,
    pub harmonics_estimation_window_duration: f64,
    pub candidate_selection_window_duration: f64,
    pub pitch_range: RangeInclusive<f64>,
    pub candidate_generator_fft_len: usize,
    pub half_interpolation_window_len: u32,
    pub interpolation_factor: u8,
    pub candidate_taper: f64,
    pub candidate_step_decay: f64,
    pub candidate_max_jump: usize,
}
Expand description

Various tunable parameters for Irapt.

The Default implementation provides suggested defaults for all parameters, given that the input is resampled near to the suggested default sample rate.

Fields

sample_rate: f64

The constant sample rate, in Hz, the input was sampled with.

The suggested default is 6000.0.

harmonics_estimation_interval: f64

Interval, in seconds, at which harmonics of the input are estimated.

The suggested default is 0.005.

harmonics_estimation_window_duration: f64

Duration, in seconds, of the sliding window upon which harmonics of the input are estimated.

The suggested default is 0.05.

candidate_selection_window_duration: f64

Duration, in seconds, of the sliding window upon which pitches are estimated.

A shorter candidate selection window will be more responsive to fluctuations in input, but less accurate. The suggested default is 0.3.

pitch_range: RangeInclusive<f64>

Frequency range, in Hz, within which to detect pitch.

Wider frequency ranges require a larger candidate_generator_fft_len or sample_rate to maintain adequate frequency resolution of pitch detection. The suggested default for any human speech is 50.0..=450.0.

candidate_generator_fft_len: usize

Size of the FFT used for candidate generation.

The candidate generation FFT size affects the frequency resolution of pitch detection. Larger FFT sizes result in a higher resolution. The suggested default is 16384.

Certain FFT sizes, e.g. powers of two, are more computationally efficient than others. See the rustfft crate for the supported optimizations based on FFT size.

half_interpolation_window_len: u32

Half-length of the window of the interpolator used on generated pitch candidates.

A window too short for the given candidate_generator_fft_len will suffer from artifacts resulting from poor interpolation. The suggested default is 12.

The window half-length must be less than or equal to both:

interpolation_factor: u8

Number of pitch candidates to interpolate in between each generated pitch candidate.

The suggested default in 2.

candidate_taper: f64

Taper factor applied to candidates within a time step.

Candidates within a single time step will be weighted from 1.0 - candidate_taper..=1.0 linearly proportional to their frequencies. The suggested default is 0.25.

candidate_step_decay: f64

Decay factor applied to candidates at each time step within the given candidate_selection_window_duration.

The suggested default is 0.95.

candidate_max_jump: usize

Assumed maximum distance a valid pitch will change within the harmonics_estimation_interval.

The unit of distance is in candidates, which is an arbitrary logarithmic frequency scale.

Implementations

Suggested default parameters.

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

Returns the “default value” for a type. 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

Performs the conversion.

Performs the conversion.

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)

recently added

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.