qm-dsp  1.8
ChangeDetectionFunction.h
Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
00002 
00003 /*
00004     QM DSP Library
00005 
00006     Centre for Digital Music, Queen Mary, University of London.
00007     This file copyright 2006 Martin Gasser.
00008 
00009     This program is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU General Public License as
00011     published by the Free Software Foundation; either version 2 of the
00012     License, or (at your option) any later version.  See the file
00013     COPYING included with this distribution for more information.
00014 */
00015 
00016 #ifndef _CHANGEDETECTIONFUNCTION_
00017 #define _CHANGEDETECTIONFUNCTION_
00018 
00019 //#define DEBUG_CHANGE_DETECTION_FUNCTION 1
00020 
00021 #include "TCSgram.h"
00022 
00023 #include <valarray>
00024 using std::valarray;
00025 
00026 typedef valarray<double> ChangeDistance;
00027 
00028 struct ChangeDFConfig
00029 {
00030         int smoothingWidth;
00031 };
00032 
00033 class ChangeDetectionFunction
00034 {
00035 public:
00036         ChangeDetectionFunction(ChangeDFConfig);
00037         ~ChangeDetectionFunction();
00038         ChangeDistance process(const TCSGram& rTCSGram);
00039 private:
00040         void setFilterWidth(const int iWidth);
00041         
00042 private:
00043         valarray<double> m_vaGaussian;
00044         double m_dFilterSigma;
00045         int m_iFilterWidth;
00046 };
00047 
00048 #endif // _CHANGDETECTIONFUNCTION_