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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = basewavetest_sim.cpp
  3. //
  4. #define SIM_NAME "BaseWaveTest"
  5. #define SIM_TITLE "Baseband Waveform Testbed"
  6. #include "global_stuff.h" 
  7. #include "rect_pulse_theory.h"
  8. #include "bitgen.h"
  9. #include "nrz_theory.h"
  10. #include "basewav.h"
  11. #include "siganchr.h"
  12. #include "spec_analyzer.h"
  13. main()
  14. {
  15. #include "sim_preamble.cpp"
  16.   //=========================================================================
  17.   //  Misc special processing
  18.   RectPulseAliasPower( 64.0,
  19.                        100,
  20.                        "rect_pulse_pwr.txt");
  21.    NrzPsd(  1.0, // bit energy
  22.             1.0, // bit_rate,
  23.             0.0, // beg_freq,
  24.             4.0, // end_freq,
  25.             401, // num_pts,
  26.             true, //plot_in_db,
  27.             "nrz_psd_theor.txt");
  28.    BiphasePsd(  1.0, // bit energy
  29.                   1.0, // bit_rate,
  30.                   0.0, // beg_freq,
  31.                   4.0, // end_freq,
  32.                   401, // num_pts,
  33.                   true, //plot_in_db,
  34.                   "biphase_psd_theor.txt");
  35.    MillerPsd(  1.0, // bit energy
  36.                   1.0, // bit_rate,
  37.                   0.0, // beg_freq,
  38.                   4.0, // end_freq,
  39.                   401, // num_pts,
  40.                   true, //plot_in_db,
  41.                   "miller_psd_theor.txt");
  42.   //=========================================================================
  43.   //  Allocate signals
  44.   BIT_SIGNAL(bit_seq);
  45.   FLOAT_SIGNAL(binary_wave);
  46.   BIT_SIGNAL(bit_clock);
  47.   //============================================================
  48.   //  Construct, initialize and connect models
  49.    BitGener* bit_gen = new BitGener( "bit_gen",
  50.                                       CommSystem,
  51.                                       bit_seq );
  52.     
  53.    SignalAnchor* bit_seq_anchr = new SignalAnchor( "bit_seq_anchr",
  54.                                                    CommSystem,
  55.                                                    bit_seq );
  56.    BasebandWaveform* baseband_gen = new BasebandWaveform(   "baseband_gen",
  57.                                                 CommSystem,
  58.                                                 bit_seq,
  59.                                                 binary_wave,
  60.                                                 bit_clock );
  61.    SpectrumAnalyzer<float>* spec_analyzer = 
  62.                   new SpectrumAnalyzer<float>(  "spec_analyzer",
  63.                                                 CommSystem,
  64.                                                 binary_wave );
  65.   //=============================================================
  66.   #include "sim_postamble.cpp"
  67.   return 0;
  68. }