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§
Sourcefn get_pitch(
&mut self,
signal: &[T],
sample_rate: usize,
power_threshold: T,
clarity_threshold: T,
) -> Option<Pitch<T>>
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 analyzedsample_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 andNone
is returned.clarity_threshold
: A number between 0 and 1 reflecting the confidence the algorithm has in its estimate of the frequency. Higherclarity_threshold
s correspond to higher confidence.
Implementors§
impl<T> PitchDetector<T> for AutocorrelationDetector<T>
impl<T> PitchDetector<T> for McLeodDetector<T>
impl<T> PitchDetector<T> for YINDetector<T>
Pitch detection based on the YIN algorithm. See http://recherche.ircam.fr/equipes/pcm/cheveign/ps/2002_JASA_YIN_proof.pdf