1 /** 2 * BiQuad filter 3 * 4 * Copyright (C) 2006-2018 Teru Kamogashira 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 */ 20 21 #ifndef _FV3_BIQUAD_HPP 22 #define _FV3_BIQUAD_HPP 23 24 #include <cstdio> 25 #include <cmath> 26 27 #include "freeverb/utils.hpp" 28 #include "freeverb/fv3_defs.h" 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 enum { FV3_BIQUAD_RBJ_BW = 0, FV3_BIQUAD_RBJ_Q = 1, FV3_BIQUAD_RBJ_S = 2, }; 34 #ifdef __cplusplus 35 } 36 #endif 37 38 #define FV3_BIQUAD_RBJ_Q_BUTTERWORTH 0.7071067811865475244 // 1/sqrt(2) 39 #define FV3_BIQUAD_RBJ_Q_BESSEL 0.5773502691896257645 // 1/sqrt(3) 40 41 namespace fv3 42 { 43 44 #define _fv3_float_t float 45 #define _FV3_(name) name ## _f 46 #include "freeverb/biquad_t.hpp" 47 #undef _FV3_ 48 #undef _fv3_float_t 49 50 #define _fv3_float_t double 51 #define _FV3_(name) name ## _ 52 #include "freeverb/biquad_t.hpp" 53 #undef _FV3_ 54 #undef _fv3_float_t 55 56 #define _fv3_float_t long double 57 #define _FV3_(name) name ## _l 58 #include "freeverb/biquad_t.hpp" 59 #undef _FV3_ 60 #undef _fv3_float_t 61 62 }; 63 64 #endif 65