GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
pm_remez.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004,2012 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 INCLUDED_FILTER_PM_REMEZ_H
12 #define INCLUDED_FILTER_PM_REMEZ_H
13 
14 #include <gnuradio/filter/api.h>
15 #include <gnuradio/types.h>
16 #include <string>
17 #include <vector>
18 
19 namespace gr {
20 namespace filter {
21 /*!
22  * \brief Parks-McClellan FIR filter design using Remez algorithm.
23  * \ingroup filter_design
24  *
25  * \details
26  * Calculates the optimal (in the Chebyshev/minimax sense) FIR
27  * filter inpulse response given a set of band edges, the desired
28  * response on those bands, and the weight given to the error in
29  * those bands.
30  *
31  * \param order filter order (number of taps in the returned filter - 1)
32  * \param bands frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]
33  * \param ampl desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2)
34  *...] \param error_weight weighting applied to each band (usually 1) \param filter_type
35  *one of "bandpass", "hilbert" or "differentiator"
36  * \param grid_density determines how accurately the filter will be constructed. \
37  * The minimum value is 16; higher values are slower to compute.
38  *
39  * Frequency is in the range [0, 1], with 1 being the Nyquist
40  * frequency (Fs/2)
41  *
42  * \returns vector of computed taps
43  *
44  * \throws std::invalid_argument if args are invalid and std::runtime_error if calculation
45  * fails to converge.
46  */
47 
48 FILTER_API std::vector<double> pm_remez(int order,
49  const std::vector<double>& bands,
50  const std::vector<double>& ampl,
51  const std::vector<double>& error_weight,
52  const std::string filter_type = "bandpass",
53  int grid_density = 16) noexcept(false);
54 
55 } /* namespace filter */
56 } /* namespace gr */
57 
58 #endif /* INCLUDED_FILTER_PM_REMEZ_H */
#define FILTER_API
Definition: gr-filter/include/gnuradio/filter/api.h:18
FILTER_API std::vector< double > pm_remez(int order, const std::vector< double > &bands, const std::vector< double > &ampl, const std::vector< double > &error_weight, const std::string filter_type="bandpass", int grid_density=16) noexcept(false)
Parks-McClellan FIR filter design using Remez algorithm.
GNU Radio logging wrapper.
Definition: basic_block.h:29