GNU Radio's IRIDIUM_TOOLKIT Package: fft_burst_tagger_impl.h Source File

GNU Radio's IRIDIUM_TOOLKIT Package

fft_burst_tagger_impl.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2016 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_TOOLKIT_FFT_BURST_TAGGER_IMPL_H
22#define INCLUDED_IRIDIUM_TOOLKIT_FFT_BURST_TAGGER_IMPL_H
23
24#include <iridium/fft_burst_tagger.h>
25#include <gnuradio/fft/fft.h>
26
27namespace gr {
28 namespace iridium {
29
30 struct burst {
31 uint64_t start;
32 uint64_t stop;
33 uint64_t last_active;
34 int center_bin;
35 float magnitude;
36 uint64_t id;
37 };
38
39 struct peak {
40 int bin;
41 float relative_magnitude;
42 };
43
44 class fft_burst_tagger_impl : public fft_burst_tagger
45 {
46 private:
47 bool d_history_primed;
48 bool d_debug;
49
50 int d_fft_size;
51 int d_burst_pre_len;
52 int d_history_size;
53 int d_burst_width;
54 int d_history_index;
55 int d_burst_post_len;
56 int d_max_bursts;
57 int d_sample_rate;
58 uint64_t d_index;
59 uint64_t d_burst_id;
60 uint64_t d_n_tagged_bursts;
61
62 float * d_window_f;
63 float * d_magnitude_f;
64 float * d_magnitude_shifted_f;
65 float * d_baseline_sum_f;
66 float * d_baseline_history_f;
67 float * d_relative_magnitude_f;
68 float * d_burst_mask_f;
69 float * d_ones_f;
70 float d_threshold;
71 float d_center_frequency;
72
73 FILE * d_burst_debug_file;
74
75 gr::fft::fft_complex *d_fft;
76 std::vector<peak> d_peaks;
77 std::vector<burst> d_bursts;
78 std::vector<burst> d_new_bursts;
79 std::vector<burst> d_gone_bursts;
80
81 bool update_filters_pre(void);
82 void update_filters_post(void);
83 void extract_peaks(void);
84 void save_peaks_to_debug_file(char * filename);
85 void remove_peaks_around_bursts(void);
86 void update_burst_mask(void);
87 void update_bursts(void);
88 void delete_gone_bursts(void);
89 void create_new_bursts(void);
90 void mask_burst(burst &b);
91 void tag_new_bursts(void);
92 void tag_gone_bursts(int noutput_items);
93
94 public:
95 fft_burst_tagger_impl(float center_frequency, int fft_size, int sample_rate,
96 int burst_pre_len, int burst_post_len, int burst_width,
97 int max_bursts, float threshold, int history_size, bool debug);
98 ~fft_burst_tagger_impl();
99
100 uint64_t get_n_tagged_bursts();
101
102 int work(int noutput_items,
103 gr_vector_const_void_star &input_items,
104 gr_vector_void_star &output_items);
105 };
106
107 } // namespace iridium
108} // namespace gr
109
110#endif /* INCLUDED_IRIDIUM_TOOLKIT_FFT_BURST_TAGGER_IMPL_H */
111
gr::iridium::fft_burst_tagger_impl
Definition: fft_burst_tagger_impl.h:45
gr::iridium::fft_burst_tagger_impl::get_n_tagged_bursts
uint64_t get_n_tagged_bursts()
gr::iridium::fft_burst_tagger_impl::work
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
gr::iridium::fft_burst_tagger_impl::~fft_burst_tagger_impl
~fft_burst_tagger_impl()
gr::iridium::fft_burst_tagger_impl::fft_burst_tagger_impl
fft_burst_tagger_impl(float center_frequency, int fft_size, int sample_rate, int burst_pre_len, int burst_post_len, int burst_width, int max_bursts, float threshold, int history_size, bool debug)
gr::iridium::fft_burst_tagger
<+description of block+>
Definition: fft_burst_tagger.h:37
fft_burst_tagger.h
gr
Definition: burst_downmix.h:28
iridium
Definition: iridium.h:2
gr::iridium::burst
Definition: fft_burst_tagger_impl.h:30
gr::iridium::burst::last_active
uint64_t last_active
Definition: fft_burst_tagger_impl.h:33
gr::iridium::burst::stop
uint64_t stop
Definition: fft_burst_tagger_impl.h:32
gr::iridium::burst::start
uint64_t start
Definition: fft_burst_tagger_impl.h:31
gr::iridium::burst::magnitude
float magnitude
Definition: fft_burst_tagger_impl.h:35
gr::iridium::burst::center_bin
int center_bin
Definition: fft_burst_tagger_impl.h:34
gr::iridium::burst::id
uint64_t id
Definition: fft_burst_tagger_impl.h:36
gr::iridium::peak
Definition: fft_burst_tagger_impl.h:39
gr::iridium::peak::bin
int bin
Definition: fft_burst_tagger_impl.h:40
gr::iridium::peak::relative_magnitude
float relative_magnitude
Definition: fft_burst_tagger_impl.h:41