Chris@43: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@43: 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@7: c@7: #ifndef __Tempogram__Spectrogram__ c@7: #define __Tempogram__Spectrogram__ c@7: #include c@7: #include c@7: #include Chris@31: #include c@7: c@13: typedef std::vector > Spectrogram; c@13: typedef std::vector > SpectrogramTransposed; c@13: c@11: class SpectrogramProcessor{ c@13: size_t m_windowLength; c@13: size_t m_fftLength; c@13: size_t m_hopSize; c@13: size_t m_numberOfOutputBins; c@13: double * m_pFftInput; c@13: double * m_pFftOutputReal; c@13: double * m_pFftOutputImag; c@7: c@7: void initialise(); c@7: void cleanup(); c@7: public: c@14: SpectrogramProcessor(const size_t &windowLength, const size_t &fftLength, const size_t &hopSize); c@11: ~SpectrogramProcessor(); c@13: c@25: Spectrogram process(const float * const pInput, const size_t &inputLength, const float * pWindow) const; c@14: static SpectrogramTransposed transpose(const Spectrogram &spectrogram); c@25: static float calculateMax(const Spectrogram &spectrogram); c@7: }; c@7: c@7: #endif /* defined(__Tempogram__Spectrogram__) */