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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = disc_delay_T.h
  3. //
  4. #ifndef _DISC_DELAY_T_H_
  5. #define _DISC_DELAY_T_H_
  6. #include "signal_T.h"
  7. #include "control_T.h"
  8. #include "delay_modes.h"
  9. #include "psmodel.h"
  10. //======================================================
  11. template <class T>
  12. class DiscreteDelay : public PracSimModel
  13. {
  14. public:
  15.   DiscreteDelay< T >( 
  16.             char* instance_name,
  17.             PracSimModel* outer_model,
  18.             Signal<T>* in_signal,
  19.             Signal<T>* out_signal,
  20.             Control<int>* dynamic_delay_control,
  21.             Control<bool>* delay_change_enable_control);
  22.   DiscreteDelay< T >( 
  23.                   char* instance_name,
  24.                   PracSimModel* outer_model,
  25.                   Signal<T>* in_signal,
  26.                   Signal<T>* out_signal,
  27.                   Control<int>* dynamic_delay_control);
  28.   DiscreteDelay< T >( char* instance_name,
  29.                       PracSimModel* outer_model,
  30.                       Signal<T>* in_signal,
  31.                      Signal<T>* out_signal);
  32.   ~DiscreteDelay<T>(void);
  33.   void Initialize(void);
  34.   int Execute(void);
  35. private:
  36.   void Constructor_Common_Tasks( char* instance_name,
  37.                                  Signal<T>* in_signal,
  38.                                  Signal<T>* out_signal);
  39.   //  user-specified static parameters
  40.   DELAY_MODE_T Delay_Mode;
  41.   int Initial_Delay_In_Samps;
  42.   int Num_Initial_Passes;
  43.   int Max_Delay_In_Samps;
  44.   int Dynamic_Delay_Bias;
  45.   //  state variables and derived parameters
  46.   int Block_Size;
  47.   double Samp_Intvl;
  48.   int Active_Delay_In_Samps;
  49.   int Max_Buffer_Len; 
  50.   T *Start_Of_Buffer;
  51.   T *End_Of_Buffer;
  52.   T *Read_Ptr;
  53.   T *Write_Ptr;
  54.   //  Signals
  55.   Signal<T> *In_Sig;
  56.   Signal<T> *Out_Sig;  
  57.   //  Controls
  58.   Control<bool> *Delay_Chg_Enab_Ctl;
  59.   Control<int> *Dynam_Dly_Ctl;
  60. };
  61. #endif