pitch tracking working on some basic level

This commit is contained in:
Trent
2017-06-26 23:31:34 -04:00
parent 4681319591
commit 35aee551c0
7 changed files with 45 additions and 28 deletions

View File

@@ -1,12 +1,13 @@
#include "Yin.h"
#include <stdlib.h>
#include <stdio.h>
//#include "WProgram.h"
void Yin::initialize(float yinSampleRate,int yinBufferSize){
bufferSize = yinBufferSize;
sampleRate = yinSampleRate;
halfBufferSize = bufferSize / 2;
threshold = 0.15;
threshold = 0.01;
probability = 0.0;
//initialize array and set it to zero
yinBuffer = (float *) malloc(sizeof(float)* halfBufferSize);
@@ -137,6 +138,7 @@ int Yin::absoluteThreshold(){
break;
}
}
// if no pitch found, tau => -1
if (tau == halfBufferSize || yinBuffer[tau] >= threshold) {
tau = -1;