cannam@0: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ cannam@0: cannam@0: /* cannam@0: QM DSP Library cannam@0: cannam@0: Centre for Digital Music, Queen Mary, University of London. Chris@84: This file 2005-2006 Christian Landone. Chris@84: Chris@84: This program is free software; you can redistribute it and/or Chris@84: modify it under the terms of the GNU General Public License as Chris@84: published by the Free Software Foundation; either version 2 of the Chris@84: License, or (at your option) any later version. See the file Chris@84: COPYING included with this distribution for more information. cannam@0: */ cannam@0: cannam@0: #ifndef FRAMER_H cannam@0: #define FRAMER_H cannam@0: cannam@0: //#include cannam@0: #include cannam@0: #include cannam@0: cannam@0: cannam@0: class Framer cannam@0: { cannam@0: public: cannam@0: void setSource( double* src, unsigned int length ); cannam@0: unsigned int getMaxNoFrames(); cannam@0: void getFrame( double* dst ); cannam@0: void configure( unsigned int frameLength, unsigned int hop ); cannam@0: Framer(); cannam@0: virtual ~Framer(); cannam@0: cannam@0: void resetCounters(); cannam@0: cannam@0: private: cannam@0: cannam@0: unsigned long m_ulSampleLen; // DataLength (samples) cannam@0: unsigned int m_framesRead; // Read Frames Index cannam@0: cannam@0: double* m_srcBuffer; cannam@0: double* m_dataFrame; // Analysis Frame Buffer cannam@0: double* m_strideFrame; // Stride Frame Buffer cannam@0: unsigned int m_frameLength; // Analysis Frame Length cannam@0: unsigned int m_stepSize; // Analysis Frame Stride cannam@0: cannam@0: unsigned int m_maxFrames; cannam@0: cannam@0: unsigned long m_ulSrcIndex; cannam@0: }; cannam@0: cannam@0: #endif