00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MARSYAS_HWPS_H
00020 #define MARSYAS_HWPS_H
00021
00022 #include "MarSystem.h"
00023
00024 namespace Marsyas
00025 {
00036 class HWPS: public MarSystem
00037 {
00038 private:
00039
00040
00041
00042 enum pkFields {
00043 pkFreqIdx = 0,
00044 frameNumPeaksIdx = 1,
00045 pkSetFeatsIdx = 2
00046 };
00047 realvec vec_i_;
00048 realvec vec_j_;
00049
00050 mrs_real pk_i_freq_;
00051 mrs_real pk_j_freq_;
00052
00053 mrs_natural i_frameNumPeaks_;
00054 mrs_natural j_frameNumPeaks_;
00055
00056 realvec pkSet_i_Freqs_;
00057 realvec pkSet_j_Freqs_;
00058
00059 realvec pkSet_i_WrapFreqs_;
00060 realvec pkSet_j_WrapFreqs_;
00061
00062 realvec pkSet_i_Amps_;
00063 realvec pkSet_j_Amps_;
00064
00065 realvec histogram_i_;
00066 realvec histogram_j_;
00067
00068 MarControlPtr ctrl_calcDistance_;
00069 MarControlPtr ctrl_histSize_;
00070 mrs_natural histSize_;
00071
00072 void harmonicWrap(mrs_real peak1Freq, mrs_real peak2Freq,
00073 realvec& peak1SetFreqs, realvec& peak2SetFreqs);
00074 void discretize(const realvec& peakSetWarpFreqs, const realvec& peakAmps,
00075 const mrs_natural& histSize, realvec& resultHistogram);
00076
00077 void addControls();
00078 void myUpdate(MarControlPtr sender);
00079
00080 public:
00081 HWPS(std::string name);
00082 HWPS(const HWPS& a);
00083 ~HWPS();
00084 MarSystem* clone() const;
00085
00086 void myProcess(realvec& in, realvec& out);
00087 };
00088
00089 }
00090
00091 #endif
00092
00093
00094