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 FILTER_H cannam@0: #define FILTER_H cannam@0: cannam@0: #ifndef NULL cannam@0: #define NULL 0 cannam@0: #endif cannam@0: Chris@153: /** Chris@153: * Filter specification. For a filter of order ord, the ACoeffs and Chris@153: * BCoeffs arrays must point to ord+1 values each. ACoeffs provides Chris@153: * the denominator and BCoeffs the numerator coefficients of the Chris@153: * filter. Chris@153: */ cannam@0: struct FilterConfig{ cannam@0: unsigned int ord; cannam@0: double* ACoeffs; cannam@0: double* BCoeffs; cannam@0: }; cannam@0: Chris@153: /** Chris@153: * Digital filter specified through FilterConfig structure. Chris@153: */ cannam@0: class Filter cannam@0: { cannam@0: public: cannam@0: Filter( FilterConfig Config ); cannam@0: virtual ~Filter(); cannam@0: cannam@0: void reset(); cannam@0: cannam@0: void process( double *src, double *dst, unsigned int length ); cannam@0: cannam@0: private: cannam@0: void initialise( FilterConfig Config ); cannam@0: void deInitialise(); cannam@0: cannam@0: unsigned int m_ord; cannam@0: cannam@0: double* m_inBuffer; cannam@0: double* m_outBuffer; cannam@0: cannam@0: double* m_ACoeffs; cannam@0: double* m_BCoeffs; cannam@0: }; cannam@0: cannam@0: #endif