qm-dsp  1.8
Decimator.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     This file 2005-2006 Christian Landone.
00007 
00008     This program is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU General Public License as
00010     published by the Free Software Foundation; either version 2 of the
00011     License, or (at your option) any later version.  See the file
00012     COPYING included with this distribution for more information.
00013 */
00014 
00015 #ifndef DECIMATOR_H
00016 #define DECIMATOR_H
00017 
00024 class Decimator  
00025 {
00026 public:
00037     Decimator( unsigned int inLength, unsigned int decFactor );
00038     virtual ~Decimator();
00039 
00046     void process( const double* src, double* dst );
00047 
00054     void process( const float* src, float* dst );
00055 
00056     int getFactor() const { return m_decFactor; }
00057     static int getHighestSupportedFactor() { return 8; }
00058 
00059     void resetFilter();
00060 
00061 private:
00062     void deInitialise();
00063     void initialise( unsigned int inLength, unsigned int decFactor );
00064     void doAntiAlias( const double* src, double* dst, unsigned int length );
00065     void doAntiAlias( const float* src, double* dst, unsigned int length );
00066 
00067     unsigned int m_inputLength;
00068     unsigned int m_outputLength;
00069     unsigned int m_decFactor;
00070 
00071     double Input;
00072     double Output ;
00073 
00074     double o1,o2,o3,o4,o5,o6,o7;
00075 
00076     double a[ 9 ];
00077     double b[ 9 ];
00078         
00079     double* decBuffer;
00080 };
00081 
00082 #endif //