/* -*- c++ -*- */ /* * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef _GR_OPTFIR_H_ #define _GR_OPTFIR_H_ #include #include #include /*! * \brief Routines for designing optimal FIR filters. * * For a great intro to how all this stuff works, see section 6.6 of * "Digital Signal Processing: A Practical Approach", Emmanuael C. Ifeachor * and Barrie W. Jervis, Adison-Wesley, 1993. ISBN 0-201-54413-X. * \ingroup filter_design */ class GR_CORE_API gr_optfir { public: /*! * \brief Builds a low pass filter. * * \p gain: Filter gain in the passband (linear) * \p Fs: Sampling rate (sps) * \p freq1: End of pass band (in Hz) * \p freq2: Start of stop band (in Hz) * \p passband_ripple_db: Pass band ripple in dB (should be small, < 1) * \p stopband_atten_db: Stop band attenuation in dB (should be large, >= 60) * \p nextra_taps: Extra taps to use in the filter (default=2) */ GR_CORE_API std::vector low_pass (double gain, double Fs, double freq1, double freq2, double passband_ripple_db, double stopband_atten_db, int nextra_taps=2); }; #endif