annotate 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
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();
Venetian@8 21
Venetian@8 22 void initialise();
Venetian@8 23 void reset();
Venetian@8 24
andrew@0 25 //peak processing requires
andrew@0 26 static const int vectorSize = 512/6;
andrew@0 27 vector<double> recentDFsamples;
andrew@0 28 vector<bool> recentDFonsetFound;
andrew@0 29 vector<double> recentDFslopeValues;
andrew@0 30
andrew@0 31 int numberOfDetectionValuesToTest;
andrew@0 32 bool peakProcessing(const double& newDFval);
andrew@0 33 double getBestSlopeValue(const float& dfvalue);
andrew@0 34 bool checkForSlopeOnset(const float& bestValue);
andrew@0 35 int currentFrame, lastSlopeOnsetFrame, cutoffForRepeatOnsetsFrames;
andrew@0 36 void updateDetectionTriggerThreshold(const float& val);
andrew@0 37 float detectionTriggerThreshold, detectionTriggerRatio;
andrew@0 38 float bestSlopeMedian, thresholdRelativeToMedian;
andrew@0 39 bool newOnsetFound, slopeFallenBelowMedian;
andrew@0 40
Venetian@8 41 float minimumThreshold;
andrew@0 42
andrew@0 43 };
andrew@0 44 #endif