DecimatorB.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 /*
3  QM DSP Library
4 
5  Centre for Digital Music, Queen Mary, University of London.
6 
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.
12 */
13 
14 #ifndef QM_DSP_DECIMATORB_H
15 #define QM_DSP_DECIMATORB_H
16 
17 #include <vector>
18 
26 {
27 public:
28  void process( const double* src, double* dst );
29  void process( const float* src, float* dst );
30 
39  DecimatorB(int inLength, int decFactor);
40  virtual ~DecimatorB();
41 
42  int getFactor() const { return m_decFactor; }
43 
44 private:
45  void deInitialise();
46  void initialise(int inLength, int decFactor);
47  void doAntiAlias(const double* src, double* dst, int length, int filteridx);
48  void doProcess();
49 
53 
54  std::vector<std::vector<double> > m_o;
55 
56  double m_a[7];
57  double m_b[7];
58 
59  double *m_aaBuffer;
60  double *m_tmpBuffer;
61 };
62 
63 #endif
64 
void initialise(int inLength, int decFactor)
Definition: DecimatorB.cpp:39
double m_a[7]
Definition: DecimatorB.h:56
int m_outputLength
Definition: DecimatorB.h:51
void doProcess()
Definition: DecimatorB.cpp:111
int getFactor() const
Definition: DecimatorB.h:42
double m_b[7]
Definition: DecimatorB.h:57
void process(const double *src, double *dst)
Definition: DecimatorB.cpp:131
int m_inputLength
Definition: DecimatorB.h:50
double * m_aaBuffer
Definition: DecimatorB.h:59
virtual ~DecimatorB()
Definition: DecimatorB.cpp:34
std::vector< std::vector< double > > m_o
Definition: DecimatorB.h:54
int m_decFactor
Definition: DecimatorB.h:52
void deInitialise()
Definition: DecimatorB.cpp:84
DecimatorB carries out a fast downsample by a power-of-two factor.
Definition: DecimatorB.h:25
double * m_tmpBuffer
Definition: DecimatorB.h:60
DecimatorB(int inLength, int decFactor)
Construct a DecimatorB to operate on input blocks of length inLength, with decimation factor decFacto...
Definition: DecimatorB.cpp:23
void doAntiAlias(const double *src, double *dst, int length, int filteridx)
Definition: DecimatorB.cpp:90