1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Common__PeakDetector__h__
6 #define __fpa__Common__PeakDetector__h__
9 #include <fpa/fpa_export.h>
10 #include <fpa/Common/IncrementalMeanAndVariance.h>
19 * https://stackoverflow.com/questions/22583391/peak-signal-detection-in-realtime-timeseries-data
21 class FPA_EXPORT PeakDetector
24 typedef PeakDetector Self;
35 virtual ~PeakDetector( );
37 unsigned long GetKernelSize( ) const;
38 double GetThreshold( ) const;
39 double GetInfluence( ) const;
41 void SetKernelSize( unsigned long k );
42 void SetThreshold( double t );
43 void SetInfluence( double i );
45 const std::vector< double >& GetXValues( ) const;
46 const std::vector< double >& GetYValues( ) const;
47 const std::vector< double >& GetFilteredYValues( ) const;
48 const std::vector< double >& GetAverages( ) const;
49 const std::vector< double >& GetDeviations( ) const;
50 const std::vector< TPeak >& GetPeaks( ) const;
53 unsigned long GetNumberOfSamples( ) const;
54 TPeak AddValue( double x, double y );
61 std::vector< double > m_X;
62 std::vector< double > m_Y;
63 std::vector< double > m_YF;
64 std::vector< double > m_Avg;
65 std::vector< double > m_STD;
66 std::vector< TPeak > m_Peaks;
67 fpa::Common::IncrementalMeanAndVariance m_MeanAndVar;
74 #endif // __fpa__Common__PeakDetector__h__