GNU Radio 3.6.1 C++ API
gr_remez.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004 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 INCLUDED_GR_REMEZ_H
24 #define INCLUDED_GR_REMEZ_H
25 
26 #include <gr_core_api.h>
27 #include <gr_types.h>
28 #include <string>
29 #include <stdexcept>
30 
31 /*!
32  * \brief Parks-McClellan FIR filter design.
33  *
34  * \ingroup filter_design
35  *
36  * Calculates the optimal (in the Chebyshev/minimax sense) FIR filter
37  * inpulse reponse given a set of band edges, the desired reponse on
38  * those bands, and the weight given to the error in those bands.
39  *
40  * \param order filter order (number of taps in the returned filter - 1)
41  * \param bands frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...]
42  * \param ampl desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...]
43  * \param error_weight weighting applied to each band (usually 1)
44  * \param filter_type one of "bandpass", "hilbert" or "differentiator"
45  * \param grid_density determines how accurately the filter will be constructed. \
46  * The minimum value is 16; higher values are slower to compute.
47  *
48  * Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2)
49  *
50  * \returns vector of computed taps
51  *
52  * \throws std::runtime_error if args are invalid or calculation fails to converge.
53  */
54 
55 GR_CORE_API std::vector<double>
56 gr_remez (int order,
57  const std::vector<double> &bands,
58  const std::vector<double> &ampl,
59  const std::vector<double> &error_weight,
60  const std::string filter_type = "bandpass",
61  int grid_density = 16
62  ) throw (std::runtime_error);
63 
64 
65 #endif /* INCLUDED_GR_REMEZ_H */