GNU Radio's IRIDIUM Package
fft_burst_tagger_impl.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2020 Free Software Foundation, Inc.
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef INCLUDED_IRIDIUM_FFT_BURST_TAGGER_IMPL_H
22#define INCLUDED_IRIDIUM_FFT_BURST_TAGGER_IMPL_H
23
24#include <gnuradio/fft/fft.h>
26
27namespace gr {
28namespace iridium {
29
30struct burst {
31 uint64_t start;
32 uint64_t stop;
33 uint64_t last_active;
35 float magnitude;
36 float noise;
37 uint64_t id;
38};
39
40struct peak {
41 int bin;
43};
44
46{
47private:
48 bool d_history_primed;
49 bool d_debug;
50 bool d_offline;
51
52 int d_fft_size;
53 int d_burst_pre_len;
54 int d_history_size;
55 int d_burst_width;
56 int d_history_index;
57 int d_burst_post_len;
58 int d_max_bursts;
59 int d_max_burst_len;
60 int d_sample_rate;
61 int d_squelch_count;
62 uint64_t d_index;
63 uint64_t d_burst_id;
64 uint64_t d_n_tagged_bursts;
65 uint64_t d_sample_count;
66 uint64_t d_last_rx_time_offset;
67 uint64_t d_last_rx_time_timestamp;
68
69 float* d_window_f;
70 float* d_magnitude_shifted_f;
71 float* d_baseline_sum_f;
72 float* d_baseline_history_f;
73 float* d_relative_magnitude_f;
74 float* d_burst_mask_f;
75 float* d_ones_f;
76 float d_threshold;
77 double d_center_frequency;
78 float d_window_enbw;
79
80 FILE* d_burst_debug_file;
81
82 gr::fft::fft_complex_fwd* d_fft;
83 std::vector<peak> d_peaks;
84 std::vector<burst> d_bursts;
85 std::vector<burst> d_new_bursts;
86 std::vector<burst> d_gone_bursts;
87
88 bool update_filters_pre(void);
89 void update_filters_post(bool force);
90 void extract_peaks(void);
91 void save_peaks_to_debug_file(char* filename);
92 void remove_peaks_around_bursts(void);
93 void update_burst_mask(void);
94 void update_bursts(void);
95 void delete_gone_bursts(void);
96 void create_new_bursts(void);
97 void mask_burst(burst& b);
98 void tag_new_bursts(void);
99 void tag_gone_bursts(int noutput_items);
100
101public:
102 fft_burst_tagger_impl(double center_frequency,
103 int fft_size,
104 int sample_rate,
105 int burst_pre_len,
106 int burst_post_len,
107 int burst_width,
108 int max_bursts,
109 int max_burst_len,
110 float threshold,
111 int history_size,
112 bool offline,
113 bool debug);
115
118
119 int work(int noutput_items,
120 gr_vector_const_void_star& input_items,
121 gr_vector_void_star& output_items);
122};
123
124} // namespace iridium
125} // namespace gr
126
127#endif /* INCLUDED_IRIDIUM_FFT_BURST_TAGGER_IMPL_H */
fft_burst_tagger_impl(double center_frequency, int fft_size, int sample_rate, int burst_pre_len, int burst_post_len, int burst_width, int max_bursts, int max_burst_len, float threshold, int history_size, bool offline, bool debug)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
<+description of block+>
Definition fft_burst_tagger.h:36
Definition burst_downmix.h:28
Definition burst_downmix.h:27
Definition fft_burst_tagger_impl.h:30
uint64_t last_active
Definition fft_burst_tagger_impl.h:33
uint64_t stop
Definition fft_burst_tagger_impl.h:32
uint64_t start
Definition fft_burst_tagger_impl.h:31
float magnitude
Definition fft_burst_tagger_impl.h:35
int center_bin
Definition fft_burst_tagger_impl.h:34
float noise
Definition fft_burst_tagger_impl.h:36
uint64_t id
Definition fft_burst_tagger_impl.h:37
Definition fft_burst_tagger_impl.h:40
int bin
Definition fft_burst_tagger_impl.h:41
float relative_magnitude
Definition fft_burst_tagger_impl.h:42