Files
pete/Source/Yin.h
2017-06-26 22:30:05 -04:00

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;
};