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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = bartpdgm_sim.cpp
  3. //
  4. #define SIM_NAME "WelchPdgm"
  5. #define SIM_TITLE "Welch Periodogram Testbed"
  6. #include "global_stuff.h" 
  7. #include "siganchr.h"
  8. #include "sines_in_awgn.h"
  9. #include "welch_pdgm.h"
  10. #include "ar_spec.h"
  11. main()
  12. {
  13. #include "sim_preamble.cpp"
  14.   //=========================================================================
  15.   //  Misc special processing
  16.    double a_coeffs[3];
  17.    a_coeffs[0] = 1.0;
  18.    a_coeffs[1] = -0.6;
  19.    a_coeffs[2] = 0.8;
  20.    ArSpectrum *ar_spectrum = new ArSpectrum(  2,//true_ar_order,
  21.                                           a_coeffs,
  22.                                           0.0625,//0.0009765625, //samp interval
  23.                                           0.32, //true_ar_drv_var );
  24.                                           512,
  25.                                           0.5);
  26.    ar_spectrum->DumpSpectrum( "ar_true_spec.txt",
  27.                               true);
  28.   //=========================================================================
  29.   //  Allocate signals
  30.   FLOAT_SIGNAL(test_sig);
  31.   //============================================================
  32.   //  Construct, initialize and connect models
  33.   
  34.    SinesInAwgn* sig_source = new SinesInAwgn( "sig_source",
  35.                                                 CommSystem,
  36.                                                 test_sig );
  37.    SignalAnchor* sig_anchr = new SignalAnchor(  "sig_anchr",
  38.                                                 CommSystem,
  39.                                                 test_sig );
  40.    WelchPeriodogram<float>* spec_analyzer = 
  41.                   new WelchPeriodogram<float>(  "spec_estimator",
  42.                                                 CommSystem,
  43.                                                 test_sig );
  44.   //=============================================================
  45.   #include "sim_postamble.cpp"
  46.   return 0;
  47. }