TCSgram.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  QM DSP Library
5 
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Martin Gasser.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef QM_DSP_TCSGRAM_H
17 #define QM_DSP_TCSGRAM_H
18 
19 #include <vector>
20 #include <valarray>
21 #include <utility>
22 
23 #include "TonalEstimator.h"
24 
25 typedef std::vector<std::pair<long, TCSVector> > vectorlist_t;
26 
27 class TCSGram
28 {
29 public:
30  TCSGram();
31  ~TCSGram();
32  void getTCSVector(int, TCSVector&) const;
33  void addTCSVector(const TCSVector&);
34  long getTime(size_t) const;
35  long getDuration() const;
36  void printDebug();
37  int getSize() const { return m_VectorList.size(); }
38  void reserve(size_t uSize) { m_VectorList.reserve(uSize); }
39  void clear() { m_VectorList.clear(); }
40  void setFrameDuration(const double dFrameDurationMS) {
41  m_dFrameDurationMS = dFrameDurationMS;
42  }
43  void setNumBins(const unsigned int uNumBins) {
44  m_uNumBins = uNumBins;
45  }
46  void normalize();
47 protected:
49  unsigned int m_uNumBins;
51 };
52 
53 #endif
int getSize() const
Definition: TCSgram.h:37
void reserve(size_t uSize)
Definition: TCSgram.h:38
TCSGram()
Definition: TCSgram.cpp:25
long getTime(size_t) const
Definition: TCSgram.cpp:46
void addTCSVector(const TCSVector &)
Definition: TCSgram.cpp:52
void clear()
Definition: TCSgram.h:39
void getTCSVector(int, TCSVector &) const
Definition: TCSgram.cpp:35
vectorlist_t m_VectorList
Definition: TCSgram.h:48
unsigned int m_uNumBins
Definition: TCSgram.h:49
double m_dFrameDurationMS
Definition: TCSgram.h:50
void printDebug()
Definition: TCSgram.cpp:69
void normalize()
~TCSGram()
Definition: TCSgram.cpp:30
void setNumBins(const unsigned int uNumBins)
Definition: TCSgram.h:43
std::vector< std::pair< long, TCSVector > > vectorlist_t
Definition: TCSgram.h:25
void setFrameDuration(const double dFrameDurationMS)
Definition: TCSgram.h:40
long getDuration() const
Definition: TCSgram.cpp:63