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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = contindelay_sim.cpp
  3. //
  4. #define SIM_NAME "RateChange"
  5. #define SIM_TITLE "Rate Change Testbed"
  6. #include "global_stuff.h"
  7. //=====================
  8. // model includes
  9. #include "sinc_wave.h"
  10. #include "bitgen.h"
  11. #include "basewav.h"
  12. #include "butt_filt_iir.h"
  13. //#include "bitwav.h"
  14. #include "multi_tone_gen.h"
  15. #include "ramp_gen.h"
  16. #include "contin_delay_tester.h"
  17. #include "rate_changer_T.h"
  18. #include "dft_delay_T.h"
  19. #include "siganchr.h"
  20. //=========================================================
  21. main()
  22. {
  23.    #include "sim_preamble.cpp"
  24.   //=========================================================================
  25.   //  Misc special processing
  26.    SincWaveform(  4, //num_sidelobes
  27.                  50, //samps_per_hump
  28.                  "sinc_wave.txt");//out_filename
  29.   //=========================================================================
  30.   //  Allocate signals
  31.   BIT_SIGNAL(bit_seq);
  32.   BIT_SIGNAL(bit_clock);
  33.   FLOAT_SIGNAL(binary_wave);
  34.   FLOAT_SIGNAL(filt_wave);
  35.   FLOAT_SIGNAL(test_sig);
  36.   //FLOAT_SIGNAL(calib_sig);
  37.   FLOAT_SIGNAL(test_sig_2);
  38.   FLOAT_SIGNAL(delayed_test_sig);
  39.   FLOAT_SIGNAL(baseband_wave);
  40.   //============================================================
  41.   //  Construct, initialize and connect models
  42.   //MultipleSineGener* sine_gen_1 = new MultipleSineGener( "sine_gen_1",
  43.   //                                        CommSystem,
  44.   //                                        filt_wave );
  45.   //MultipleSineGener* sine_gen_3 = new MultipleSineGener( "sine_gen_3",
  46.   //                                        CommSystem,
  47.   //                                        calib_sig );
  48.    //RampGener* ramp_gen = new RampGener(   "ramp_gen",
  49.    //                                       CommSystem,
  50.    //                                       test_sig );
  51.    BitGener* bit_gen = new BitGener( "bit_gen",
  52.                                       CommSystem,
  53.                                       bit_seq );
  54.   
  55.    SignalAnchor* bit_seq_anchr = new SignalAnchor( "bit_seq_anchr",
  56.                                                    CommSystem,
  57.                                                    bit_seq );
  58.    BasebandWaveform* baseband_gen = new BasebandWaveform(   "baseband_gen",
  59.                                                 CommSystem,
  60.                                                 bit_seq,
  61.                                                 binary_wave,
  62.                                                 bit_clock );
  63.   ButterworthFilterByIir<float>* base_filt = new ButterworthFilterByIir<float>( "base_filt",
  64.                                                         CommSystem,
  65.                                                         binary_wave,
  66.                                                         filt_wave);
  67. //  Control<bool>* delay_chg_enab = new Control<bool>( "delay_chg_enab",
  68. //                                                   CommSystem );
  69. //  Control<float>* dynam_float_dly = new Control<float>( "dynam_float_dly",
  70. //                                                   CommSystem );
  71. //  ContinuousDelayTester< float >* dyn_delay_knob = 
  72. //                            new ContinuousDelayTester< float >( 
  73. //                                                  "dyn_delay_knob",
  74. //                                                  CommSystem,
  75. //                                                  filt_wave,
  76. //                                                  test_sig_2,
  77. //                                                  dynam_float_dly,
  78. //                                                  delay_chg_enab );
  79.   
  80.   RateChanger< float >* rate_changer = new RateChanger< float >( 
  81.                                                 "rate_changer",
  82.                                                 CommSystem,
  83.                                                 filt_wave,
  84.                                                 delayed_test_sig);//,
  85.                                                 //dynam_float_dly,
  86.                                                 //delay_chg_enab);
  87. //  RateChanger* rate_changer = new RateChanger("rate_changer",
  88. //                                                       CommSystem,
  89. //                                                       test_sig,
  90. //                                                       baseband_wave);
  91. //  SignalAnchor* temp_anchor = new SignalAnchor( "temp_anchor",
  92. //                                                CommSystem,
  93. //                                                filt_wave,
  94. //                                                0.0078125, //samp_intvl
  95. //                                                4096 ); //block_size
  96. //  SignalAnchor* temp_anchor_3 = new SignalAnchor( "temp_anchor_3",
  97. //                                                CommSystem,
  98. //                                                ref_seq,
  99. //                                                1.0, //samp_rate
  100. //                                                128 ); //block_size
  101.   //=============================================================
  102.   #include "sim_postamble.cpp"
  103.   return 0;
  104. }