| 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. | 
| cannam@0 | 7     This file copyright 2006 Martin Gasser. | 
| Chris@84 | 8 | 
| Chris@84 | 9     This program is free software; you can redistribute it and/or | 
| Chris@84 | 10     modify it under the terms of the GNU General Public License as | 
| Chris@84 | 11     published by the Free Software Foundation; either version 2 of the | 
| Chris@84 | 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 _TCSGram_ | 
| cannam@0 | 17 #define _TCSGram_ | 
| cannam@0 | 18 | 
| cannam@0 | 19 #include <vector> | 
| cannam@0 | 20 #include <valarray> | 
| cannam@0 | 21 #include <utility> | 
| cannam@0 | 22 | 
| cannam@0 | 23 #include "TonalEstimator.h" | 
| cannam@0 | 24 | 
| cannam@0 | 25 typedef std::vector<std::pair<long, TCSVector> > vectorlist_t; | 
| cannam@0 | 26 | 
| cannam@0 | 27 class TCSGram | 
| cannam@0 | 28 { | 
| cannam@0 | 29 public: | 
| cannam@0 | 30 	TCSGram(); | 
| cannam@0 | 31 	~TCSGram(); | 
| cannam@0 | 32 	void getTCSVector(int, TCSVector&) const; | 
| cannam@0 | 33 	void addTCSVector(const TCSVector&); | 
| cannam@0 | 34 	long getTime(size_t) const; | 
| cannam@0 | 35 	long getDuration() const; | 
| cannam@0 | 36 	void printDebug(); | 
| cannam@0 | 37 	int getSize() const { return m_VectorList.size(); } | 
| cannam@0 | 38 	void reserve(size_t uSize) { m_VectorList.reserve(uSize); } | 
| cannam@0 | 39 	void clear() { m_VectorList.clear(); } | 
| cannam@0 | 40 	void setFrameDuration(const double dFrameDurationMS) { m_dFrameDurationMS = dFrameDurationMS; } | 
| cannam@0 | 41 	void setNumBins(const unsigned int uNumBins) { m_uNumBins = uNumBins; } | 
| cannam@0 | 42 	void normalize(); | 
| cannam@0 | 43 protected: | 
| cannam@0 | 44 	vectorlist_t m_VectorList; | 
| cannam@0 | 45 	unsigned int m_uNumBins; | 
| cannam@0 | 46 	double m_dFrameDurationMS; | 
| cannam@0 | 47 }; | 
| cannam@0 | 48 | 
| cannam@0 | 49 #endif |