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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = anlg_filt_iir.h
  3. //
  4. #ifndef _ANLG_FILT_IIR_H_
  5. #define _ANLG_FILT_IIR_H_
  6. #include <complex>
  7. #include "signal_T.h"
  8. #include "filter_proto.h"
  9. #include "denorm_proto.h"
  10. #include "psmodel.h"
  11. #include "filter_types.h"
  12. //======================================================
  13. template <class T>
  14. class AnalogFilterByIir : public PracSimModel
  15. {
  16. public:
  17.    // Normal Constructor
  18.    AnalogFilterByIir(   char* instance_name,
  19.                         PracSimModel *outer_model,
  20.                         Signal<T> *in_sig,
  21.                         Signal<T> *out_sig );
  22.    // Subordinate Constructor
  23.    AnalogFilterByIir(   char* instance_name,
  24.                         PracSimModel *outer_model);
  25.    ~AnalogFilterByIir(void);
  26.    // Normal Initialize
  27.    virtual void Initialize(void);
  28.    // Subordinate Initialize
  29.    void Initialize(  int proc_block_size, 
  30.                      double samp_intvl);
  31.    virtual int Execute();
  32.    // Used instead of 'Execute' for subordinate form
  33.    T ProcessSample(T input_val);
  34. protected:
  35.    // Implements functionality common to both ctors
  36.    void Constructor_Core( char *instance_name);
  37.    // Implements functionality common to both
  38.    // forms of 'Initialize'
  39.    void Init_Kernel(void);
  40.    Signal<T> *In_Sig;
  41.    Signal<T> *Out_Sig;
  42.    float Estim_Delay;
  43.    std::complex<double> *Out_Mem;
  44.    std::complex<double> *In_Mem;
  45.    std::complex<double> *Input_Buffer;
  46.    std::complex<double> *Output_Buffer;
  47.    int Input_Write_Idx;
  48.    int Output_Write_Idx;
  49.    bool Bypass_Enabled;
  50.    double Samp_Rate;
  51.    double Samp_Intvl;
  52.    DenormalizedPrototype *Denorm_Proto_Filt;
  53.    AnalogFilterPrototype *Lowpass_Proto_Filt;
  54.    int Filt_Shape;
  55.    FILT_BAND_CONFIG_T Filt_Band_Config;
  56.    int Filt_Order;
  57.    bool Resp_Plot_Enabled;
  58.    bool Db_Scale_Enabled;
  59.    int Prototype_Order;
  60.    int Upper_Summation_Limit;
  61.    float Upper_Cutoff_NFU;
  62.    float Lower_Cutoff_NFU;
  63.    float Passband_Ripple;
  64.    float Stopband_Ripple;
  65.    float Stopband_Atten;
  66.    float Norm_Hz_Pass_Edge;
  67.    float Norm_Hz_Pass_Edge_2;
  68.    float Warped_Rad_Pass_Edge;
  69.    float Warped_Rad_Pass_Edge_2;
  70.    float Norm_Hz_Stop_Edge;
  71.    float Lower_Stopband_Edge;
  72.    float Upper_Trans_Width;
  73.    float Lower_Trans_Width;
  74.    double *A_Coefs;
  75.    double *B_Coefs;
  76.    double *A_Coef_Precess_Buf;
  77.    double *B_Coef_Precess_Buf;
  78.    int Num_Poles;
  79.    int Num_Zeros;
  80.    int Cumul_Samp_Count;
  81.    int Proc_Block_Size;
  82.    bool Using_Signal_Objects;
  83. };
  84. #endif