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

3G开发

开发平台:

Visual C++

  1. //
  2. //  File = bartpdgm_sim.cpp
  3. //
  4. #define SIM_NAME "BartPdgm"
  5. #define SIM_TITLE "Bartlett Periodogram Testbed"
  6. #include "global_stuff.h" 
  7. #include "siganchr.h"
  8. #include "ar_proc_gen.h"
  9. #include "bart_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.65;
  19.    a_coeffs[2] = 0.75;
  20.    ArSpectrum *ar_spectrum = new ArSpectrum(  2,//true_ar_order,
  21.                                           a_coeffs,
  22.                                           0.125,//0.0009765625, //samp interval
  23.                                           0.3, //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.    ArProcessGenerator<float>* ar_sig_source = new ArProcessGenerator<float>( 
  35.                                                          "ar_sig_source",
  36.                                                          CommSystem,
  37.                                                          test_sig);
  38.    SignalAnchor* sig_anchr = new SignalAnchor(  "sig_anchr",
  39.                                                 CommSystem,
  40.                                                 test_sig );
  41.    BartlettPeriodogram<float>* spec_estimator = 
  42.                   new BartlettPeriodogram<float>(  "spec_estimator",
  43.                                                 CommSystem,
  44.                                                 test_sig );
  45.   //=============================================================
  46.   #include "sim_postamble.cpp"
  47.   return 0;
  48. }