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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = contindelay_sim.cpp
  3. //
  4. #define SIM_NAME "ContinDelay"
  5. #define SIM_TITLE "Continuous Delay Testbed"
  6. #include "global_stuff.h"
  7. //=====================
  8. // model includes
  9. #include "sinc_wave.h"
  10. #include "bitgen.h"
  11. #include "bitwav.h"
  12. #include "multi_tone_gen.h"
  13. #include "ramp_gen.h"
  14. #include "contin_delay_tester.h"
  15. #include "contin_delay_T.h"
  16. #include "dft_delay_T.h"
  17. #include "siganchr.h"
  18. //=========================================================
  19. main()
  20. {
  21.    #include "sim_preamble.cpp"
  22.   //=========================================================================
  23.   //  Misc special processing
  24.    SincWaveform(  4, //num_sidelobes
  25.                  50, //samps_per_hump
  26.                  "sinc_wave.txt");//out_filename
  27.   //=========================================================================
  28.   //  Allocate signals
  29.   BIT_SIGNAL(bit_seq);
  30.   FLOAT_SIGNAL(i_test_sig);
  31.   FLOAT_SIGNAL(q_test_sig);
  32.   FLOAT_SIGNAL(test_sig);
  33.   //FLOAT_SIGNAL(calib_sig);
  34.   FLOAT_SIGNAL(test_sig_2);
  35.   FLOAT_SIGNAL(delayed_test_sig);
  36.   FLOAT_SIGNAL(baseband_wave);
  37.   //============================================================
  38.   //  Construct, initialize and connect models
  39.   MultipleToneGener* sine_gen_1 = new MultipleToneGener( "sine_gen_1",
  40.                                           CommSystem,
  41.                                           test_sig );
  42.   //MultipleSineGener* sine_gen_3 = new MultipleSineGener( "sine_gen_3",
  43.   //                                        CommSystem,
  44.   //                                        calib_sig );
  45.    //RampGener* ramp_gen = new RampGener(   "ramp_gen",
  46.    //                                       CommSystem,
  47.    //                                       test_sig );
  48.   Control<bool>* delay_chg_enab = new Control<bool>( "delay_chg_enab",
  49.                                                    CommSystem );
  50.   Control<float>* dynam_float_dly = new Control<float>( "dynam_float_dly",
  51.                                                    CommSystem );
  52.   ContinuousDelayTester< float >* dyn_delay_knob = 
  53.                             new ContinuousDelayTester< float >( 
  54.                                                   "dyn_delay_knob",
  55.                                                   CommSystem,
  56.                                                   test_sig,
  57.                                                   test_sig_2,
  58.                                                   dynam_float_dly,
  59.                                                   delay_chg_enab );
  60.   
  61.   ContinuousDelay< float >* delay_2 = new ContinuousDelay< float >( 
  62.                                                 "delay_2",
  63.                                                 CommSystem,
  64.                                                 test_sig_2,
  65.                                                 delayed_test_sig,
  66.                                                 dynam_float_dly,
  67.                                                 delay_chg_enab);
  68. //  RateChanger* rate_changer = new RateChanger("rate_changer",
  69. //                                                       CommSystem,
  70. //                                                       test_sig,
  71. //                                                       baseband_wave);
  72.   SignalAnchor* temp_anchor = new SignalAnchor( "temp_anchor",
  73.                                                 CommSystem,
  74.                                                 test_sig,
  75.                                                 0.0078125, //samp_intvl
  76.                                                 4096 ); //block_size
  77. //  SignalAnchor* temp_anchor_3 = new SignalAnchor( "temp_anchor_3",
  78. //                                                CommSystem,
  79. //                                                ref_seq,
  80. //                                                1.0, //samp_rate
  81. //                                                128 ); //block_size
  82.   //=============================================================
  83.   #include "sim_postamble.cpp"
  84.   return 0;
  85. }