public class AMDF extends java.lang.Object implements PitchDetector
A pitch extractor that extracts the Average Magnitude Difference (AMDF) from an audio buffer. This is a good measure of the Pitch (f0) of a signal.
AMDF is calculated by the the difference between the waveform summing a lagged version of itself.
The main bulk of the code is written by Eder de Souza for the jAudio framework. Adapted for TarsosDSP by Joren Six.
Constructor and Description |
---|
AMDF(float sampleRate,
int bufferSize) |
AMDF(float sampleRate,
int bufferSize,
double minFrequency,
double maxFrequency) |
Modifier and Type | Method and Description |
---|---|
PitchDetectionResult |
getPitch(float[] audioBuffer)
Analyzes a buffer with audio information and estimates a pitch in Hz.
|
public AMDF(float sampleRate, int bufferSize)
public AMDF(float sampleRate, int bufferSize, double minFrequency, double maxFrequency)
public PitchDetectionResult getPitch(float[] audioBuffer)
PitchDetector
getPitch
in interface PitchDetector
audioBuffer
- The buffer with audio information. The information in the
buffer is not modified so it can be (re)used for e.g. FFT
analysis.