Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


Filter.h

00001 /***************************************************/
00028 /***************************************************/
00029 
00030 #ifndef STK_FILTER_H
00031 #define STK_FILTER_H
00032 
00033 #include "Stk.h"
00034 #include <vector>
00035 
00036 class Filter : public Stk
00037 {
00038 public:
00040   Filter(void);
00041 
00043 
00047   Filter( std::vector<StkFloat> &bCoefficients, std::vector<StkFloat> &aCoefficients );
00048 
00050   virtual ~Filter(void);
00051 
00053   void clear(void);
00054 
00056 
00063   void setCoefficients( std::vector<StkFloat> &bCoefficients, std::vector<StkFloat> &aCoefficients, bool clearState = false );
00064 
00066 
00073   void setNumerator( std::vector<StkFloat> &bCoefficients, bool clearState = false );
00074 
00076 
00085   void setDenominator( std::vector<StkFloat> &aCoefficients, bool clearState = false );
00086 
00088 
00092   virtual void setGain(StkFloat gain);
00093 
00095   virtual StkFloat getGain(void) const;
00096 
00098   virtual StkFloat lastOut(void) const;
00099 
00101   virtual StkFloat tick( StkFloat input );
00102 
00104 
00110   virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 0 );
00111 
00112 protected:
00113 
00114   StkFloat gain_;
00115   std::vector<StkFloat> b_;
00116   std::vector<StkFloat> a_;
00117   std::vector<StkFloat> outputs_;
00118   std::vector<StkFloat> inputs_;
00119 
00120 };
00121 
00122 #endif

The Synthesis ToolKit in C++ (STK)
©1995-2007 Perry R. Cook and Gary P. Scavone. All Rights Reserved.