view src/PeakProcessor.h @ 8:184a7c232049 tip

changed files since updating computer
author Venetian
date Thu, 14 Aug 2014 17:53:57 +0100
parents 7ec1ed0b2eb0
children
line wrap: on
line source
/*
 *  PeakProcessor.h
 *  peakOnsetDetector
 *
 *  Created by Andrew Robertson on 07/09/2012.
 *  Copyright 2012 QMUL. All rights reserved.
 *
 */

#ifndef PEAK_PROCESSOR
#define PEAK_PROCESSOR

#include <vector.h>
#include "math.h"

class PeakProcessor{
	public:
	
	PeakProcessor();
	~PeakProcessor();
	
	void initialise();
	void reset();
	
	//peak processing requires
	static const int vectorSize = 512/6; 
	vector<double> recentDFsamples; 
	vector<bool> recentDFonsetFound;
	vector<double> recentDFslopeValues;
	
	int numberOfDetectionValuesToTest;
	bool peakProcessing(const double& newDFval);
	double getBestSlopeValue(const float& dfvalue);
	bool checkForSlopeOnset(const float& bestValue);
	int currentFrame, lastSlopeOnsetFrame, cutoffForRepeatOnsetsFrames;
	void updateDetectionTriggerThreshold(const float& val);
	float detectionTriggerThreshold, detectionTriggerRatio;
	float bestSlopeMedian, thresholdRelativeToMedian;
	bool newOnsetFound, slopeFallenBelowMedian;
	
	float minimumThreshold;
	
};
#endif