shithub: sox

Download patch

ref: 351af0b48056c3b631cdd9c5225a17b720502274
parent: d493867bb363fe20b3bdf32886daafa3dad76f9c
author: idigdoug <idigdoug>
date: Wed Jan 6 08:02:02 EST 2010

Add coefficients for shibata noise shaping for additional sample rates.

--- a/src/dither.c
+++ b/src/dither.c
@@ -88,6 +88,121 @@
   -0.27766478061676025391,  0.15785403549671173096, -0.10165894031524658203,
   0.016833892092108726501,
 };
+static double const shi32[] =
+{ /* dmaker 32000: bestmax=4.99659 (inverted) */
+0.82118552923202515,
+-1.0063692331314087,
+0.62341964244842529,
+-1.0447187423706055,
+0.64532512426376343,
+-0.87615132331848145,
+0.52219754457473755,
+-0.67434263229370117,
+0.44954317808151245,
+-0.52557498216629028,
+0.34567299485206604,
+-0.39618203043937683,
+0.26791760325431824,
+-0.28936097025871277,
+0.1883765310049057,
+-0.19097308814525604,
+0.10431359708309174,
+-0.10633844882249832,
+0.046832218766212463,
+-0.039653312414884567,
+};
+static double const shi22[] =
+{ /* dmaker 22050: bestmax=5.77762 (inverted) */
+0.056581053882837296,
+-0.56956905126571655,
+-0.40727734565734863,
+-0.33870288729667664,
+-0.29810553789138794,
+-0.19039161503314972,
+-0.16510021686553955,
+-0.13468159735202789,
+-0.096633769571781158,
+-0.081049129366874695,
+-0.064953058958053589,
+-0.054459091275930405,
+-0.043378707021474838,
+-0.03660014271736145,
+-0.026256965473294258,
+-0.018786206841468811,
+-0.013387725688517094,
+-0.0090983230620622635,
+-0.0026585909072309732,
+-0.00042083300650119781,
+};
+static double const shi16[] =
+{ /* dmaker 16000: bestmax=5.97128 (inverted) */
+-0.37251132726669312,
+-0.81423574686050415,
+-0.55010956525802612,
+-0.47405767440795898,
+-0.32624706625938416,
+-0.3161766529083252,
+-0.2286367267370224,
+-0.22916607558727264,
+-0.19565616548061371,
+-0.18160104751586914,
+-0.15423151850700378,
+-0.14104481041431427,
+-0.11844276636838913,
+-0.097583092749118805,
+-0.076493598520755768,
+-0.068106919527053833,
+-0.041881654411554337,
+-0.036922425031661987,
+-0.019364040344953537,
+-0.014994367957115173,
+};
+static double const shi11[] =
+{ /* dmaker 11025: bestmax=5.9406 (inverted) */
+-0.9264228343963623,
+-0.98695987462997437,
+-0.631156325340271,
+-0.51966935396194458,
+-0.39738872647285461,
+-0.35679301619529724,
+-0.29720726609230042,
+-0.26310476660728455,
+-0.21719355881214142,
+-0.18561814725399017,
+-0.15404847264289856,
+-0.12687471508979797,
+-0.10339745879173279,
+-0.083688631653785706,
+-0.05875682458281517,
+-0.046893671154975891,
+-0.027950936928391457,
+-0.020740609616041183,
+-0.009366452693939209,
+-0.0060260160826146603,
+};
+static double const shi08[] =
+{ /* dmaker 8000: bestmax=5.56234 (inverted) */
+-1.202863335609436,
+-0.94103097915649414,
+-0.67878556251525879,
+-0.57650017738342285,
+-0.50004476308822632,
+-0.44349345564842224,
+-0.37833768129348755,
+-0.34028723835945129,
+-0.29413089156150818,
+-0.24994957447052002,
+-0.21715600788593292,
+-0.18792112171649933,
+-0.15268312394618988,
+-0.12135542929172516,
+-0.099610626697540283,
+-0.075273610651493073,
+-0.048787496984004974,
+-0.042586319148540497,
+-0.028991291299462318,
+-0.011869125068187714,
+};
 static double const shl48[] = {
   2.3925774097442626953,  -3.4350297451019287109,   3.1853709220886230469,
   -1.8117271661758422852, -0.20124770700931549072,  1.4759907722473144531,
@@ -123,6 +238,11 @@
   {48000, fir, 16, 301, shi48, Shape_shibata},
   {44100, fir, 20, 333, shi44, Shape_shibata},
   {37800, fir, 16, 240, shi38, Shape_shibata},
+  {32000, fir, 20, 240/*TBD*/, shi32, Shape_shibata},
+  {22050, fir, 20, 240/*TBD*/, shi22, Shape_shibata},
+  {16000, fir, 20, 240/*TBD*/, shi16, Shape_shibata},
+  {11025, fir, 20, 240/*TBD*/, shi11, Shape_shibata},
+  { 8000, fir, 20, 240/*TBD*/, shi08, Shape_shibata},
   {48000, fir, 16, 250, shl48, Shape_low_shibata},
   {44100, fir, 15, 250, shl44, Shape_low_shibata},
   {44100, fir, 20, 383, shh44, Shape_high_shibata},