annotate dsp/tempotracking/TempoTrackV2.h @ 278:833ca65b0820

* Update with fixes from Matthew's newer code
author Chris Cannam <c.cannam@qmul.ac.uk>
date Mon, 09 Feb 2009 16:05:32 +0000
parents 09bceb0aeff6
children 5bec06ecc88a
rev   line source
c@277 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
c@277 2
c@277 3 /*
c@277 4 QM DSP Library
c@277 5
c@277 6 Centre for Digital Music, Queen Mary, University of London.
c@277 7 This file copyright 2008-2009 Matthew Davies and QMUL.
c@277 8 All rights reserved.
c@277 9 */
c@277 10
c@277 11
c@277 12 #ifndef TEMPOTRACKV2_H
c@277 13 #define TEMPOTRACKV2_H
c@277 14
c@277 15 #include <vector>
c@277 16
c@277 17 using std::vector;
c@277 18
c@277 19 class TempoTrackV2
c@277 20 {
c@277 21 public:
c@277 22 TempoTrackV2();
c@277 23 ~TempoTrackV2();
c@277 24
c@277 25 void calculateBeatPeriod(const vector<double> &df,
c@278 26 vector<double> &beatPeriod,
c@278 27 vector<double> &tempi);
c@277 28
c@277 29 void calculateBeats(const vector<double> &df,
c@277 30 const vector<double> &beatPeriod,
c@277 31 vector<double> &beats);
c@277 32
c@277 33 private:
c@277 34 typedef vector<int> i_vec_t;
c@277 35 typedef vector<vector<int> > i_mat_t;
c@277 36 typedef vector<double> d_vec_t;
c@277 37 typedef vector<vector<double> > d_mat_t;
c@277 38
c@277 39 void adapt_thresh(d_vec_t &df);
c@277 40 double mean_array(const d_vec_t &dfin, int start, int end);
c@277 41 void filter_df(d_vec_t &df);
c@277 42 void get_rcf(const d_vec_t &dfframe, const d_vec_t &wv, d_vec_t &rcf);
c@278 43 void viterbi_decode(const d_mat_t &rcfmat, const d_vec_t &wv,
c@278 44 d_vec_t &bp, d_vec_t &tempi);
c@277 45 double get_max_val(const d_vec_t &df);
c@277 46 int get_max_ind(const d_vec_t &df);
c@277 47 void normalise_vec(d_vec_t &df);
c@277 48 };
c@277 49
c@277 50 #endif