Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef INC_STA_LTA_DETECTOR_H_
- #define INC_STA_LTA_DETECTOR_H_
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "tech_channel.h"
- class STA_LTA_Detector : public Tech_Channel {
- public:
- STA_LTA_Detector(const STA_LTA_Detector& rhs) = delete;
- STA_LTA_Detector(STA_LTA_Detector&& rhs) = delete;
- STA_LTA_Detector& operator =(const STA_LTA_Detector& rhs) = delete;
- STA_LTA_Detector& operator =(STA_LTA_Detector&& rhs) = delete;
- STA_LTA_Detector(int adc_freq, int adc_ch_mask);
- virtual void push_to_calc(int64_t data1_, int64_t data2_, int64_t data3_) override;
- virtual const int get_triggered() const override;
- virtual const int get_trigglvl() const override;
- void show_triggered();
- private:
- void calc_trigger();
- static constexpr int sta_factor = 3;
- static constexpr int lta_factor = 7;
- static constexpr int trigg_lvl = 45;
- const int top_freq = 5;
- const int estimate_denominator = 100;
- bool is_filled;
- size_t position;
- size_t sta_length;
- size_t lta_length;
- int num_of_adcs;
- int64_t sta_accumulator;
- int64_t lta_accumulator;
- int trigg_fraction;
- int trigg_to_show;
- int sta_to_lta[2];
- int cur_pos = 1;
- int prev_pos = 0;
- };
- inline
- const int STA_LTA_Detector::get_triggered() const {
- return trigg_to_show;
- }
- inline
- const int STA_LTA_Detector::get_trigglvl() const {
- return trigg_lvl;
- }
- #ifdef __cplusplus
- }
- #endif
- #endif /* INC_STA_LTA_DETECTOR_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement