This repository has been archived by the owner on Apr 1, 2020. It is now read-only.
forked from jsr606/CFO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
filterCoefficients_4stageLP.inc
executable file
·25 lines (20 loc) · 12.9 KB
/
filterCoefficients_4stageLP.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// value of x for implementation of four stage low pass filter
// in 32bit fixed integer calculation with coefficients
// a0 = (1 - x)^4
// b1 = 4x
// b2 = -6x^2
// b3 = 4x^3
// b4 = -x^4
// x = EXP(-(14.445 * fc))
// where fc is a value between 0.0 and 0.5 of the sampling rate (in this case 48KHz)
//
// a0
20,22,25,28,31,35,40,44,50,56,63,70,79,88,99,111,125,140,157,176,197,221,248,278,312,350,392,440,493,553,620,695,779,873,979,1098,1231,1379,1546,1733,1942,2177,2439,2734,3063,3433,3846,4309,4828,5409,6059,6787,7602,8515,9536,10680,11959,13391,14994,16787,18793,21037,23547,26355,29494,33005,36931,41320,46226,51710,57838,64687,72338,80886,90434,101097,113004,126298,141139,157704,176189,196815,219825,245489,274110,306021,341593,381240,425419,474636,529456,590502,658464,734110,818288,911935,1016091,1131904,1260644,1403713,1562660,1739196,1935205,2152771,2394182,2661966,2958902,3288047,3652765,4056749,4504056,4999142,5546883,6152633,6822246,7562139,8379310,9281420,10276823,11374627,12584769,13918045,15386204,17002021,18779343,20733193,22879824,25236844,27823245,30659544,33767812,37171845,40897196,44971294,49423522,54285288,59590216,65374073,71674958,78533412,85992292,94097108,102895761,112438848,122779508,133973447,146079010,159156856,173270334,188484974,204868559,222490692,241423108,261739038,283512758,306819598,331735715,358336882,386699043,416896828,449003701,483091188,519227244,557477492,597902539,640558361,685494633,732754880,782374892,834381953,888793830,945618867,1004853643,1066483754,1130481855,1196807534,1265406920,1336211852,1409139855,1484093865,1560961173,1639615567,1719915608,1801705539,1884816876,1969068201,2054265615,2140205839,2226675027,2313451941,2400309450,2487015015,2573334323,2659031961,2743873426,2827628048,2910070486,2990982176,3070154485,3147389781,3222503817,3295325858,3365701888,3433495954,3498587958,3560879279,3620289028,3676757366,3730243444,3780726504,3828204945,3872695363,3914232296,3952866364,3988663721,4021704445,4052080758,4079895657,4105261554,4128297983,4149130507,4167888924,4184705587,4199713832,4213046939,4224836618,4235211728,4244297498,4252214336,4259077474,4264995979,4270072545,4274402998,4278076182,4281173865,4283770704,4285934433,4287726010,4289199913,4290404475,4291382228,4292170351,4292801069,4293302095,4293697081,4294006041,4294245772,4294430253,4294571010,4294677470,4294757264,4294816520,4294860104,4294891848,4294914734,4294931065,
// b1
17038279068,17034147808,17029896544,17025521801,17021020052,17016387642,17011620781,17006715662,17001668287,16996474564,16991130317,16985631212,16979972858,16974150663,16968159948,16961995879,16955653549,16949127860,16942413545,16935505290,16928397533,16921084639,16913560719,16905819871,16897855875,16889662455,16881233068,16872561100,16863639683,16854461730,16845020092,16835307279,16825315756,16815037656,16804464945,16793589302,16782402425,16770895477,16759059586,16746885620,16734364142,16721485583,16708239896,16694617142,16680606767,16666198178,16651380353,16636142089,16620471885,16604357892,16587788116,16570749976,16553230931,16535217865,16516697471,16497656006,16478079455,16457953627,16437263726,16415994700,16394131203,16371657456,16348557353,16324814475,16300411801,16275332217,16249557932,16223071183,16195853363,16167885627,16139148899,16109623408,16079289189,16048125758,16016112229,15983227336,15949449257,15914756166,15879125152,15842533346,15804957512,15766373600,15726757537,15686084632,15644329617,15601467239,15557471683,15512316280,15465974673,15418419822,15369624189,15319559923,15268199180,15215513067,15161473074,15106050020,15049214574,14990937081,14931187310,14869935869,14807151840,14742804881,14676864702,14609299821,14540080298,14469174989,14396552966,14322184034,14246036661,14168081107,14088286683,14006623153,13923061264,13837571386,13750124981,13660692692,13569247792,13475762396,13380210322,13282566132,13182804250,13080901918,12976836558,12870586133,12762130880,12651451934,12538532667,12423356602,12305910644,12186182273,12064162718,11939843495,11813219203,11684286654,11553045462,11419498603,11283649896,11145508389,11005085486,10862394590,10717455304,10570287775,10420918803,10269376941,10115695645,9959912867,9802069802,9642214712,9480397251,9316673738,9151104752,8983757849,8814702555,8644014503,8471776576,8298075897,8123003129,7946658088,7769142476,7590566329,7411043333,7230691978,7049640365,6868015988,6685955524,6503598818,6321092495,6138585531,5956232149,5774191022,5592625379,5411699564,5231583720,5052448349,4874467744,4697817807,4522675130,4349217443,4177622187,4008066093,3840726673,3675776951,3513389135,3353732669,3196971570,3043265692,2892770764,2745634125,2601998384,2461997652,2325757122,2193394338,2065015744,1940718035,1820587487,1704698154,1593112198,1485880197,1383039181,1284613438,1190613500,1101037876,1015870782,935082148,858631609,786462991,718509733,654691797,594918625,539088277,487088702,438798845,394088820,352821698,314853747,280035717,248214198,219232495,192931434,169151121,147731425,128513200,111339394,96056069,82512906,70564240,60069888,50895519,42913483,36002837,30050068,24949046,20601325,16916082,13810074,11207554,9039996,7245869,5770290,4564639,3586191,2797628,2166637,1665443,1270356,961336,721569,537068,396299,289834,210036,150778,107193,75449,52562,36232,
// b2
-25346783828,-25334493682,-25321849647,-25308841657,-25295459516,-25281692655,-25267530138,-25252960994,-25237973710,-25222556514,-25206697417,-25190383983,-25173603637,-25156343246,-25138589439,-25120328430,-25101546251,-25082228404,-25062359934,-25041925789,-25020910225,-24999297343,-24977070529,-24954213193,-24930707865,-24906536958,-24881682174,-24856125069,-24829846517,-24802826828,-24775046206,-24746483935,-24717119256,-24686930530,-24655895722,-24623992065,-24591196953,-24557486332,-24522836163,-24487221786,-24450617775,-24412998472,-24374336971,-24334606847,-24293780045,-24251828586,-24208723421,-24164435185,-24118933856,-24072188622,-24024168488,-23974841004,-23924174102,-23872134321,-23818687944,-23763800305,-23707436268,-23649560543,-23590136447,-23529126948,-23466494567,-23402201000,-23336207454,-23268474700,-23198962289,-23127630012,-23054436284,-22979340161,-22902298908,-22823269738,-22742209884,-22659075303,-22573822133,-22486405825,-22396781505,-22304904071,-22210727760,-22114207721,-22015297052,-21913949995,-21810120840,-21703762745,-21594829969,-21483276309,-21369055249,-21252121661,-21132430279,-21009934982,-20884592022,-20756357392,-20625187409,-20491039285,-20353872056,-20213643837,-20070315725,-19923849079,-19774206970,-19621353822,-19465254838,-19305879780,-19143196896,-18977178472,-18807799567,-18635034904,-18458865967,-18279274069,-18096244077,-17909765781,-17719828804,-17526430509,-17329569236,-17129247904,-16925475353,-16718263086,-16507628925,-16293592474,-16076183439,-15855432617,-15631378769,-15404066338,-15173543468,-14939868851,-14703105588,-14463322068,-14220595877,-13975010607,-13726658780,-13475637179,-13222053832,-12966021755,-12707665629,-12447114220,-12184506160,-11919987849,-11653714416,-11385850522,-11116564999,-10846039272,-10574461185,-10302023982,-10028933889,-9755398814,-9481639312,-9207878851,-8934349030,-8661288097,-8388938068,-8117550567,-7847376288,-7578673208,-7311701616,-7046727559,-6784013921,-6523826165,-6266432903,-6012100225,-5761089836,-5513666090,-5270084496,-5030599760,-4795458221,-4564898538,-4339156668,-4118451931,-3902998398,-3692996478,-3488636313,-3290091903,-3097523709,-2911077052,-2730881559,-2557047308,-2389669088,-2228820899,-2074559084,-1926920273,-1785920788,-1651557311,-1523806173,-1402623644,-1287947645,-1179694913,-1077764599,-982037991,-892378205,-808632415,-730633272,-658198267,-591133336,-529232706,-472280621,-420053727,-372321522,-328848822,-289397326,-253726827,-221597130,-192769800,-167009192,-144084190,-123769322,-105846359,-90104887,-76343302,-64370243,-54004256,-45075102,-37423569,-30901996,-25374131,-20715123,-16811341,-13559998,-10868810,-8655440,-6846967,-5379286,-4196442,-3249955,-2498165,-1905536,-1442005,-1082353,-805603,-594450,-434751,-315054,-226168,-160790,-113174,-78843,-54347,-37056,-24985,-16652,-10967,-7135,-4584,-2907,-1819,-1123,-683,-410,-242,-141,-81,-45,-25,-14,-7,-4,-2,-1,0,0,0,
// b3
16758590019,16746402641,16733867419,16720974639,16707714479,16694076766,16680050981,16665626598,16650792570,16635537622,16619850287,16603718684,16587130822,16570074189,16552536068,16534503367,16515962848,16496900789,16477303052,16457155451,16436443157,16415151234,16393264095,16370766224,16347641295,16323872925,16299444092,16274337693,16248536026,16222020905,16194774114,16166776617,16138009419,16108452749,16078086545,16046890124,16014843068,15981923651,15948110278,15913380869,15877712726,15841083057,15803468003,15764844318,15725187329,15684472606,15642674855,15599768657,15555728151,15510526917,15464138571,15416535548,15367690891,15317576546,15266164474,15213426002,15159332290,15103854655,15046963395,14988628809,14928821118,14867510122,14804665541,14740257081,14674253710,14606625068,14537339952,14466368251,14393678664,14319240378,14243023144,14164996097,14085129143,14003392174,13919755434,13834189642,13746665611,13657155745,13565631318,13472065467,13376432207,13278705377,13178860729,13076874519,12972723689,12866387449,12757845908,12647079477,12534071818,12418807494,12301272530,12181454967,12059345711,11934936122,11808221517,11679198778,11547867664,11414230514,11278291777,11140061318,10999549147,10856770267,10711743558,10564489138,10415034421,10263408192,10109643776,9953780159,9795857701,9635924710,9474031763,9310234660,9144595446,8977179684,8808059340,8637309060,8465012715,8291256095,8116132252,7939739535,7762179916,7583564113,7404006634,7223626305,7042548998,6860904977,6678830814,6496465692,6313956226,6131451595,5949108004,5767082941,5585538927,5404641655,5224560250,5045467372,4867535220,4690940713,4515860901,4342471931,4170953401,4001480715,3834231500,3669379075,3507095218,3347548763,3190903478,3037320974,2886954252,2739952010,2596455448,2456599770,2320509126,2188299472,2060078530,1935942718,1815976217,1700254282,1588837760,1481776947,1379108238,1280854737,1187028596,1097625498,1012629895,932012045,855729947,783727759,715937555,652279510,592662546,536983980,485131901,436984409,392411655,351276263,313434266,278736382,247028908,218154873,191955473,168270407,146939669,127804345,110707391,95494840,82016712,70127489,59687221,50561878,42623919,35752832,29835299,24765530,20445369,16784282,13699332,11115057,8963214,7182534,5718376,4522380,3552022,2770190,2144771,1648144,1256777,950760,713400,530811,391548,286257,207368,148808,105752,74405,51813,35701,24332,16398,10924,7191,4676,3003,1903,1190,734,447,268,158,92,53,30,16,9,5,3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
// b4
-4155117982,-4151089493,-4146947044,-4142687514,-4138307750,-4133804491,-4129174368,-4124414014,-4119519901,-4114488432,-4109315954,-4103998687,-4098532825,-4092914399,-4087139380,-4081203631,-4075102975,-4068833088,-4062389525,-4055767832,-4048963365,-4041971455,-4034787237,-4027405884,-4019822321,-4012031476,-4004028081,-3995806868,-3987362389,-3978689063,-3969781324,-3960633360,-3951239402,-3941593452,-3931689450,-3921521163,-3911082475,-3900366880,-3889367951,-3878079140,-3866493738,-3854605048,-3842406070,-3829890050,-3817049818,-3803878335,-3790368337,-3776512573,-3762303712,-3747734300,-3732796962,-3717484012,-3701788027,-3685701309,-3669216242,-3652325087,-3635020140,-3617293834,-3599138372,-3580546052,-3561509251,-3542020319,-3522071692,-3501655915,-3480765421,-3459392982,-3437531235,-3415173296,-3392312050,-3368940680,-3345052701,-3320641593,-3295701241,-3270225696,-3244209296,-3217646707,-3190532816,-3162863193,-3134633261,-3105839225,-3076477772,-3046545752,-3016040825,-2984961035,-2953304872,-2921071751,-2888261609,-2854874719,-2820912593,-2786377265,-2751271471,-2715598811,-2679364003,-2642572166,-2605229857,-2567344359,-2528924064,-2489978382,-2450517598,-2410553823,-2370099455,-2329168575,-2287776601,-2245939530,-2203675639,-2161003782,-2117944271,-2074519162,-2030751027,-1986664761,-1942285970,-1897641754,-1852760945,-1807673321,-1762410346,-1717004121,-1671489082,-1625899998,-1580273333,-1534646660,-1489058172,-1443547929,-1398156513,-1352925094,-1307896048,-1263112201,-1218617229,-1174454664,-1130668987,-1087304361,-1044405610,-1002016765,-960181870,-918944459,-878347522,-838433445,-799243037,-760816606,-723192865,-686408655,-650499811,-615499487,-581439455,-548348716,-516254045,-485179684,-455146926,-426174680,-398278253,-371470217,-345759847,-321153456,-297653572,-275259552,-253967665,-233770692,-214657928,-196615866,-179627487,-163673048,-148729755,-134772069,-121772241,-109699751,-98522264,-88205451,-78713465,-70008971,-62053591,-54808137,-48232899,-42287807,-36932880,-32128317,-27834874,-24014034,-20628233,-17641071,-15017481,-12723891,-10728378,-9000716,-7512517,-6237265,-5150336,-4229022,-3452523,-2801890,-2260001,-1811469,-1442573,-1141162,-896549,-699407,-541660,-416361,-317589,-240334,-180392,-134267,-99075,-72459,-52509,-37695,-26798,-18862,-13140,-9058,-6176,-4164,-2775,-1828,-1189,-764,-485,-303,-187,-114,-68,-40,-23,-13,-8,-4,-2,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0