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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = delay_testbed_sim.cpp
  3. //
  4. #define SIM_NAME "DelayTestbed"
  5. #define SIM_TITLE "Delay Testbed"
  6. #include "global_stuff.h"
  7. //=====================
  8. // model includes
  9. #include "bitgen.h"
  10. #include "bitwav.h"
  11. #include "multi_tone_gen.h"
  12. #include "quadcmpx.h"
  13. #include "disc_delay_tester.h"
  14. #include "contin_delay_tester.h"
  15. #include "discrete_delay_T.h"
  16. #include "contin_delay_T.h"
  17. #include "contin_adv_T.h"
  18. #include "discrete_adv_T.h"
  19. #include "rate_changer.h"
  20. #include "siganchr.h"
  21. //=========================================================
  22. main()
  23. {
  24.    #include "sim_preamble.cpp"
  25.   //=========================================================================
  26.   //  Misc special processing
  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(test_sig_2);
  34.   FLOAT_SIGNAL(advanced_test_sig);
  35.   FLOAT_SIGNAL(baseband_wave);
  36.   //============================================================
  37.   //  Construct, initialize and connect models
  38.  /// EnclaveNumber = 0;
  39. //  StairGener* stair_gen = new StairGener( "stair_gen",
  40. //                                      CommSystem,
  41. //                                      test_sig );
  42.   MultipleToneGener* sine_gen_1 = new MultipleToneGener( "sine_gen_1",
  43.                                           CommSystem,
  44.                                           test_sig );
  45. //  SineGener* sine_gen_2 = new SineGener( "sine_gen_2",
  46. //                                          CommSystem,
  47. //                                          q_test_sig );
  48. //  QuadratureToComplex* iq_combiner = new QuadratureToComplex( "iq_combiner",
  49. //                                                            CommSystem,
  50. //                                                            i_test_sig,
  51. //                                                            q_test_sig,
  52. //                                                            test_sig);
  53. //  BitGener* bit_gen = new BitGener( "bit_gen",
  54. //                                      CommSystem,
  55. //                                      bit_seq );
  56. //  BitsToWave* wave_gen = new BitsToWave( "wave_gen",
  57. //                                           CommSystem,
  58. //                                           bit_seq,
  59. //                                           test_sig );
  60.   Control<bool>* delay_chg_enab = new Control<bool>( "delay_chg_enab",
  61.                                                    CommSystem );
  62. //  Control<int>* dynam_int_adv = new Control<int>( "dynam_int_adv",
  63. //                                                   CommSystem );
  64.   Control<float>* dynam_float_adv = new Control<float>( "dynam_float_adv",
  65.                                                    CommSystem );
  66. //  DiscreteDelayTester< float >* dyn_delay_knob = new DiscreteDelayTester<float>( 
  67. //                                                  "dyn_delay_knob",
  68. //                                                  CommSystem,
  69. //                                                  test_sig,
  70. //                                                  test_sig_2,
  71. //                                                  dynam_int_adv,
  72. //                                                  delay_chg_enab );
  73. //  DiscreteAdvance<float>* advance_1 = new DiscreteAdvance<float>( 
  74. //                                                  "advance_1",
  75. //                                                  CommSystem,
  76. //                                                  test_sig_2,
  77. //                                                  advanced_test_sig);
  78. //                                                  advanced_test_sig,
  79. //                                                  dynam_int_adv,
  80. //                                                  delay_chg_enab );
  81. //  Control<bool>* delay_chg_enab = new Control<bool>( "delay_chg_enab",
  82. //                                                   CommSystem );
  83. //  Control<int>* dynam_int_dly = new Control<int>( "dynam_int_dly",
  84. //                                                   CommSystem );
  85. //  DiscreteDelayTester< float >* dyn_delay_knob = new DiscreteDelayTester<float>( 
  86. //                                                  "dyn_delay_knob",
  87. //                                                  CommSystem,
  88. //                                                  test_sig,
  89. //                                                  test_sig_2,
  90. //                                                  dynam_int_dly,
  91. //                                                  delay_chg_enab );
  92.   
  93. //  DiscreteDelay< float >* delay_1 = new DiscreteDelay<float>( 
  94. //                                                "delay_1",
  95. //                                                CommSystem,
  96. //                                                test_sig_2,
  97. //                                                delayed_test_sig,
  98. //                                                dynam_int_dly,
  99. ///                                                delay_chg_enab);
  100. //  Control<float>* dynam_float_dly = new Control<float>( "dynam_float_dly",
  101. //                                                   CommSystem );
  102.   ContinuousDelayTester< float >* dyn_delay_knob = 
  103.                             new ContinuousDelayTester< float >( 
  104.                                                   "dyn_delay_knob",
  105.                                                   CommSystem,
  106.                                                   test_sig,
  107.                                                   test_sig_2,
  108.                                                   dynam_float_adv,
  109.                                                   delay_chg_enab );
  110.   
  111.   ContinuousAdvance<float>* advance_2 = new ContinuousAdvance<float>( 
  112.                                                   "advance_2",
  113.                                                   CommSystem,
  114.                                                   test_sig_2,
  115.                                                   advanced_test_sig);
  116. //  ContinuousDelay< std::complex<float> >* delay_2 = 
  117. //                              new ContinuousDelay< std::complex<float> >( 
  118. //                                                "delay_2",
  119. //                                                CommSystem,
  120. //                                                test_sig_2,
  121. //                                                delayed_test_sig,
  122. //                                                dynam_float_dly,
  123. //                                                delay_chg_enab);
  124. //  RateChanger* rate_changer = new RateChanger("rate_changer",
  125. //                                                       CommSystem,
  126. //                                                       test_sig,
  127. //                                                       baseband_wave);
  128.   SignalAnchor* temp_anchor = new SignalAnchor( "temp_anchor",
  129.                                                 CommSystem,
  130.                                                 test_sig,
  131.                                                 0.0078125, //samp_rate
  132.                                                 4096 ); //block_size
  133. //  SignalAnchor* temp_anchor_3 = new SignalAnchor( "temp_anchor_3",
  134. //                                                CommSystem,
  135. //                                                ref_seq,
  136. //                                                1.0, //samp_rate
  137. //                                                128 ); //block_size
  138.   //=============================================================
  139.   #include "sim_postamble.cpp"
  140.   return 0;
  141. }