qm-dsp  1.8
DecimatorB.h
Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
00002 /*
00003     QM DSP Library
00004 
00005     Centre for Digital Music, Queen Mary, University of London.
00006 
00007     This program is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU General Public License as
00009     published by the Free Software Foundation; either version 2 of the
00010     License, or (at your option) any later version.  See the file
00011     COPYING included with this distribution for more information.
00012 */
00013 
00014 #ifndef DECIMATORB_H
00015 #define DECIMATORB_H
00016 
00017 #include <vector>
00018 
00025 class DecimatorB
00026 {
00027 public:
00028     void process( const double* src, double* dst );
00029     void process( const float* src, float* dst );
00030 
00039     DecimatorB(int inLength, int decFactor);
00040     virtual ~DecimatorB();
00041 
00042     int getFactor() const { return m_decFactor; }
00043 
00044 private:
00045     void deInitialise();
00046     void initialise(int inLength, int decFactor);
00047     void doAntiAlias(const double* src, double* dst, int length, int filteridx);
00048     void doProcess();
00049 
00050     int m_inputLength;
00051     int m_outputLength;
00052     int m_decFactor;
00053 
00054     std::vector<std::vector<double> > m_o;
00055 
00056     double m_a[7];
00057     double m_b[7];
00058         
00059     double *m_aaBuffer;
00060     double *m_tmpBuffer;
00061 };
00062 
00063 #endif
00064