Loading...
Searching...
No Matches
fir_filter.h
Go to the documentation of this file.
/* -*- c++ -*- */
/*
* Copyright 2004,2010,2012,2018 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef INCLUDED_FILTER_FIR_FILTER_H
#define INCLUDED_FILTER_FIR_FILTER_H
#include <gnuradio/filter/api.h>
#include <gnuradio/gr_complex.h>
#include <volk/volk_alloc.hh>
#include <cstdint>
#include <vector>
namespace gr {
namespace filter {
namespace kernel {
template <class IN_T, class OUT_T, class TAP_T>
class FILTER_API fir_filter
{
public:
fir_filter(const std::vector<TAP_T>& taps);
// Disallow copy.
//
// This prevents accidentally doing needless copies, not just of fir_filter,
// but every block that contains one.
fir_filter(const fir_filter&) = delete;
fir_filter& operator=(const fir_filter&) = delete;
fir_filter(fir_filter&&) = default;
fir_filter& operator=(fir_filter&&) = default;
void set_taps(const std::vector<TAP_T>& taps);
void update_tap(TAP_T t, unsigned int index);
std::vector<TAP_T> taps() const;
unsigned int ntaps() const;
OUT_T filter(const IN_T input[]) const;
void filterN(OUT_T output[], const IN_T input[], unsigned long n);
void filterNdec(OUT_T output[],
const IN_T input[],
unsigned long n,
unsigned int decimate);
protected:
std::vector<TAP_T> d_taps;
unsigned int d_ntaps;
std::vector<volk::vector<TAP_T>> d_aligned_taps;
volk::vector<OUT_T> d_output;
int d_align;
int d_naligned;
};
typedef fir_filter<float, float, float> fir_filter_fff;
typedef fir_filter<gr_complex, gr_complex, float> fir_filter_ccf;
typedef fir_filter<float, gr_complex, gr_complex> fir_filter_fcc;
typedef fir_filter<gr_complex, gr_complex, gr_complex> fir_filter_ccc;
typedef fir_filter<std::int16_t, gr_complex, gr_complex> fir_filter_scc;
typedef fir_filter<float, std::int16_t, float> fir_filter_fsf;
} /* namespace kernel */
} /* namespace filter */
} /* namespace gr */
#endif /* INCLUDED_FILTER_FIR_FILTER_H */
gr::filter::kernel::fir_filter
Definition fir_filter.h:26
gr::filter::kernel::fir_filter::filterN
void filterN(OUT_T output[], const IN_T input[], unsigned long n)
gr::filter::kernel::fir_filter< float, float, float >::d_naligned
int d_naligned
Definition fir_filter.h:57
gr::filter::kernel::fir_filter< float, float, float >::d_aligned_taps
std::vector< volk::vector< float > > d_aligned_taps
Definition fir_filter.h:54
gr::filter::kernel::fir_filter::filterNdec
void filterNdec(OUT_T output[], const IN_T input[], unsigned long n, unsigned int decimate)
gr::filter::kernel::fir_filter< float, float, float >::taps
std::vector< float > taps() const
gr::filter::kernel::fir_filter::fir_filter
fir_filter(const std::vector< TAP_T > &taps)
gr::filter::kernel::fir_filter::update_tap
void update_tap(TAP_T t, unsigned int index)
gr::filter::kernel::fir_filter::operator=
fir_filter & operator=(fir_filter &&)=default
gr::filter::kernel::fir_filter::operator=
fir_filter & operator=(const fir_filter &)=delete
gr::filter::kernel::fir_filter< float, float, float >::d_align
int d_align
Definition fir_filter.h:56
gr::filter::kernel::fir_filter< float, float, float >::d_taps
std::vector< float > d_taps
Definition fir_filter.h:52
gr::filter::kernel::fir_filter::ntaps
unsigned int ntaps() const
gr::filter::kernel::fir_filter< float, float, float >::d_output
volk::vector< float > d_output
Definition fir_filter.h:55
gr::filter::kernel::fir_filter::fir_filter
fir_filter(const fir_filter &)=delete
gr::filter::kernel::fir_filter< float, float, float >::d_ntaps
unsigned int d_ntaps
Definition fir_filter.h:53
gr::filter::kernel::fir_filter::filter
OUT_T filter(const IN_T input[]) const
gr::filter::kernel::fir_filter::set_taps
void set_taps(const std::vector< TAP_T > &taps)
gr::filter::kernel::fir_filter::fir_filter
fir_filter(fir_filter &&)=default
api.h
FILTER_API
#define FILTER_API
Definition gr-filter/include/gnuradio/filter/api.h:18
gr_complex.h
gr::filter::kernel
Definition fft_filter.h:23
gr::filter::kernel::fir_filter_ccf
fir_filter< gr_complex, gr_complex, float > fir_filter_ccf
Definition fir_filter.h:60
gr::filter::kernel::fir_filter_fsf
fir_filter< float, std::int16_t, float > fir_filter_fsf
Definition fir_filter.h:64
gr::filter::kernel::fir_filter_ccc
fir_filter< gr_complex, gr_complex, gr_complex > fir_filter_ccc
Definition fir_filter.h:62
gr::filter::kernel::fir_filter_scc
fir_filter< std::int16_t, gr_complex, gr_complex > fir_filter_scc
Definition fir_filter.h:63
gr::filter::kernel::fir_filter_fcc
fir_filter< float, gr_complex, gr_complex > fir_filter_fcc
Definition fir_filter.h:61
gr::filter::kernel::fir_filter_fff
fir_filter< float, float, float > fir_filter_fff
Definition fir_filter.h:59
gr::filter
Definition dc_blocker_cc.h:18
gr
GNU Radio logging wrapper.
Definition basic_block.h:29