Loading...
Searching...
No Matches
fir_filter_blk.h
Go to the documentation of this file.
/* -*- c++ -*- */
/*
* Copyright 2004,2012,2018 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef FIR_FILTER_BLK_H
#define FIR_FILTER_BLK_H
#include <gnuradio/filter/api.h>
#include <gnuradio/sync_decimator.h>
#include <cstdint>
namespace gr {
namespace filter {
/*!
* \brief FIR filter with IN_T input, OUT_T output, and TAP_T taps
* \ingroup filter_blk
*
* \details
* The fir_filter_blk_XXX blocks create finite impulse response
* (FIR) filters that perform the convolution in the time
* domain:
*
* \code
* out = 0
* for i in ntaps:
* out += input[n-i] * taps[i]
* \endcode
*
* The taps are a C++ vector (or Python list) of values of the
* type specified by the third letter in the block's suffix. For
* this block, the value is of type TAP_T. Taps can be
* created using the firdes or optfir tools.
*
* These versions of the filter can also act as down-samplers
* (or decimators) by specifying an integer value for \p
* decimation.
*/
template <class IN_T, class OUT_T, class TAP_T>
class FILTER_API fir_filter_blk : virtual public sync_decimator
{
public:
typedef std::shared_ptr<fir_filter_blk<IN_T, OUT_T, TAP_T>> sptr;
/*!
* \brief FIR filter with IN_T input, OUT_T output, and TAP_T taps
*
* \param decimation set the integer decimation rate
* \param taps a vector/list of taps of type TAP_T
*/
static sptr make(int decimation, const std::vector<TAP_T>& taps);
virtual void set_taps(const std::vector<TAP_T>& taps) = 0;
virtual std::vector<TAP_T> taps() const = 0;
};
typedef fir_filter_blk<gr_complex, gr_complex, gr_complex> fir_filter_ccc;
typedef fir_filter_blk<gr_complex, gr_complex, float> fir_filter_ccf;
typedef fir_filter_blk<float, gr_complex, gr_complex> fir_filter_fcc;
typedef fir_filter_blk<float, float, float> fir_filter_fff;
typedef fir_filter_blk<float, std::int16_t, float> fir_filter_fsf;
typedef fir_filter_blk<std::int16_t, gr_complex, gr_complex> fir_filter_scc;
} /* namespace filter */
} /* namespace gr */
#endif /* FIR_FILTER_BLK_H */
gr::filter::fir_filter_blk
FIR filter with IN_T input, OUT_T output, and TAP_T taps.
Definition fir_filter_blk.h:47
gr::filter::fir_filter_blk::make
static sptr make(int decimation, const std::vector< TAP_T > &taps)
FIR filter with IN_T input, OUT_T output, and TAP_T taps.
gr::filter::fir_filter_blk< gr_complex, gr_complex, gr_complex >::taps
virtual std::vector< gr_complex > taps() const=0
gr::filter::fir_filter_blk::sptr
std::shared_ptr< fir_filter_blk< IN_T, OUT_T, TAP_T > > sptr
Definition fir_filter_blk.h:49
gr::filter::fir_filter_blk::set_taps
virtual void set_taps(const std::vector< TAP_T > &taps)=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::fir_filter_scc
fir_filter_blk< std::int16_t, gr_complex, gr_complex > fir_filter_scc
Definition fir_filter_blk.h:68
gr::filter::fir_filter_fsf
fir_filter_blk< float, std::int16_t, float > fir_filter_fsf
Definition fir_filter_blk.h:67
gr::filter::fir_filter_ccf
fir_filter_blk< gr_complex, gr_complex, float > fir_filter_ccf
Definition fir_filter_blk.h:64
gr::filter::fir_filter_fff
fir_filter_blk< float, float, float > fir_filter_fff
Definition fir_filter_blk.h:66
gr::filter::fir_filter_ccc
fir_filter_blk< gr_complex, gr_complex, gr_complex > fir_filter_ccc
Definition fir_filter_blk.h:63
gr::filter::fir_filter_fcc
fir_filter_blk< float, gr_complex, gr_complex > fir_filter_fcc
Definition fir_filter_blk.h:65
gr
GNU Radio logging wrapper.
Definition basic_block.h:29
sync_decimator.h