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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = binsymchan_sim.cpp
  3. //
  4. #define SIM_NAME "BinSymChan"
  5. #define SIM_TITLE "Binary Symmetric Channel Testbed"
  6. #include "global_stuff.h"
  7. //=====================
  8. // model includes
  9. #include "bitgen.h"
  10. #include "siganchr.h"
  11. #include "bscerrorgen.h"
  12. #include "ber_ctr.h"
  13. //=========================================================
  14. main()
  15. {
  16.    #include "sim_preamble.cpp"
  17.   //=========================================================================
  18.   //  Misc special processing
  19.   //=========================================================================
  20.   //  Allocate signals
  21.   BIT_SIGNAL(bit_seq);
  22.   BIT_SIGNAL(corrupt_seq);
  23.   //============================================================
  24.   //  Construct, initialize and connect models
  25.    BitGener* bit_gen = new BitGener( "bit_gen",
  26.                                       CommSystem,
  27.                                       bit_seq );
  28.   
  29.    SignalAnchor* bit_seq_anchr = new SignalAnchor( "bit_seq_anchr",
  30.                                                    CommSystem,
  31.                                                    bit_seq );
  32.    BscErrorGener* err_gen = new BscErrorGener( "err_gen",
  33.                                               CommSystem,
  34.                                               bit_seq,
  35.                                               corrupt_seq );
  36.   
  37.   BerCounter* ber_ctr = new BerCounter( "ber_ctr",
  38.                                         CommSystem,
  39.                                         bit_seq,
  40.                                         corrupt_seq );
  41.   //=============================================================
  42.   #include "sim_postamble.cpp"
  43.   return 0;
  44. }