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