Mercurial > hg > precise-onset-detection
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3dcbd77efc94 |
---|---|
1 /* | |
2 * PeakProcessor.h | |
3 * peakOnsetDetector | |
4 * | |
5 * Created by Andrew on 07/09/2012. | |
6 * Copyright 2012 QMUL. All rights reserved. | |
7 * | |
8 */ | |
9 | |
10 #ifndef PEAK_PROCESSOR | |
11 #define PEAK_PROCESSOR | |
12 | |
13 #include <vector.h> | |
14 | |
15 class PeakProcessor{ | |
16 public: | |
17 | |
18 PeakProcessor(); | |
19 ~PeakProcessor(); | |
20 //peak processing requires | |
21 static const int vectorSize = 512/6; | |
22 vector<double> recentDFsamples; | |
23 vector<bool> recentDFonsetFound; | |
24 vector<double> recentDFslopeValues; | |
25 | |
26 int numberOfDetectionValuesToTest; | |
27 bool peakProcessing(const double& newDFval); | |
28 double getBestSlopeValue(const float& dfvalue); | |
29 bool checkForSlopeOnset(const float& bestValue); | |
30 int currentFrame, lastSlopeOnsetFrame, cutoffForRepeatOnsetsFrames; | |
31 void updateDetectionTriggerThreshold(const float& val); | |
32 float detectionTriggerThreshold, detectionTriggerRatio; | |
33 float bestSlopeMedian, thresholdRelativeToMedian; | |
34 bool newOnsetFound, slopeFallenBelowMedian; | |
35 | |
36 | |
37 | |
38 }; | |
39 #endif |