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

3G开发

开发平台:

Visual C++

  1. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. //
  3. //  File = elip_filt_intg.cpp
  4. //
  5. //  Elliptical Filter
  6. //
  7. //#include <math.h>
  8. //#include "misdefs.h"
  9. #include "parmfile.h"
  10. #include "elip_filt_intg.h"
  11. #include "elliptical_proto.h"
  12. //#include "filter_types.h"
  13. extern ParmFile *ParmInput;
  14. #ifdef _DEBUG
  15.   extern ofstream *DebugFile;
  16. #endif
  17. //======================================================
  18. //  constructor
  19. EllipticalFilterByInteg::EllipticalFilterByInteg( char *instance_name,
  20.                                   PracSimModel *outer_model,
  21.                                   Signal<float> *in_sig,
  22.                                   Signal<float> *out_sig )
  23.                   :AnalogFilterByInteg( instance_name,
  24.                                outer_model,
  25.                                in_sig,
  26.                                out_sig )
  27. {
  28.   MODEL_NAME(EllipticalFilterByInteg);
  29.   OPEN_PARM_BLOCK;
  30.   // Most of the parameters needed to specify an elliptical filter
  31.   // are common to all the classic types and are therefore
  32.   // read by the AnalogFilter base class.
  33.   //
  34.   // separate values for 'Passband_Ripple' and 'Stopband_Ripple' are
  35.   // specific to elliptical so they are read here in the derived class
  36.   
  37.   if( !Bypass_Enabled)
  38.     {
  39.     GET_DOUBLE_PARM(Passband_Ripple_In_Db);
  40.     GET_DOUBLE_PARM(Stopband_Ripple_In_Db);
  41.     GET_DOUBLE_PARM(Norm_Hz_Stop_Edge);
  42.     Selec_Factor = Norm_Hz_Pass_Edge / Norm_Hz_Stop_Edge;
  43.     // construct a elliptical prototype
  44.     Lowpass_Proto_Filt = new EllipticalPrototype( Prototype_Order, 
  45.                                                   Passband_Ripple_In_Db,
  46.                                                   Stopband_Ripple_In_Db,
  47.                                                   Selec_Factor);
  48.     Lowpass_Proto_Filt->DumpBiquads(DebugFile); 
  49.     Lowpass_Proto_Filt->GetDenomPoly(false);
  50.     }
  51.   return;
  52. }
  53. //template <class T>
  54. //EllipticalFilterByInteg<T>::~EllipticalFilterByInteg(){};
  55. //template EllipticalFilterByInteg<float>;
  56. //template EllipticalFilterByInteg<std::complex<float> >;