annotate dsp/tempotracking/TempoTrackV2.h @ 277:09bceb0aeff6
* Add Matthew's newer beat tracking implementation
author |
Chris Cannam <c.cannam@qmul.ac.uk> |
date |
Tue, 20 Jan 2009 15:01:01 +0000 |
parents |
|
children |
796170a9c8e4 |
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@277
|
26 vector<double> &beatPeriod);
|
c@277
|
27
|
c@277
|
28 void calculateBeats(const vector<double> &df,
|
c@277
|
29 const vector<double> &beatPeriod,
|
c@277
|
30 vector<double> &beats);
|
c@277
|
31
|
c@277
|
32 private:
|
c@277
|
33 typedef vector<int> i_vec_t;
|
c@277
|
34 typedef vector<vector<int> > i_mat_t;
|
c@277
|
35 typedef vector<double> d_vec_t;
|
c@277
|
36 typedef vector<vector<double> > d_mat_t;
|
c@277
|
37
|
c@277
|
38 void adapt_thresh(d_vec_t &df);
|
c@277
|
39 double mean_array(const d_vec_t &dfin, int start, int end);
|
c@277
|
40 void filter_df(d_vec_t &df);
|
c@277
|
41 void get_rcf(const d_vec_t &dfframe, const d_vec_t &wv, d_vec_t &rcf);
|
c@277
|
42 void viterbi_decode(const d_mat_t &rcfmat, const d_vec_t &wv, d_vec_t &bp);
|
c@277
|
43 double get_max_val(const d_vec_t &df);
|
c@277
|
44 int get_max_ind(const d_vec_t &df);
|
c@277
|
45 void normalise_vec(d_vec_t &df);
|
c@277
|
46 };
|
c@277
|
47
|
c@277
|
48 #endif
|