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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = contin_delay_T.h
  3. //
  4. #ifndef _CONTIN_DELAY_T_H_
  5. #define _CONTIN_DELAY_T_H_
  6. #include "signal_T.h"
  7. #include "control_T.h"
  8. #include "delay_modes.h"
  9. #include "interp_modes.h"
  10. #include "psmodel.h"
  11. template <class T>
  12. class ContinuousDelay : public PracSimModel
  13. {
  14. public:
  15.   //---------------------------------------------
  16.   // constructor that supports all delay modes
  17.   ContinuousDelay< T >( char* instance_name,
  18.                     PracSimModel* outer_model,
  19.                     Signal<T>* in_signal,
  20.                     Signal<T>* out_signal,
  21.                     Control<float>* new_delay,
  22.                     Control<bool>* delay_change_enabled);
  23.   //---------------------------------------------------
  24.   //  constructor does not support 'gated' delay mode
  25.   //  (eliminates the need to connect gating control)
  26.   ContinuousDelay< T >( char* instance_name,
  27.                     PracSimModel* outer_model,
  28.                     Signal<T>* in_signal,
  29.                     Signal<T>* out_signal,
  30.                     Control<float>* new_delay);
  31.   //---------------------------------------------------
  32.   //  constructor does not support 'gated' or 'dynamic'
  33.   //  delay modes (eliminates the need to connect gating
  34.   //  and delay controls)
  35.   ContinuousDelay< T >( char* instance_name,
  36.                     PracSimModel* outer_model,
  37.                     Signal<T>* in_signal,
  38.                     Signal<T>* out_signal);
  39.   ~ContinuousDelay<T>(void);
  40.   void Initialize(void);
  41.   int Execute(void);
  42. private:
  43.   //------------------------------------------------------
  44.   //  private method that is called by each of the
  45.   //  three different constructors to perform common tasks
  46.   void Constructor_Common_Tasks(  char* instance_name,
  47.                                   Signal<T>* in_signal,
  48.                                   Signal<T>* out_signal);
  49.   //---------------------------------------------
  50.   //  user-specified static parameters
  51.   DELAY_MODE_T Delay_Mode;
  52.   INTERP_MODE_T Interp_Mode;
  53.   double Initial_Delay;
  54.   int Max_Delay;
  55.   //--------------------------------------------
  56.   //  state variables and derived parameters
  57.   double Block_Size;
  58.   double Samp_Intvl;
  59.   double Active_Delay;
  60.   float Interp_Weight;
  61.   float One_Minus_Weight;
  62.   int Active_Buffer_Len;
  63.   int Num_Sidelobes;
  64.   int Return_Status;
  65.   int New_Pass_Number;
  66.   int Blocks_Of_Offset;
  67.   int Num_Blocks_Skipped;
  68.   int Offset_Sum_Start_To_Out_Samp;
  69.   float *Sinc_Val;
  70.   int Max_Buffer_Len;  // numb of locs needed for Max_Delay
  71.   T *Start_Of_Buffer;
  72.   T *End_Of_Buffer;
  73.   T *Read_Ptr;
  74.   T *Read_Ptr_Start;
  75.   T *Write_Ptr;
  76.   //--------------------------
  77.   //  Signals
  78.   Signal<T> *In_Sig;
  79.   Signal<T> *Out_Sig;  
  80.   //-----------------------------------
  81.   //  Controls
  82.   Control<bool> *Delay_Change_Enabled;
  83.   Control<float> *New_Delay;
  84. };
  85. #endif