1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 3 /* 4 QM DSP Library 5 6 Centre for Digital Music, Queen Mary, University of London. 7 This file 2005-2006 Christian Landone. 8 9 This program is free software; you can redistribute it and/or 10 modify it under the terms of the GNU General Public License as 11 published by the Free Software Foundation; either version 2 of the 12 License, or (at your option) any later version. See the file 13 COPYING included with this distribution for more information. 14 */ 15 16 #ifndef QM_DSP_FRAMER_H 17 #define QM_DSP_FRAMER_H 18 19 #include <stdint.h> 20 21 class Framer 22 { 23 public: 24 Framer(); 25 virtual ~Framer(); 26 27 void setSource(double* src, int64_t length); 28 void configure(int frameLength, int hop); 29 30 int getMaxNoFrames(); 31 void getFrame(double* dst); 32 33 void resetCounters(); 34 35 private: 36 int64_t m_sampleLen; // DataLength (samples) 37 int m_framesRead; // Read Frames Index 38 39 double* m_srcBuffer; 40 double* m_dataFrame; // Analysis Frame Buffer 41 double* m_strideFrame; // Stride Frame Buffer 42 int m_frameLength; // Analysis Frame Length 43 int m_stepSize; // Analysis Frame Stride 44 45 int m_maxFrames; 46 47 int64_t m_srcIndex; 48 }; 49 50 #endif 51