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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = disc_delay_sim.cpp
  3. //
  4. #define SIM_NAME "DiscDelay"
  5. #define SIM_TITLE "Discrete Delay Testbed"
  6. #include "global_stuff.h"
  7. //=====================
  8. // model includes
  9. #include "bitgen.h"
  10. #include "bitwav.h"
  11. #include "disc_delay_tester.h"
  12. #include "discrete_delay_T.h"
  13. #include "siganchr.h"
  14. //=========================================================
  15. main()
  16. {
  17.    #include "sim_preamble.cpp"
  18.   //=========================================================================
  19.   //  Misc special processing
  20.   //=========================================================================
  21.   //  Allocate signals
  22.   BIT_SIGNAL(bit_seq);
  23.   BIT_SIGNAL(bit_clock);
  24.   FLOAT_SIGNAL(test_sig);
  25.   FLOAT_SIGNAL(test_sig_2);
  26.   FLOAT_SIGNAL(delayed_test_sig);
  27.   FLOAT_SIGNAL(baseband_wave);
  28.   //============================================================
  29.   //  Construct, initialize and connect models
  30.   BitGener* bit_gen = new BitGener( "bit_gen",
  31.                                       CommSystem,
  32.                                       bit_seq );
  33.   BitsToWave* wave_gen = new BitsToWave( "wave_gen",
  34.                                            CommSystem,
  35.                                            bit_seq,
  36.                                            test_sig,
  37.                                            bit_clock );
  38.   Control<bool>* delay_chg_enab = new Control<bool>( "delay_chg_enab",
  39.                                                    CommSystem );
  40.   Control<int>* dynam_int_dly = new Control<int>( "dynam_int_dly",
  41.                                                    CommSystem );
  42.   DiscreteDelayTester< float >* dyn_delay_knob = new DiscreteDelayTester<float>( 
  43.                                                   "dyn_delay_knob",
  44.                                                   CommSystem,
  45.                                                   test_sig,
  46.                                                   test_sig_2,
  47.                                                   dynam_int_dly,
  48.                                                   delay_chg_enab );
  49.   
  50.   DiscreteDelay< float >* delay_1 = new DiscreteDelay<float>( 
  51.                                                 "delay_1",
  52.                                                 CommSystem,
  53.                                                 test_sig_2,
  54.                                                 delayed_test_sig,
  55.                                                 dynam_int_dly,
  56.                                                 delay_chg_enab);
  57.   SignalAnchor* temp_anchor = new SignalAnchor( "temp_anchor",
  58.                                                 CommSystem,
  59.                                                 test_sig,
  60.                                                 0.125, //samp_rate
  61.                                                 4096 ); //block_size
  62. //  SignalAnchor* temp_anchor_3 = new SignalAnchor( "temp_anchor_3",
  63. //                                                CommSystem,
  64. //                                                ref_seq,
  65. //                                                1.0, //samp_rate
  66. //                                                128 ); //block_size
  67.   //=============================================================
  68.   #include "sim_postamble.cpp"
  69.   return 0;
  70. }