1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
5 Centre for Digital Music, Queen Mary, University of London.
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version. See the file
11 COPYING included with this distribution for more information.
20 * DecimatorB carries out a fast downsample by a power-of-two
21 * factor. It only knows how to decimate by a factor of 2, and will
22 * use repeated decimation for higher factors. A Butterworth filter of
23 * order 6 is used for the lowpass filter.
28 void process( const double* src, double* dst );
29 void process( const float* src, float* dst );
32 * Construct a DecimatorB to operate on input blocks of length
33 * inLength, with decimation factor decFactor. inLength should be
34 * a multiple of decFactor. Output blocks will be of length
35 * inLength / decFactor.
37 * decFactor must be a power of two.
39 DecimatorB(int inLength, int decFactor);
40 virtual ~DecimatorB();
42 int getFactor() const { return m_decFactor; }
46 void initialise(int inLength, int decFactor);
47 void doAntiAlias(const double* src, double* dst, int length, int filteridx);
54 std::vector<std::vector<double> > m_o;