GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
freq_xlating_fir_filter.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2002,2004,2012,2018 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio 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  * GNU Radio 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 GNU Radio; 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 #ifndef FREQ_XLATING_FIR_FILTER_H
24 #define FREQ_XLATING_FIR_FILTER_H
25 
26 #include <gnuradio/filter/api.h>
28 
29 namespace gr {
30 namespace filter {
31 
32 
33 /*!
34  * \brief FIR filter combined with frequency translation with
35  * IN_T input, OUT_T output and TAP_T taps
36  *
37  * \ingroup channelizers_blk
38  *
39  * This class efficiently combines a frequency translation
40  * (typically "down conversion") with a FIR filter (typically
41  * low-pass) and decimation. It is ideally suited for a "channel
42  * selection filter" and can be efficiently used to select and
43  * decimate a narrow band signal out of wide bandwidth input.
44  *
45  * Uses a single input array to produce a single output array.
46  * Additional inputs and/or outputs are ignored.
47  *
48  * - freq (input):
49  * Receives a PMT pair: (intern("freq"), double(frequency).
50  * The block then sets its frequency translation value to
51  * the new frequency provided by the message. A tag is then
52  * produced when the new frequency is applied to let
53  * downstream blocks know when this has taken affect.
54  * Use the filter's group delay to determine when the
55  * transients after the change have settled down.
56  */
57 template <class IN_T, class OUT_T, class TAP_T>
59 {
60 public:
61  typedef boost::shared_ptr<freq_xlating_fir_filter<IN_T, OUT_T, TAP_T>> sptr;
62 
63  /*!
64  * \brief FIR filter with IN_T input, OUT_T output, and
65  * TAP_T taps that also frequency translates a signal from
66  * \p center_freq.
67  *
68  * Construct a FIR filter with the given taps and a composite
69  * frequency translation that shifts center_freq down to zero
70  * Hz. The frequency translation logically comes before the
71  * filtering operation.
72  *
73  * \param decimation set the integer decimation rate
74  * \param taps a vector/list of taps of type TAP_T
75  * \param center_freq Center frequency of signal to down convert from (Hz)
76  * \param sampling_freq Sampling rate of signal (in Hz)
77  */
78  static sptr make(int decimation,
79  const std::vector<TAP_T>& taps,
80  double center_freq,
81  double sampling_freq);
82 
83  virtual void set_center_freq(double center_freq) = 0;
84  virtual double center_freq() const = 0;
85 
86  virtual void set_taps(const std::vector<TAP_T>& taps) = 0;
87  virtual std::vector<TAP_T> taps() const = 0;
88 };
100 
101 
102 } /* namespace filter */
103 } /* namespace gr */
104 
105 #endif /* FREQ_XLATING_FIR_FILTER_H */
freq_xlating_fir_filter< gr_complex, gr_complex, gr_complex > freq_xlating_fir_filter_ccc
Definition: freq_xlating_fir_filter.h:90
boost::shared_ptr< freq_xlating_fir_filter< IN_T, OUT_T, TAP_T > > sptr
Definition: freq_xlating_fir_filter.h:61
freq_xlating_fir_filter< std::int16_t, gr_complex, float > freq_xlating_fir_filter_scf
Definition: freq_xlating_fir_filter.h:97
freq_xlating_fir_filter< std::int16_t, gr_complex, gr_complex > freq_xlating_fir_filter_scc
Definition: freq_xlating_fir_filter.h:99
freq_xlating_fir_filter< float, gr_complex, float > freq_xlating_fir_filter_fcf
Definition: freq_xlating_fir_filter.h:95
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
FIR filter combined with frequency translation with IN_T input, OUT_T output and TAP_T taps...
Definition: freq_xlating_fir_filter.h:58
synchronous N:1 input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_decimator.h:37
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
freq_xlating_fir_filter< float, gr_complex, gr_complex > freq_xlating_fir_filter_fcc
Definition: freq_xlating_fir_filter.h:94
#define FILTER_API
Definition: gr-filter/include/gnuradio/filter/api.h:30
freq_xlating_fir_filter< gr_complex, gr_complex, float > freq_xlating_fir_filter_ccf
Definition: freq_xlating_fir_filter.h:92