annotate dsp/tempotracking/TempoTrack.h @ 414:7e8d1f26b098

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