00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MARSYAS_AIMLOCALMAX_H
00020 #define MARSYAS_AIMLOCALMAX_H
00021
00022 #include "MarSystem.h"
00023
00024
00025
00026
00027 #include <vector>
00028
00029 namespace Marsyas
00030 {
00046 class marsyas_EXPORT AimLocalMax: public MarSystem
00047 {
00048 private:
00049 void myUpdate(MarControlPtr sender);
00050
00051
00052 void ResetInternal();
00053
00054
00055 bool InitializeInternal();
00056
00057
00058 bool is_initialized;
00059
00060
00061 mrs_real initialized_israte;
00062
00063
00064 bool is_reset;
00065
00066
00067 mrs_natural reset_inobservations;
00068
00069 MarControlPtr ctrl_decay_time_ms_;
00070 MarControlPtr ctrl_timeout_ms_;
00071
00072 int strobe_timeout_samples_;
00073 int strobe_decay_samples_;
00074
00075 std::vector<double> threshold_;
00076 std::vector<double> decay_constant_;
00077
00078 std::vector<double> prev_sample_;
00079 std::vector<double> curr_sample_;
00080 std::vector<double> next_sample_;
00081
00082 std::vector<double> strobe_count_;
00083 std::vector<int> last_strobe_;
00084
00085
00086
00087
00088
00089 mrs_natural channel_count_;
00090
00091 public:
00092 AimLocalMax(std::string name);
00093 AimLocalMax(const AimLocalMax& a);
00094
00095 ~AimLocalMax();
00096 MarSystem* clone() const;
00097 void addControls();
00098
00099 void myProcess(realvec& in, realvec& out);
00100 };
00101
00102 }
00103
00104 #endif