The Inspector (GNU Radio module gr-inspector)
signal_separator_c.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2019 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_INSPECTOR_SIGNAL_SEPARATOR_C_H
22 #define INCLUDED_INSPECTOR_SIGNAL_SEPARATOR_C_H
23 
24 #include <gnuradio/block.h>
25 #include <inspector/api.h>
26 
27 namespace gr {
28 namespace inspector {
29 
30 /*!
31  * \brief Signal Separator takes input signal and RF map as input and passes samples of
32  * each filtered and decimated signal as output \ingroup inspector
33  *
34  * \details
35  * Signal Separator block takes input signal and RF map with signal center
36  * frequencies and bandwidths and filters the input spectrum for each signal.
37  *
38  * Internally, FIR filters get calculated according to the RF map's specs.
39  * The steepness of the filters can be set with the relative transition width parameter.
40  * The spectrum gets shifted by the center frequency of each signal and filtered
41  * with the corresponding filter calculated from the RF map information. A floored integer
42  * decimation will be applied according to the set oversampling factor
43  * (decim = floor(samp_rate/(bw*OSF))).
44  *
45  * To save CPU load, generic taps can be precalculated with the tool in the apps/
46  * folder. This tool outputs a JSON file, which path can be specified in the block
47  * parameter <code>file_path</code>.
48  *
49  * Output of this block is a pmt vector of tuples in the format
50  *
51  * <code>#[#(SigNo, cfreq, bandwidth, #[vector of samples]), #(...)]</code>
52  */
53 class INSPECTOR_API signal_separator_c : virtual public gr::block
54 {
55 public:
56  typedef boost::shared_ptr<signal_separator_c> sptr;
57 
58  /*!
59  * \brief Return new instance of Signal Separator block
60  *
61  * \param samp_rate Sample rate of input signal
62  * \param window Firdes window type to scale input samples with
63  * \param trans_width Transition width for each signal relative to center frequency (w
64  * = trans_width*center_freq) \param oversampling Oversampling factor (OSF) to ensure
65  * the whole signal gets passed \param taps_file Determine wether to use a file of
66  * precalculated taps or caluculate them during runtime \param file_path File path to
67  * taps file (leave empty if not enabled)
68  */
69  static sptr make(double samp_rate,
70  int window,
71  float trans_width,
72  float oversampling,
73  bool taps_file,
74  std::map<float, std::vector<float>>& file_path);
75 
76  virtual void set_samp_rate(double d_samp_rate) = 0;
77 
78  /*!
79  * Takes integers and does internal cast to firdes::win_type
80  */
81  virtual void set_window(int d_window) = 0;
82 
83  virtual void set_trans_width(float d_trans_width) = 0;
84  virtual void set_oversampling(float d_oversampling) = 0;
85 };
86 
87 } // namespace inspector
88 } // namespace gr
89 
90 #endif /* INCLUDED_INSPECTOR_SIGNAL_SEPARATOR_C_H */
Signal Separator takes input signal and RF map as input and passes samples of each filtered and decim...
Definition: signal_separator_c.h:53
#define INSPECTOR_API
Definition: api.h:31
boost::shared_ptr< signal_separator_c > sptr
Definition: signal_separator_c.h:56
Definition: inspector_form.h:40