Mercurial > hg > precise-onset-detection
diff src/PeakProcessor.h @ 0:3dcbd77efc94
added files for OF project
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Fri, 21 Sep 2012 16:35:17 +0100 |
parents | |
children | 5a94f002e5ef |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/PeakProcessor.h Fri Sep 21 16:35:17 2012 +0100 @@ -0,0 +1,39 @@ +/* + * PeakProcessor.h + * peakOnsetDetector + * + * Created by Andrew on 07/09/2012. + * Copyright 2012 QMUL. All rights reserved. + * + */ + +#ifndef PEAK_PROCESSOR +#define PEAK_PROCESSOR + +#include <vector.h> + +class PeakProcessor{ + public: + + PeakProcessor(); + ~PeakProcessor(); + //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; + + + +}; +#endif \ No newline at end of file