21 #ifndef INCLUDED_INSPECTOR_SIGNAL_DETECTOR_CVF_IMPL_H 22 #define INCLUDED_INSPECTOR_SIGNAL_DETECTOR_CVF_IMPL_H 24 #include <gnuradio/fft/fft.h> 25 #include <gnuradio/filter/firdes.h> 26 #include <gnuradio/filter/single_pole_iir.h> 36 bool d_auto_threshold;
38 unsigned int d_tmpbuflen;
39 float d_threshold, d_sensitivity, d_average, d_quantization, d_min_bw;
40 float *d_pxx, *d_tmp_pxx, *d_pxx_out, *d_tmpbuf;
42 std::ofstream logfile;
44 std::vector<filter::single_pole_iir<float, float, double>> d_avg_filter;
45 filter::firdes::win_type d_window_type;
46 std::vector<float> d_window;
47 std::vector<std::vector<float>> d_signal_edges;
48 fft::fft_complex* d_fft;
49 std::vector<float> d_freq;
50 const char* d_filename;
52 void write_logfile_header();
53 void write_logfile_entry();
65 const char* filename);
82 void periodogram(
float* pxx,
const gr_complex* signal);
84 int work(
int noutput_items,
85 gr_vector_const_void_star& input_items,
86 gr_vector_void_star& output_items);
90 signal_detector_cvf_impl::d_samp_rate = d_samp_rate;
98 signal_detector_cvf_impl::d_threshold = d_threshold;
103 signal_detector_cvf_impl::d_sensitivity = d_sensitivity;
108 signal_detector_cvf_impl::d_auto_threshold = d_auto_threshold;
113 signal_detector_cvf_impl::d_average = d_average;
114 for (
unsigned int i = 0; i < d_fft_len; i++) {
115 d_avg_filter[i].set_taps(d_average);
121 signal_detector_cvf_impl::d_quantization = d_quantization;
signal_detector_cvf_impl(double samp_rate, int fft_len, int window_type, float threshold, float sensitivity, bool auto_threshold, float average, float quantization, float min_bw, const char *filename)
void set_auto_threshold(bool d_auto_threshold)
Definition: signal_detector_cvf_impl.h:106
void set_threshold(float d_threshold)
Definition: signal_detector_cvf_impl.h:96
pmt::pmt_t pack_message()
void set_fft_len(int fft_len)
bool compare_signal_edges(std::vector< std::vector< float >> *edges)
std::vector< float > build_freq()
void set_window_type(int d_window)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
std::vector< std::vector< unsigned int > > find_signal_edges()
Definition: signal_detector_cvf_impl.h:33
Definition: inspector_form.h:40
void set_sensitivity(float d_sensitivity)
Definition: signal_detector_cvf_impl.h:101
~signal_detector_cvf_impl()
void periodogram(float *pxx, const gr_complex *signal)
void set_samp_rate(double d_samp_rate)
Definition: signal_detector_cvf_impl.h:88
Signal detection block using energy detection.
Definition: signal_detector_cvf.h:60
void set_average(float d_average)
Definition: signal_detector_cvf_impl.h:111
void set_quantization(float d_quantization)
Definition: signal_detector_cvf_impl.h:119