52 BTrack (
int hopSize,
int frameSize);
119 void initialise (
int hopSize);
124 void setHopSize (
int hopSize);
127 void resampleOnsetDetectionFunction();
132 void updateCumulativeScore (
double onsetDetectionFunctionSample);
138 void calculateTempo();
144 void adaptiveThreshold (std::vector<double>& x);
152 double calculateMeanOfVector (std::vector<double>& vector,
int startIndex,
int endIndex);
157 void normaliseVector (std::vector<double>& vector);
162 void calculateBalancedACF (std::vector<double>& onsetDetectionFunction);
165 void calculateOutputOfCombFilterBank();
168 void createLogGaussianTransitionWeighting (
double* weightingArray,
int numSamples,
double beatPeriod);
171 template <
typename T>
172 double calculateNewCumulativeScoreValue (T cumulativeScoreArray,
double* logGaussianTransitionWeighting,
int startIndex,
int endIndex,
double onsetDetectionFunctionSample,
double alphaWeightingFactor);
185 std::vector<double> resampledOnsetDF;
186 std::vector<double> acf;
187 std::vector<double> weightingVector;
188 std::vector<double> combFilterBankOutput;
189 std::vector<double> tempoObservationVector;
190 std::vector<double> delta;
191 std::vector<double> prevDelta;
192 std::vector<double> prevDeltaFixed;
193 double tempoTransitionMatrix[41][41];
201 double estimatedTempo;
202 int timeToNextPrediction;
205 int onsetDFBufferSize;
208 int FFTLengthForACFCalculation;
211 fftw_plan acfForwardFFT;
212 fftw_plan acfBackwardFFT;
213 fftw_complex* complexIn;
214 fftw_complex* complexOut;
218 kiss_fft_cfg cfgForwards;
219 kiss_fft_cfg cfgBackwards;
221 kiss_fft_cpx* fftOut;
A class for calculating onset detection functions.
double getCurrentTempoEstimate()
Definition BTrack.cpp:192
void doNotFixTempo()
Definition BTrack.cpp:340
BTrack()
Definition BTrack.cpp:30
~BTrack()
Definition BTrack.cpp:51
void fixTempo(double tempo)
Definition BTrack.cpp:314
void processOnsetDetectionFunctionSample(double sample)
Definition BTrack.cpp:220
double getLatestCumulativeScoreValue()
Definition BTrack.cpp:204
void setTempo(double tempo)
Definition BTrack.cpp:256
static double getBeatTimeInSeconds(long frameNumber, int hopSize, int fs)
Definition BTrack.cpp:70
void processAudioFrame(double *frame)
Definition BTrack.cpp:210
int getHopSize()
Definition BTrack.cpp:198
bool beatDueInCurrentFrame()
Definition BTrack.cpp:186
void updateHopAndFrameSize(int hopSize, int frameSize)
Definition BTrack.cpp:176
Definition CircularBuffer.h:34
Definition OnsetDetectionFunction.h:65