[xiph-commits] r12452 - trunk/speex/libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Mon Feb 12 06:02:34 PST 2007
Author: jm
Date: 2007-02-12 06:02:32 -0800 (Mon, 12 Feb 2007)
New Revision: 12452
Modified:
trunk/speex/libspeex/resample.c
Log:
Tables for Kaiser orders 4, 6, 8.
Modified: trunk/speex/libspeex/resample.c
===================================================================
--- trunk/speex/libspeex/resample.c 2007-02-12 13:41:59 UTC (rev 12451)
+++ trunk/speex/libspeex/resample.c 2007-02-12 14:02:32 UTC (rev 12452)
@@ -148,8 +148,6 @@
SpeexSincType type;
} ;
-/*static double kaiser10_8[11] = {0.92831446, 1.00000000, 0.92831446, 0.74011713, 0.50119680, 0.28205962, 0.12670280, 0.04193980, 0.00839739, 0.00035515, 0.00035515};
-static double kaiser10_16[19] = {0.98162644, 1.00000000, 0.98162644, 0.92831446, 0.84522401, 0.74011713, 0.62226347, 0.50119680, 0.38553619, 0.28205962, 0.19515633, 0.12670280, 0.07632451, 0.04193980, 0.02044510, 0.00839739, 0.00257636, 0.00035515, 0.00035515};*/
static double kaiser10_table[36] = {
0.99537781, 1.00000000, 0.99537781, 0.98162644, 0.95908712, 0.92831446,
0.89005583, 0.84522401, 0.79486424, 0.74011713, 0.68217934, 0.62226347,
@@ -158,6 +156,30 @@
0.05731132, 0.04193980, 0.02979584, 0.02044510, 0.01345224, 0.00839739,
0.00488951, 0.00257636, 0.00115101, 0.00035515, 0.00000000, 0.00000000};
+static double kaiser8_table[36] = {
+ 0.99635258, 1.00000000, 0.99635258, 0.98548012, 0.96759014, 0.94302200,
+ 0.91223751, 0.87580811, 0.83439927, 0.78875245, 0.73966538, 0.68797126,
+ 0.63451750, 0.58014482, 0.52566725, 0.47185369, 0.41941150, 0.36897272,
+ 0.32108304, 0.27619388, 0.23465776, 0.19672670, 0.16255380, 0.13219758,
+ 0.10562887, 0.08273982, 0.06335451, 0.04724088, 0.03412321, 0.02369490,
+ 0.01563093, 0.00959968, 0.00527363, 0.00233883, 0.00050000, 0.00000000};
+
+static double kaiser6_table[36] = {
+ 0.99733006, 1.00000000, 0.99733006, 0.98935595, 0.97618418, 0.95799003,
+ 0.93501423, 0.90755855, 0.87598009, 0.84068475, 0.80211977, 0.76076565,
+ 0.71712752, 0.67172623, 0.62508937, 0.57774224, 0.53019925, 0.48295561,
+ 0.43647969, 0.39120616, 0.34752997, 0.30580127, 0.26632152, 0.22934058,
+ 0.19505503, 0.16360756, 0.13508755, 0.10953262, 0.08693120, 0.06722600,
+ 0.05031820, 0.03607231, 0.02432151, 0.01487334, 0.00752000, 0.00000000};
+
+static double kaiser4_table[36] = {
+ 0.99831452, 1.00000000, 0.99831452, 0.99327105, 0.98490841, 0.97329088,
+ 0.95850750, 0.94067123, 0.91991776, 0.89640418, 0.87030740, 0.84182235,
+ 0.81116010, 0.77854570, 0.74421601, 0.70841739, 0.67140328, 0.63343178,
+ 0.59476318, 0.55565754, 0.51637222, 0.47715958, 0.43826468, 0.39992313,
+ 0.36235905, 0.32578323, 0.29039137, 0.25636266, 0.22385840, 0.19302093,
+ 0.16397278, 0.13681602, 0.11163187, 0.08848053, 0.06740000, 0.00000000};
+
struct FuncDef {
double *table;
int oversample;
@@ -165,6 +187,12 @@
static struct FuncDef _KAISER10 = {kaiser10_table, 32};
#define KAISER10 (&_KAISER10)
+static struct FuncDef _KAISER8 = {kaiser8_table, 32};
+#define KAISER8 (&_KAISER8)
+static struct FuncDef _KAISER6 = {kaiser6_table, 32};
+#define KAISER6 (&_KAISER6)
+static struct FuncDef _KAISER4 = {kaiser4_table, 32};
+#define KAISER4 (&_KAISER4)
static double compute_func(float x, struct FuncDef *func)
{
@@ -193,7 +221,7 @@
int i;
for (i=0;i<256;i++)
{
- printf ("%f\n", interp_func(i/256., kaiser10c, 32));
+ printf ("%f\n", compute_func(i/256., KAISER4));
}
return 0;
}
More information about the commits
mailing list