annotate dsp/tempotracking/TempoTrack.h @ 209:ccd2019190bf msvc

Some MSVC fixes, including (temporarily, probably) renaming the FFT source file to avoid getting it mixed up with the Vamp SDK one in our object dir
author Chris Cannam
date Thu, 01 Feb 2018 16:34:08 +0000
parents e4a57215ddee
children 64fc3009d0a3
rev   line source
cannam@0 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
cannam@0 2
cannam@0 3 /*
cannam@0 4 QM DSP Library
cannam@0 5
cannam@0 6 Centre for Digital Music, Queen Mary, University of London.
Chris@84 7 This file 2005-2006 Christian Landone.
mathieu@96 8
mathieu@96 9 This program is free software; you can redistribute it and/or
mathieu@96 10 modify it under the terms of the GNU General Public License as
mathieu@96 11 published by the Free Software Foundation; either version 2 of the
mathieu@96 12 License, or (at your option) any later version. See the file
Chris@84 13 COPYING included with this distribution for more information.
cannam@0 14 */
cannam@0 15
cannam@0 16 #ifndef TEMPOTRACK_H
cannam@0 17 #define TEMPOTRACK_H
cannam@0 18
cannam@0 19
cannam@0 20 #include <stdio.h>
cannam@0 21 #include <vector>
cannam@0 22
cannam@0 23 #include "dsp/signalconditioning/DFProcess.h"
cannam@16 24 #include "maths/Correlation.h"
cannam@0 25 #include "dsp/signalconditioning/Framer.h"
cannam@0 26
cannam@0 27
cannam@0 28
cannam@0 29 using std::vector;
cannam@0 30
cannam@0 31 struct WinThresh
cannam@0 32 {
Chris@189 33 int pre;
Chris@189 34 int post;
cannam@0 35 };
cannam@0 36
cannam@0 37 struct TTParams
cannam@0 38 {
Chris@189 39 int winLength; //Analysis window length
Chris@189 40 int lagLength; //Lag & Stride size
Chris@189 41 int alpha; //alpha-norm parameter
Chris@189 42 int LPOrd; // low-pass Filter order
cannam@0 43 double* LPACoeffs; //low pass Filter den coefficients
cannam@0 44 double* LPBCoeffs; //low pass Filter num coefficients
cannam@0 45 WinThresh WinT;//window size in frames for adaptive thresholding [pre post]:
cannam@0 46 };
cannam@0 47
cannam@0 48
cannam@0 49 class TempoTrack
cannam@0 50 {
cannam@0 51 public:
cannam@0 52 TempoTrack( TTParams Params );
cannam@0 53 virtual ~TempoTrack();
cannam@0 54
cannam@6 55 vector<int> process( vector <double> DF, vector <double> *tempoReturn = 0);
cannam@0 56
cannam@0 57
cannam@0 58 private:
cannam@0 59 void initialise( TTParams Params );
cannam@0 60 void deInitialise();
cannam@0 61
Chris@189 62 int beatPredict( int FSP, double alignment, double period, int step);
Chris@189 63 int phaseMM( double* DF, double* weighting, int winLength, double period );
Chris@189 64 void createPhaseExtractor( double* Filter, int winLength, double period, int fsp, int lastBeat );
Chris@189 65 int findMeter( double* ACF, int len, double period );
cannam@0 66 void constDetect( double* periodP, int currentIdx, int* flag );
cannam@0 67 void stepDetect( double* periodP, double* periodG, int currentIdx, int* flag );
Chris@189 68 void createCombFilter( double* Filter, int winLength, int TSig, double beatLag );
cannam@0 69 double tempoMM( double* ACF, double* weight, int sig );
cannam@0 70
Chris@189 71 int m_dataLength;
Chris@189 72 int m_winLength;
Chris@189 73 int m_lagLength;
cannam@0 74
Chris@189 75 double m_rayparam;
Chris@189 76 double m_sigma;
Chris@189 77 double m_DFWVNnorm;
cannam@0 78
cannam@0 79 vector<int> m_beats; // Vector of detected beats
cannam@0 80
cannam@6 81 double m_lockedTempo;
cannam@6 82
cannam@0 83 double* m_tempoScratch;
cannam@39 84 double* m_smoothRCF; // Smoothed Output of Comb Filterbank (m_tempoScratch)
cannam@0 85
cannam@0 86 // Processing Buffers
cannam@0 87 double* m_rawDFFrame; // Original Detection Function Analysis Frame
cannam@0 88 double* m_smoothDFFrame; // Smoothed Detection Function Analysis Frame
cannam@0 89 double* m_frameACF; // AutoCorrelation of Smoothed Detection Function
cannam@0 90
cannam@0 91 //Low Pass Coefficients for DF Smoothing
cannam@0 92 double* m_ACoeffs;
cannam@0 93 double* m_BCoeffs;
cannam@0 94
cannam@0 95 // Objetcs/operators declaration
cannam@0 96 Framer m_DFFramer;
cannam@0 97 DFProcess* m_DFConditioning;
cannam@0 98 Correlation m_correlator;
cannam@0 99 // Config structure for DFProcess
cannam@0 100 DFProcConfig m_DFPParams;
cannam@39 101
cannam@39 102 // also want to smooth m_tempoScratch
cannam@39 103 DFProcess* m_RCFConditioning;
cannam@39 104 // Config structure for RCFProcess
cannam@39 105 DFProcConfig m_RCFPParams;
cannam@39 106
cannam@39 107
cannam@39 108
cannam@0 109 };
cannam@0 110
cannam@0 111 #endif