annotate src/PeakProcessor.h @ 2:7ec1ed0b2eb0

Added offline precise onset detection, outputting precise locations in seconds to text file
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Mon, 30 Dec 2013 14:08:42 +0000
parents 5a94f002e5ef
children 184a7c232049
rev   line source
andrew@0 1 /*
andrew@0 2 * PeakProcessor.h
andrew@0 3 * peakOnsetDetector
andrew@0 4 *
andrew@2 5 * Created by Andrew Robertson 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@1 14 #include "math.h"
andrew@0 15
andrew@0 16 class PeakProcessor{
andrew@0 17 public:
andrew@0 18
andrew@0 19 PeakProcessor();
andrew@0 20 ~PeakProcessor();
andrew@0 21 //peak processing requires
andrew@0 22 static const int vectorSize = 512/6;
andrew@0 23 vector<double> recentDFsamples;
andrew@0 24 vector<bool> recentDFonsetFound;
andrew@0 25 vector<double> recentDFslopeValues;
andrew@0 26
andrew@0 27 int numberOfDetectionValuesToTest;
andrew@0 28 bool peakProcessing(const double& newDFval);
andrew@0 29 double getBestSlopeValue(const float& dfvalue);
andrew@0 30 bool checkForSlopeOnset(const float& bestValue);
andrew@0 31 int currentFrame, lastSlopeOnsetFrame, cutoffForRepeatOnsetsFrames;
andrew@0 32 void updateDetectionTriggerThreshold(const float& val);
andrew@0 33 float detectionTriggerThreshold, detectionTriggerRatio;
andrew@0 34 float bestSlopeMedian, thresholdRelativeToMedian;
andrew@0 35 bool newOnsetFound, slopeFallenBelowMedian;
andrew@0 36
andrew@0 37
andrew@0 38
andrew@0 39 };
andrew@0 40 #endif