27 lines
502 B
C++
27 lines
502 B
C++
#pragma once
|
|
|
|
//#include "WProgram.h"
|
|
|
|
class Yin{
|
|
|
|
public:
|
|
Yin();
|
|
Yin(float sampleRate,int bufferSize);
|
|
void initialize(float sampleRate,int bufferSize);
|
|
float getPitch(float* buffer);
|
|
float getProbability();
|
|
|
|
private:
|
|
float parabolicInterpolation(int tauEstimate);
|
|
int absoluteThreshold();
|
|
void cumulativeMeanNormalizedDifference();
|
|
void difference(float* buffer);
|
|
|
|
double threshold;
|
|
int bufferSize;
|
|
int halfBufferSize;
|
|
float sampleRate;
|
|
float* yinBuffer;
|
|
float probability;
|
|
};
|