annotate dsp/signalconditioning/Filter.h @ 385:0d79970811c7

Add std::vector-returning process call
author Chris Cannam <c.cannam@qmul.ac.uk>
date Tue, 05 Nov 2013 16:36:53 +0000
parents f5b5f64835b9
children ca658c7215a9
rev   line source
c@225 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
c@225 2
c@225 3 /*
c@225 4 QM DSP Library
c@225 5
c@225 6 Centre for Digital Music, Queen Mary, University of London.
c@309 7 This file 2005-2006 Christian Landone.
c@309 8
c@309 9 This program is free software; you can redistribute it and/or
c@309 10 modify it under the terms of the GNU General Public License as
c@309 11 published by the Free Software Foundation; either version 2 of the
c@309 12 License, or (at your option) any later version. See the file
c@309 13 COPYING included with this distribution for more information.
c@225 14 */
c@225 15
c@225 16 #ifndef FILTER_H
c@225 17 #define FILTER_H
c@225 18
c@225 19 #ifndef NULL
c@225 20 #define NULL 0
c@225 21 #endif
c@225 22
c@378 23 /**
c@378 24 * Filter specification. For a filter of order ord, the ACoeffs and
c@378 25 * BCoeffs arrays must point to ord+1 values each. ACoeffs provides
c@378 26 * the denominator and BCoeffs the numerator coefficients of the
c@378 27 * filter.
c@378 28 */
c@225 29 struct FilterConfig{
c@225 30 unsigned int ord;
c@225 31 double* ACoeffs;
c@225 32 double* BCoeffs;
c@225 33 };
c@225 34
c@378 35 /**
c@378 36 * Digital filter specified through FilterConfig structure.
c@378 37 */
c@225 38 class Filter
c@225 39 {
c@225 40 public:
c@225 41 Filter( FilterConfig Config );
c@225 42 virtual ~Filter();
c@225 43
c@225 44 void reset();
c@225 45
c@225 46 void process( double *src, double *dst, unsigned int length );
c@225 47
c@225 48 private:
c@225 49 void initialise( FilterConfig Config );
c@225 50 void deInitialise();
c@225 51
c@225 52 unsigned int m_ord;
c@225 53
c@225 54 double* m_inBuffer;
c@225 55 double* m_outBuffer;
c@225 56
c@225 57 double* m_ACoeffs;
c@225 58 double* m_BCoeffs;
c@225 59 };
c@225 60
c@225 61 #endif