/* IIR Decimation filter for rate 3 Copyright (C) 2002 Jussi Laako This program 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 2 of the License, or (at your option) any later version. This program 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef _MSC_VER #pragma warning(disable:4305) #endif /* f1: 0.15, f2: 0.16667, r: 0.1, a: 96, t: chebyshev */ static const long lDec3IIRSize = 14l; static const float fpDec3IIRCoeffs[][5] = { { // 0 0.20612381560143, 0.41224763120286, 0.20612381560143, 1.16655653140295, -0.991051793808671 }, { // 1 0.199956923120078, 0.399913846240156, 0.199956923120078, 1.17353927246339, -0.973366964943707 }, { // 2 0.189687762426556, 0.379375524853111, 0.189687762426556, 1.19717435026578, -0.955925399971997 }, { // 3 0.175623636079266, 0.351247272158532, 0.175623636079266, 1.2362163802201, -0.938710924537166 }, { // 4 0.158198347032725, 0.316396694065451, 0.158198347032725, 1.28896470202014, -0.921758090151041 }, { // 5 0.138000902722861, 0.276001805445723, 0.138000902722861, 1.35316505184281, -0.905168662734252 }, { // 6 0.115803473284191, 0.231606946568382, 0.115803473284191, 1.4259115081258, -0.889125401262565 }, { // 7 0.0925789944055268, 0.185157988811054, 0.0925789944055268, 1.50358434370774, -0.873900321329847 }, { // 8 0.0694962089224376, 0.138992417844875, 0.0694962089224376, 1.58186857525216, -0.859853410941906 }, { // 9 0.0478793602979918, 0.0957587205959835, 0.0478793602979918, 1.65589991979591, -0.847417360987876 }, { // 10 0.0291234398087895, 0.058246879617579, 0.0291234398087895, 1.72057137841201, -0.837065137647169 }, { // 11 0.0145655023994335, 0.029131004798867, 0.0145655023994335, 1.77099876568531, -0.829260775283047 }, { // 12 0.00532730800397216, 0.0106546160079443, 0.00532730800397216, 1.8030900620617, -0.824399294077589 }, { // 13 0.0464728891735737, 0.0464728891735737, 0, 0.907054221652853, 0 } }; static const double dpDec3IIRCoeffs[][5] = { { // 0 0.20612381560143, 0.41224763120286, 0.20612381560143, 1.16655653140295, -0.991051793808671 }, { // 1 0.199956923120078, 0.399913846240156, 0.199956923120078, 1.17353927246339, -0.973366964943707 }, { // 2 0.189687762426556, 0.379375524853111, 0.189687762426556, 1.19717435026578, -0.955925399971997 }, { // 3 0.175623636079266, 0.351247272158532, 0.175623636079266, 1.2362163802201, -0.938710924537166 }, { // 4 0.158198347032725, 0.316396694065451, 0.158198347032725, 1.28896470202014, -0.921758090151041 }, { // 5 0.138000902722861, 0.276001805445723, 0.138000902722861, 1.35316505184281, -0.905168662734252 }, { // 6 0.115803473284191, 0.231606946568382, 0.115803473284191, 1.4259115081258, -0.889125401262565 }, { // 7 0.0925789944055268, 0.185157988811054, 0.0925789944055268, 1.50358434370774, -0.873900321329847 }, { // 8 0.0694962089224376, 0.138992417844875, 0.0694962089224376, 1.58186857525216, -0.859853410941906 }, { // 9 0.0478793602979918, 0.0957587205959835, 0.0478793602979918, 1.65589991979591, -0.847417360987876 }, { // 10 0.0291234398087895, 0.058246879617579, 0.0291234398087895, 1.72057137841201, -0.837065137647169 }, { // 11 0.0145655023994335, 0.029131004798867, 0.0145655023994335, 1.77099876568531, -0.829260775283047 }, { // 12 0.00532730800397216, 0.0106546160079443, 0.00532730800397216, 1.8030900620617, -0.824399294077589 }, { // 13 0.0464728891735737, 0.0464728891735737, 0, 0.907054221652853, 0 } }; /* f1: 0.15833, f2: 0.16667, r: 0.1, a: 96, t: chebyshev */ /*static const long lDec3IIRSize = 20l; static const float fpDec3IIRCoeffs[][5] = { { // 0 0.227647824582658, 0.455295649165315, 0.227647824582658, 1.08495246415859, -0.995543762489218 }, { // 1 0.224378347659029, 0.448756695318058, 0.224378347659029, 1.08916692922144, -0.986680319857554 }, { // 2 0.218905291043542, 0.437810582087085, 0.218905291043542, 1.10224473383073, -0.977865898004897 }, { // 3 0.211296387736946, 0.422592775473892, 0.211296387736946, 1.12389926210344, -0.969084813051225 }, { // 4 0.201643794498987, 0.403287588997973, 0.201643794498987, 1.1537527946667, -0.960327972662651 }, { // 5 0.190069159432337, 0.380138318864675, 0.190069159432337, 1.19131858518897, -0.951595222918322 }, { // 6 0.176729858014251, 0.353459716028503, 0.176729858014251, 1.23597829437787, -0.942897726434876 }, { // 7 0.161825942546065, 0.323651885092129, 0.161825942546065, 1.28695654644334, -0.934260316627602 }, { // 8 0.145607142176726, 0.291214284353452, 0.145607142176726, 1.34329513330297, -0.925723702009876 }, { // 9 0.128378994100325, 0.256757988200649, 0.128378994100325, 1.40383033546985, -0.917346311871146 }, { // 10 0.110506911217153, 0.221013822434305, 0.110506911217153, 1.46717784405167, -0.909205488920281 }, { // 11 0.0924167558091885, 0.184833511618377, 0.0924167558091885, 1.53173063825525, -0.901397661492007 }, { // 12 0.0745903819092521, 0.149180763818504, 0.0745903819092521, 1.59567556442442, -0.89403709206143 }, { // 13 0.0575547430637654, 0.115109486127531, 0.0575547430637654, 1.65703385843447, -0.887252830689529 }, { // 14 0.0418636462936031, 0.0837272925872063, 0.0418636462936031, 1.71372904627386, -0.881183631448273 }, { // 15 0.0280721285617954, 0.0561442571235907, 0.0280721285617954, 1.76368231925819, -0.875970833505375 }, { // 16 0.0167046962058954, 0.0334093924117908, 0.0167046962058954, 1.8049307695923, -0.871749554415877 }, { // 17 0.00822010940837615, 0.0164402188167523, 0.00822010940837615, 1.83575850082831, -0.868638938461817 }, { // 18 0.00297667434446007, 0.00595334868892014, 0.00297667434446007, 1.85482585687089, -0.866732554248732 }, { // 19 0.0346801557915072, 0.0346801557915072, 0, 0.930639688416986, 0 } }; static const double dpDec3IIRCoeffs[][5] = { { // 0 0.227647824582658, 0.455295649165315, 0.227647824582658, 1.08495246415859, -0.995543762489218 }, { // 1 0.224378347659029, 0.448756695318058, 0.224378347659029, 1.08916692922144, -0.986680319857554 }, { // 2 0.218905291043542, 0.437810582087085, 0.218905291043542, 1.10224473383073, -0.977865898004897 }, { // 3 0.211296387736946, 0.422592775473892, 0.211296387736946, 1.12389926210344, -0.969084813051225 }, { // 4 0.201643794498987, 0.403287588997973, 0.201643794498987, 1.1537527946667, -0.960327972662651 }, { // 5 0.190069159432337, 0.380138318864675, 0.190069159432337, 1.19131858518897, -0.951595222918322 }, { // 6 0.176729858014251, 0.353459716028503, 0.176729858014251, 1.23597829437787, -0.942897726434876 }, { // 7 0.161825942546065, 0.323651885092129, 0.161825942546065, 1.28695654644334, -0.934260316627602 }, { // 8 0.145607142176726, 0.291214284353452, 0.145607142176726, 1.34329513330297, -0.925723702009876 }, { // 9 0.128378994100325, 0.256757988200649, 0.128378994100325, 1.40383033546985, -0.917346311871146 }, { // 10 0.110506911217153, 0.221013822434305, 0.110506911217153, 1.46717784405167, -0.909205488920281 }, { // 11 0.0924167558091885, 0.184833511618377, 0.0924167558091885, 1.53173063825525, -0.901397661492007 }, { // 12 0.0745903819092521, 0.149180763818504, 0.0745903819092521, 1.59567556442442, -0.89403709206143 }, { // 13 0.0575547430637654, 0.115109486127531, 0.0575547430637654, 1.65703385843447, -0.887252830689529 }, { // 14 0.0418636462936031, 0.0837272925872063, 0.0418636462936031, 1.71372904627386, -0.881183631448273 }, { // 15 0.0280721285617954, 0.0561442571235907, 0.0280721285617954, 1.76368231925819, -0.875970833505375 }, { // 16 0.0167046962058954, 0.0334093924117908, 0.0167046962058954, 1.8049307695923, -0.871749554415877 }, { // 17 0.00822010940837615, 0.0164402188167523, 0.00822010940837615, 1.83575850082831, -0.868638938461817 }, { // 18 0.00297667434446007, 0.00595334868892014, 0.00297667434446007, 1.85482585687089, -0.866732554248732 }, { // 19 0.0346801557915072, 0.0346801557915072, 0, 0.930639688416986, 0 } };*/