Chris@43: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ c@5: Chris@43: /* Chris@43: Vamp Tempogram Plugin Chris@43: Carl Bussey, Centre for Digital Music, Queen Mary University of London Chris@43: Copyright 2014 Queen Mary University of London. Chris@43: Chris@43: This program is free software; you can redistribute it and/or Chris@43: modify it under the terms of the GNU General Public License as Chris@43: published by the Free Software Foundation; either version 2 of the Chris@43: License, or (at your option) any later version. See the file Chris@43: COPYING included with this distribution for more information. Chris@43: */ c@11: c@5: #ifndef __Tempogram__NoveltyCurve__ c@5: #define __Tempogram__NoveltyCurve__ c@5: c@5: #include c@7: #include c@7: #include c@7: #include c@7: #include "FIRFilter.h" c@7: #include "WindowFunction.h" c@7: #include c@14: #include "SpectrogramProcessor.h" c@5: c@14: class NoveltyCurveProcessor{ c@5: float m_samplingFrequency; c@20: size_t m_fftLength; c@20: size_t m_blockSize; c@5: int m_compressionConstant; c@20: size_t m_numberOfBands; c@13: int * m_pBandBoundaries; c@13: float * m_pBandSum; c@5: c@5: void initialise(); c@5: void cleanup(); c@13: void subtractLocalAverage(std::vector &noveltyCurve, const size_t &smoothLength) const; c@22: void smoothedDifferentiator(SpectrogramTransposed &spectrogram, const size_t &smoothLength) const; c@22: void halfWaveRectify(SpectrogramTransposed &spectrogram) const; c@5: c@5: public: c@5: c@22: NoveltyCurveProcessor(const float &samplingFrequency, const size_t &fftLength, const size_t &compressionConstant); c@14: ~NoveltyCurveProcessor(); c@22: std::vector spectrogramToNoveltyCurve(const Spectrogram &spectrogram) const; c@5: }; c@5: c@5: #endif /* defined(__Tempogram__NoveltyCurve__) */