Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GrIIRfilter.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2002 Free Software Foundation, Inc.
00004  * 
00005  * This file is part of GNU Radio
00006  * 
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2, or (at your option)
00010  * any later version.
00011  * 
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA 02111-1307, USA.
00021  */
00022 
00023 #ifndef _GRIIRFILTER_H_
00024 #define _GRIIRFILTER_H_
00025 
00026 #include <VrDecimatingSigProc.h>
00027 #include <gr_iir.h>
00028 
00036 template<class iType, class oType, class taptype>
00037 class GrIIRfilter : public VrDecimatingSigProc<iType,oType>
00038 {
00039  public:
00043   GrIIRfilter (int decimation_factor,const vector<taptype> intaps,
00044                   const vector<taptype> outtaps);
00045 
00046   virtual const char *name () { return "GrIIRfilter"; }
00047   virtual void initialize ();
00048   virtual int work (VrSampleRange output, void *o[],
00049                     VrSampleRange inputs[], void *i[]);
00050 
00051  protected:
00052   gr_iir<oType,iType,taptype>   _iir;
00053 };
00054 
00055 
00056 template<class iType, class oType, class taptype>
00057 GrIIRfilter<iType, oType, taptype>::GrIIRfilter (int decimation_factor,
00058                                                 const vector <taptype> intaps,
00059                                                 const vector <taptype> outtaps)
00060   : VrDecimatingSigProc<iType, oType>(1, decimation_factor),
00061     _iir (intaps,outtaps)
00062    // _builder (0),
00063 {
00064 }
00065 
00066 template<class iType, class oType, class taptype> void
00067 GrIIRfilter<iType, oType, taptype>::initialize ()
00068 {
00069 }
00070 
00071 template<class iType, class oType, class taptype> int
00072 GrIIRfilter<iType, oType, taptype>::work (VrSampleRange output, void *ao[],
00073                                      VrSampleRange inputs[], void *ai[])
00074 {
00075   iType *in = (iType *) ai[0];
00076   oType *out = (oType *) ao[0];
00077 
00078   _iir.filterN (out, in, output.size);
00079 
00080   return output.size;
00081 }
00082 
00083 
00084 #endif /* _GRIIRFILTER_H_ */

Generated on Tue Mar 15 23:46:36 2005 for GNU Radio by  doxygen 1.4.0