cheb_filt_iir.cpp
上传用户:jtjnyq9001
上传日期:2014-11-21
资源大小:3974k
文件大小:2k
源码类别:

3G开发

开发平台:

Visual C++

  1. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. //
  3. //  File = cheb_filt_iir.cpp
  4. //
  5. //  Chebyshev Filter
  6. //
  7. //#include <math.h>
  8. //#include "misdefs.h"
  9. #include "parmfile.h"
  10. #include "cheb_filt_iir.h"
  11. #include "chebyshev_proto.h"
  12. //#include "filter_types.h"
  13. extern ParmFile *ParmInput;
  14. #ifdef _DEBUG
  15.   extern ofstream *DebugFile;
  16. #endif
  17. //======================================================
  18. //  constructor
  19. template < class T>
  20. ChebyshevFilterByIir<T>::ChebyshevFilterByIir( char *instance_name,
  21.                                   PracSimModel *outer_model,
  22.                                   Signal<T> *in_sig,
  23.                                   Signal<T> *out_sig )
  24.                   :AnalogFilterByIir<T>( instance_name,
  25.                                outer_model,
  26.                                in_sig,
  27.                                out_sig )
  28. {
  29.   MODEL_NAME(ChebyshevFilterByIir);
  30.   OPEN_PARM_BLOCK;
  31.   // Most of the parameters needed to specify a Chebyshev filter
  32.   // are common to all the classic types and are therefore
  33.   // read by the AnalogFilter base class.
  34.   //
  35.   // 'Ripple' is specific to Chebyshev so it is read here in the drerived class
  36.   
  37.   if( !Bypass_Enabled)
  38.     {
  39.     GET_DOUBLE_PARM(Passband_Ripple_In_Db);
  40.     GET_BOOL_PARM(Bw_Is_Ripple_Bw);
  41.     // construct a Chebyshev prototype
  42.     Lowpass_Proto_Filt = new ChebyshevPrototype(  Prototype_Order, 
  43.                                                   Passband_Ripple_In_Db,
  44.                                                   Bw_Is_Ripple_Bw);
  45.     //Lowpass_Proto_Filt->DumpBiquads(DebugFile);
  46.     Lowpass_Proto_Filt->FilterFrequencyResponse();
  47.     }
  48.   return;
  49. }
  50. template <class T>
  51. ChebyshevFilterByIir<T>::~ChebyshevFilterByIir(){};
  52. template ChebyshevFilterByIir<float>;
  53. template ChebyshevFilterByIir<std::complex<float> >;