shithub: aubio

Download patch

ref: d1c05544154ef1d447de1ac7592ce7c73aff3382
parent: 2cc816a4d405cbe3a34a3b17ff68f55ec239236f
author: Paul Brossier <piem@piem.org>
date: Thu Oct 1 20:56:31 EDT 2009

src/temporal/[ac]_weighting.[ch]: add 11025 Hz

--- a/src/temporal/a_weighting.c
+++ b/src/temporal/a_weighting.c
@@ -60,6 +60,24 @@
       a[6] =  2.098548546080332977137317129745497368276119232177734375e-01;
       break;
 
+    // adsgn 11025
+    case 11025:
+      b[0] =  6.014684165832374640459079273568931967020034790039062500e-01;
+      b[1] = -1.202936833166475150136420779745094478130340576171875000e+00;
+      b[2] = -6.014684165832373530236054648412391543388366699218750000e-01;
+      b[3] =  2.405873666332950300272841559490188956260681152343750000e+00;
+      b[4] = -6.014684165832373530236054648412391543388366699218750000e-01;
+      b[5] = -1.202936833166475150136420779745094478130340576171875000e+00;
+      b[6] =  6.014684165832374640459079273568931967020034790039062500e-01;
+      a[0] =  1.000000000000000000000000000000000000000000000000000000e+00;
+      a[1] = -2.463578747722854345170162559952586889266967773437500000e+00;
+      a[2] =  1.096799662705210121060872552334330976009368896484375000e+00;
+      a[3] =  1.381222210556041218865175324026495218276977539062500000e+00;
+      a[4] = -1.013875696476876031582037285261321812868118286132812500e+00;
+      a[5] = -1.839132734476921215982514468123554252088069915771484375e-01;
+      a[6] =  1.833526393172056623281918064094497822225093841552734375e-01;
+      break;
+
     // adsgn 16000
     case 16000:
       b[0] =  5.314898298235570806014038680586963891983032226562500000e-01;
@@ -224,7 +242,7 @@
 
     default: 
       AUBIO_ERROR ( "sampling rate of A-weighting filter is %d, should be one of\
- 8000, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, 192000.\n", 
+ 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, 192000.\n", 
  samplerate );
       break;
 
--- a/src/temporal/a_weighting.h
+++ b/src/temporal/a_weighting.h
@@ -46,8 +46,8 @@
   The coefficients in this file have been computed using Christophe Couvreur's
   scripts in octave 3.0 (debian package 1:3.0.5-6+b2 with octave-signal
   1.0.9-1+b1 on i386), with <pre> [b, a] = adsign(1/Fs) </pre> for various
-  sampling frequencies (8000, 16000, 22050, 24000, 32000, 44100, 48000, 88200,
-  96000, and 192000 Hz).
+  sampling frequencies (8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000,
+  88200, 96000, and 192000 Hz).
 
   The sampling frequency should normally be higher than 20kHz, but most common
   file sampling rates have been included for completeness.
@@ -61,7 +61,8 @@
 /** create new A-design filter
 
   \param samplerate sampling frequency of the signal to filter. Should be one of 
-  8000, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and 192000 Hz
+  8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and
+  192000 Hz
   \param channels number of channels to allocate
 
   \return a new filter object
--- a/src/temporal/c_weighting.c
+++ b/src/temporal/c_weighting.c
@@ -55,6 +55,20 @@
       a[4] =  4.147270002091348328754349950031610205769538879394531250e-01;
       break;
 
+    // cdsgn 11025
+    case 11025:
+      b[0] =  6.002357155402652244546857218665536493062973022460937500e-01;
+      b[1] =  0.000000000000000000000000000000000000000000000000000000e+00;
+      b[2] = -1.200471431080530448909371443733107298612594604492187500e+00;
+      b[3] =  0.000000000000000000000000000000000000000000000000000000e+00;
+      b[4] =  6.002357155402652244546857218665536493062973022460937500e-01;
+      a[0] =  1.000000000000000000000000000000000000000000000000000000e+00;
+      a[1] = -8.705602141280316397242700077185872942209243774414062500e-01;
+      a[2] = -9.037199507150940336330791069485712796449661254882812500e-01;
+      a[3] =  4.758433040929530011275971901341108605265617370605468750e-01;
+      a[4] =  2.987653956523212417373258631414500996470451354980468750e-01;
+      break;
+
     // cdsgn 16000
     case 16000:
       b[0] =  4.971057193673903418229542694461997598409652709960937500e-01;
@@ -183,7 +197,7 @@
 
     default:
       AUBIO_ERROR ( "sampling rate of C-weighting filter is %d, should be one of\
- 8000, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, 192000.\n", 
+ 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, 192000.\n", 
  samplerate );
       break;
 
--- a/src/temporal/c_weighting.h
+++ b/src/temporal/c_weighting.h
@@ -46,8 +46,8 @@
   The coefficients in this file have been computed using Christophe Couvreur's
   scripts in octave 3.0 (debian package 1:3.0.5-6+b2 with octave-signal
   1.0.9-1+b1 on i386), with <pre> [b, a] = cdsign(1/Fs) </pre> for various
-  sampling frequencies (8000, 16000, 22050, 24000, 32000, 44100, 48000, 88200,
-  96000, and 192000 Hz).
+  sampling frequencies (8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000,
+  88200, 96000, and 192000 Hz).
 
   The sampling frequency should normally be higher than 20kHz, but most common
   file sampling rates have been included for completeness.
@@ -61,7 +61,8 @@
 /** create new C-design filter
 
   \param samplerate sampling frequency of the signal to filter. Should be one of 
-  8000, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and 192000 Hz
+  8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and
+  192000 Hz
   \param channels number of channels to allocate
 
   \return a new filter object