GNU Radio C++ API Reference: freq_xlating_fir_filter.h Source File

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
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 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef FREQ_XLATING_FIR_FILTER_H
12#define FREQ_XLATING_FIR_FILTER_H
13
14#include <gnuradio/filter/api.h>
15#include <gnuradio/sync_decimator.h>
16
17namespace gr {
18namespace filter {
19
20
21/*!
22 * \brief FIR filter combined with frequency translation with
23 * IN_T input, OUT_T output and TAP_T taps
24 *
25 * \ingroup channelizers_blk
26 *
27 * This class efficiently combines a frequency translation
28 * (typically "down conversion") with a FIR filter (typically
29 * low-pass) and decimation. It is ideally suited for a "channel
30 * selection filter" and can be efficiently used to select and
31 * decimate a narrow band signal out of wide bandwidth input.
32 *
33 * Uses a single input array to produce a single output array.
34 * Additional inputs and/or outputs are ignored.
35 *
36 * - freq (input):
37 * Receives a PMT pair: (intern("freq"), double(frequency).
38 * The block then sets its frequency translation value to
39 * the new frequency provided by the message. A tag is then
40 * produced when the new frequency is applied to let
41 * downstream blocks know when this has taken affect.
42 * Use the filter's group delay to determine when the
43 * transients after the change have settled down.
44 */
45template <class IN_T, class OUT_T, class TAP_T>
46 class FILTER_API freq_xlating_fir_filter : virtual public sync_decimator
47{
48public:
49 typedef std::shared_ptr<freq_xlating_fir_filter<IN_T, OUT_T, TAP_T>> sptr;
50
51 /*!
52 * \brief FIR filter with IN_T input, OUT_T output, and
53 * TAP_T taps that also frequency translates a signal from
54 * \p center_freq.
55 *
56 * Construct a FIR filter with the given taps and a composite
57 * frequency translation that shifts center_freq down to zero
58 * Hz. The frequency translation logically comes before the
59 * filtering operation.
60 *
61 * \param decimation set the integer decimation rate
62 * \param taps a vector/list of taps of type TAP_T
63 * \param center_freq Center frequency of signal to down convert from (Hz)
64 * \param sampling_freq Sampling rate of signal (in Hz)
65 */
66 static sptr make(int decimation,
67 const std::vector<TAP_T>& taps,
68 double center_freq,
69 double sampling_freq);
70
71 virtual void set_center_freq(double center_freq) = 0;
72 virtual double center_freq() const = 0;
73
74 virtual void set_taps(const std::vector<TAP_T>& taps) = 0;
75 virtual std::vector<TAP_T> taps() const = 0;
76};
77typedef freq_xlating_fir_filter<gr_complex, gr_complex, gr_complex>
78 freq_xlating_fir_filter_ccc;
79typedef freq_xlating_fir_filter<gr_complex, gr_complex, float>
80 freq_xlating_fir_filter_ccf;
81typedef freq_xlating_fir_filter<float, gr_complex, gr_complex>
82 freq_xlating_fir_filter_fcc;
83 typedef freq_xlating_fir_filter<float, gr_complex, float> freq_xlating_fir_filter_fcf;
84typedef freq_xlating_fir_filter<std::int16_t, gr_complex, float>
85 freq_xlating_fir_filter_scf;
86typedef freq_xlating_fir_filter<std::int16_t, gr_complex, gr_complex>
87 freq_xlating_fir_filter_scc;
88
89
90} /* namespace filter */
91} /* namespace gr */
92
93#endif /* FREQ_XLATING_FIR_FILTER_H */
gr::filter::freq_xlating_fir_filter
FIR filter combined with frequency translation with IN_T input, OUT_T output and TAP_T taps.
Definition freq_xlating_fir_filter.h:47
gr::filter::freq_xlating_fir_filter::set_taps
virtual void set_taps(const std::vector< TAP_T > &taps)=0
gr::filter::freq_xlating_fir_filter< gr_complex, gr_complex, gr_complex >::taps
virtual std::vector< gr_complex > taps() const=0
gr::filter::freq_xlating_fir_filter::make
static sptr make(int decimation, const std::vector< TAP_T > &taps, double center_freq, double sampling_freq)
FIR filter with IN_T input, OUT_T output, and TAP_T taps that also frequency translates a signal from...
gr::filter::freq_xlating_fir_filter< gr_complex, gr_complex, gr_complex >::center_freq
virtual double center_freq() const=0
gr::filter::freq_xlating_fir_filter::sptr
std::shared_ptr< freq_xlating_fir_filter< IN_T, OUT_T, TAP_T > > sptr
Definition freq_xlating_fir_filter.h:49
gr::filter::freq_xlating_fir_filter::set_center_freq
virtual void set_center_freq(double center_freq)=0
gr::sync_decimator::sync_decimator
sync_decimator(void)
Definition sync_decimator.h:31
gr::sync_decimator::decimation
unsigned decimation() const
Definition sync_decimator.h:38
api.h
FILTER_API
#define FILTER_API
Definition gr-filter/include/gnuradio/filter/api.h:18
gr::filter
Definition dc_blocker_cc.h:18
gr::filter::freq_xlating_fir_filter_ccc
freq_xlating_fir_filter< gr_complex, gr_complex, gr_complex > freq_xlating_fir_filter_ccc
Definition freq_xlating_fir_filter.h:78
gr::filter::freq_xlating_fir_filter_ccf
freq_xlating_fir_filter< gr_complex, gr_complex, float > freq_xlating_fir_filter_ccf
Definition freq_xlating_fir_filter.h:80
gr::filter::freq_xlating_fir_filter_scf
freq_xlating_fir_filter< std::int16_t, gr_complex, float > freq_xlating_fir_filter_scf
Definition freq_xlating_fir_filter.h:85
gr::filter::freq_xlating_fir_filter_scc
freq_xlating_fir_filter< std::int16_t, gr_complex, gr_complex > freq_xlating_fir_filter_scc
Definition freq_xlating_fir_filter.h:87
gr::filter::freq_xlating_fir_filter_fcf
freq_xlating_fir_filter< float, gr_complex, float > freq_xlating_fir_filter_fcf
Definition freq_xlating_fir_filter.h:83
gr::filter::freq_xlating_fir_filter_fcc
freq_xlating_fir_filter< float, gr_complex, gr_complex > freq_xlating_fir_filter_fcc
Definition freq_xlating_fir_filter.h:82
gr
GNU Radio logging wrapper.
Definition basic_block.h:29
sync_decimator.h