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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = gaussnoisetest_sim.cpp
  3. //
  4. #define SIM_NAME "GaussNoiseTest"
  5. #define SIM_TITLE "Gaussian Noise Testbed"
  6. #include "global_stuff.h" 
  7. #include "gauss_theory.h"
  8. #include "level_gen.h"
  9. #include "histogram.h"
  10. #include "ogive.h"
  11. #include "siganchr.h"
  12. #include "add_gaus_noise.h"
  13. main()
  14. {
  15. #include "sim_preamble.cpp"
  16.   //=========================================================================
  17.   //  Misc special processing
  18.    GaussPdf(   0.0,//mean
  19.                0.5,//standard deviation
  20.                401,// num pts
  21.                50, // pts per s.d.
  22.                "gauss_pdf.txt");
  23.    GaussCdf(   0.0,//mean
  24.                0.5002249,//standard deviation
  25.                400,// num pts
  26.                50, // pts per s.d.
  27.                "gauss_cdf.txt");
  28.   //=========================================================================
  29.   //  Allocate signals
  30.   FLOAT_SIGNAL(flat_line_sig);
  31.   FLOAT_SIGNAL(noisy_sig);
  32.   FLOAT_SIGNAL(power_meas_sig);
  33.   //============================================================
  34.   //  Construct, initialize and connect models
  35.   
  36.    LevelGener* lev_gen = new LevelGener(  "lev_gen",
  37.                                           CommSystem,
  38.                                           flat_line_sig );
  39.    SignalAnchor* flat_line_anchr = new SignalAnchor( "flat_line_anchr",
  40.                                                    CommSystem,
  41.                                                    flat_line_sig );
  42.    AdditiveGaussianNoise<float>* awgn_source = new AdditiveGaussianNoise<float>( 
  43.                                                 "awgn_source",
  44.                                                 CommSystem,
  45.                                                 flat_line_sig,
  46.                                                 noisy_sig,
  47.                                                 power_meas_sig);
  48. //   DiscreteAutoCovar* disc_autocovar = new DiscreteAutoCovar( "disc_autocovar",
  49. //                                CommSystem,
  50. //                                bit_seq);
  51.    HistogramBuilder<float>* histogram = new HistogramBuilder<float>(   "histogram",
  52.                                                          CommSystem,
  53.                                                          noisy_sig);
  54.    OgiveBuilder<float>* ogive = new OgiveBuilder<float>(   "ogive",
  55.                                                          CommSystem,
  56.                                                          noisy_sig);
  57.   //=============================================================
  58.   #include "sim_postamble.cpp"
  59.   return 0;
  60. }