Advertisement
Nuke29

sta_lta_detector.h

Oct 3rd, 2022
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.42 KB | Source Code | 0 0
  1. #ifndef INC_STA_LTA_DETECTOR_H_
  2. #define INC_STA_LTA_DETECTOR_H_
  3.  
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7.  
  8. #include "tech_channel.h"
  9.  
  10. class STA_LTA_Detector : public Tech_Channel {
  11. public:
  12.     STA_LTA_Detector(const STA_LTA_Detector& rhs) = delete;
  13.     STA_LTA_Detector(STA_LTA_Detector&& rhs) = delete;
  14.     STA_LTA_Detector& operator =(const STA_LTA_Detector& rhs) = delete;
  15.     STA_LTA_Detector& operator =(STA_LTA_Detector&& rhs) = delete;
  16.  
  17.     STA_LTA_Detector(int adc_freq, int adc_ch_mask);
  18.  
  19.     virtual void push_to_calc(int64_t data1_, int64_t data2_, int64_t data3_) override;
  20.     virtual const int get_triggered() const override;
  21.     virtual const int get_trigglvl() const override;
  22.     void show_triggered();
  23.  
  24.  
  25. private:
  26.     void calc_trigger();
  27.  
  28.     static constexpr int sta_factor = 3;
  29.     static constexpr int lta_factor = 7;
  30.  
  31.     static constexpr int trigg_lvl = 45;
  32.     const int top_freq = 5;
  33.     const int estimate_denominator = 100;
  34.  
  35.     bool is_filled;
  36.  
  37.     size_t position;
  38.     size_t sta_length;
  39.     size_t lta_length;
  40.     int num_of_adcs;
  41.  
  42.     int64_t sta_accumulator;
  43.     int64_t lta_accumulator;
  44.     int trigg_fraction;
  45.     int trigg_to_show;
  46.  
  47.     int sta_to_lta[2];
  48.     int cur_pos = 1;
  49.     int prev_pos = 0;
  50. };
  51.  
  52. inline
  53. const int STA_LTA_Detector::get_triggered() const {
  54.     return trigg_to_show;
  55. }
  56.  
  57. inline
  58. const int STA_LTA_Detector::get_trigglvl() const {
  59.     return trigg_lvl;
  60. }
  61.  
  62. #ifdef __cplusplus
  63. }
  64. #endif
  65.  
  66. #endif /* INC_STA_LTA_DETECTOR_H_ */
  67.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement