The Inspector (GNU Radio module gr-inspector)
signal_separator_c.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2016 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * This is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this software; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 
24 #ifndef INCLUDED_INSPECTOR_SIGNAL_SEPARATOR_C_H
25 #define INCLUDED_INSPECTOR_SIGNAL_SEPARATOR_C_H
26 
27 #include <inspector/api.h>
28 #include <gnuradio/block.h>
29 
30 namespace gr {
31  namespace inspector {
32 
33  /*!
34  * \brief Signal Separator takes input signal and RF map as input and passes samples of each filtered and decimated signal as output
35  * \ingroup inspector
36  *
37  * \details
38  * Signal Separator block takes input signal and RF map with signal center
39  * frequencies and bandwidths and filters the input spectrum for each signal.
40  *
41  * Internally, FIR filters get calculated according to the RF map's specs.
42  * The steepness of the filters can be set with the relative transition width parameter.
43  * The spectrum gets shifted by the center frequency of each signal and filtered
44  * with the corresponding filter calculated from the RF map information. A floored integer
45  * decimation will be applied according to the set oversampling factor
46  * (decim = floor(samp_rate/(bw*OSF))).
47  *
48  * To save CPU load, generic taps can be precalculated with the tool in the apps/
49  * folder. This tool outputs a JSON file, which path can be specified in the block
50  * parameter <code>file_path</code>.
51  *
52  * Output of this block is a pmt vector of tuples in the format
53  *
54  * <code>#[#(SigNo, cfreq, bandwidth, #[vector of samples]), #(...)]</code>
55  */
56  class INSPECTOR_API signal_separator_c : virtual public gr::block
57  {
58  public:
59  typedef boost::shared_ptr<signal_separator_c> sptr;
60 
61  /*!
62  * \brief Return new instance of Signal Separator block
63  *
64  * \param samp_rate Sample rate of input signal
65  * \param window Firdes window type to scale input samples with
66  * \param trans_width Transition width for each signal relative to center frequency (w = trans_width*center_freq)
67  * \param oversampling Oversampling factor (OSF) to ensure the whole signal gets passed
68  * \param taps_file Determine wether to use a file of precalculated taps or caluculate them during runtime
69  * \param file_path File path to taps file (leave empty if not enabled)
70  */
71  static sptr make(double samp_rate, int window, float trans_width,
72  float oversampling, bool taps_file, std::map<float, std::vector<float> > &file_path);
73 
74  virtual void set_samp_rate(double d_samp_rate) = 0;
75 
76  /*!
77  * Takes integers and does internal cast to firdes::win_type
78  */
79  virtual void set_window(int d_window) = 0;
80 
81  virtual void set_trans_width(float d_trans_width) = 0;
82  virtual void set_oversampling(float d_oversampling) = 0;
83  };
84 
85  } // namespace inspector
86 } // namespace gr
87 
88 #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:56
#define INSPECTOR_API
Definition: api.h:30
boost::shared_ptr< signal_separator_c > sptr
Definition: signal_separator_c.h:59
Definition: ofdm_bouzegzi_c.h:30