Trait PitchDetector

Source
pub trait PitchDetector<T>
where T: Float,
{ // Required method fn get_pitch( &mut self, signal: &[T], sample_rate: usize, power_threshold: T, clarity_threshold: T, ) -> Option<Pitch<T>>; }
Expand description

A uniform interface to all pitch-detection algorithms.

Required Methods§

Source

fn get_pitch( &mut self, signal: &[T], sample_rate: usize, power_threshold: T, clarity_threshold: T, ) -> Option<Pitch<T>>

Get an estimate of the Pitch of the sound sample stored in signal.

Arguments:

  • signal: The signal to be analyzed
  • sample_rate: The number of samples per second contained in the signal.
  • power_threshold: If the signal has a power below this threshold, no attempt is made to find its pitch and None is returned.
  • clarity_threshold: A number between 0 and 1 reflecting the confidence the algorithm has in its estimate of the frequency. Higher clarity_thresholds correspond to higher confidence.

Implementors§

Source§

impl<T> PitchDetector<T> for AutocorrelationDetector<T>
where T: Float + Sum,

Source§

impl<T> PitchDetector<T> for McLeodDetector<T>
where T: Float + Sum,

Source§

impl<T> PitchDetector<T> for YINDetector<T>
where T: Float + Sum,

Pitch detection based on the YIN algorithm. See http://recherche.ircam.fr/equipes/pcm/cheveign/ps/2002_JASA_YIN_proof.pdf