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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = arproctest_sim.cpp
  3. //
  4. #define SIM_NAME "ArProcTest"
  5. #define SIM_TITLE "Autoregressive Noise Testbed"
  6. #include "global_stuff.h" 
  7. #include "rayleigh_theory.h"
  8. #include "level_gen.h"
  9. #include "disc_auto_cov.h"
  10. #include "histogram.h"
  11. #include "ogive.h"
  12. #include "siganchr.h"
  13. #include "ar_proc_gen.h"
  14. #include "spec_analyzer.h"
  15. #include "ar_spec.h"
  16. main()
  17. {
  18. #include "sim_preamble.cpp"
  19.   //=========================================================================
  20.   //  Misc special processing
  21.    double a_coeffs[3];
  22.    a_coeffs[0] = 1.0;
  23.    a_coeffs[1] = -0.6;
  24.    a_coeffs[2] = 0.8;
  25.    ArSpectrum *ar_spectrum = new ArSpectrum(  2,//true_ar_order,
  26.                                           a_coeffs,
  27.                                           0.0009765625,
  28.                                           0.32,
  29.                                           512,
  30.                                           0.5);//true_ar_drv_var );
  31.    ar_spectrum->DumpSpectrum( "ar_true_spec.txt",
  32.                               true);
  33.   //=========================================================================
  34.   //  Allocate signals
  35.   FLOAT_SIGNAL(noisy_sig);
  36.   //============================================================
  37.   //  Construct, initialize and connect models
  38.   
  39.    ArProcessGenerator<float>* noise_source = new ArProcessGenerator<float>( 
  40.                                                          "noise_source",
  41.                                                          CommSystem,
  42.                                                          noisy_sig);
  43.    SignalAnchor* sig_anchr = new SignalAnchor(  "sig_anchr",
  44.                                                 CommSystem,
  45.                                                 noisy_sig );
  46. //   DiscreteAutoCovar* disc_autocovar = new DiscreteAutoCovar( "disc_autocovar",
  47. //                                CommSystem,
  48. //                                bit_seq);
  49.    HistogramBuilder<float>* histogram = new HistogramBuilder<float>(   "histogram",
  50.                                                          CommSystem,
  51.                                                          noisy_sig);
  52. //   OgiveBuilder<float>* ogive = new OgiveBuilder<float>(   "ogive",
  53. //                                                         CommSystem,
  54. //                                                         noisy_sig);
  55.    SpectrumAnalyzer<float>* spec_analyzer = 
  56.                   new SpectrumAnalyzer<float>(  "spec_analyzer",
  57.                                                 CommSystem,
  58.                                                 noisy_sig );
  59.   //=============================================================
  60.   #include "sim_postamble.cpp"
  61.   return 0;
  62. }