1 /* Resampling library |
|
2 * Copyright (C) <2001> David Schleef <ds@schleef.org> |
|
3 * |
|
4 * This library is free software; you can redistribute it and/or |
|
5 * modify it under the terms of the GNU Library General Public |
|
6 * License as published by the Free Software Foundation; either |
|
7 * version 2 of the License, or any later version. |
|
8 * |
|
9 * This library is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
12 * Library General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Library General Public |
|
15 * License along with this library; if not, write to the |
|
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|
17 * Boston, MA 02111-1307, USA. |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __FUNCTABLE_H__ |
|
22 #define __FUNCTABLE_H__ |
|
23 |
|
24 typedef void FunctableFunc (double *fx, double *dfx, double x, void *closure); |
|
25 |
|
26 typedef struct _Functable Functable; |
|
27 struct _Functable { |
|
28 int length; |
|
29 |
|
30 double offset; |
|
31 double multiplier; |
|
32 |
|
33 double inv_multiplier; |
|
34 |
|
35 double *fx; |
|
36 double *dfx; |
|
37 }; |
|
38 #ifdef __SYMBIAN32__ |
|
39 IMPORT_C |
|
40 #endif |
|
41 |
|
42 |
|
43 Functable *functable_new (void); |
|
44 void functable_setup (Functable *t); |
|
45 #ifdef __SYMBIAN32__ |
|
46 IMPORT_C |
|
47 #endif |
|
48 |
|
49 void functable_free (Functable *t); |
|
50 #ifdef __SYMBIAN32__ |
|
51 IMPORT_C |
|
52 #endif |
|
53 |
|
54 |
|
55 void functable_set_length (Functable *t, int length); |
|
56 #ifdef __SYMBIAN32__ |
|
57 IMPORT_C |
|
58 #endif |
|
59 |
|
60 void functable_set_offset (Functable *t, double offset); |
|
61 #ifdef __SYMBIAN32__ |
|
62 IMPORT_C |
|
63 #endif |
|
64 |
|
65 void functable_set_multiplier (Functable *t, double multiplier); |
|
66 #ifdef __SYMBIAN32__ |
|
67 IMPORT_C |
|
68 #endif |
|
69 |
|
70 void functable_calculate (Functable *t, FunctableFunc func, void *closure); |
|
71 #ifdef __SYMBIAN32__ |
|
72 IMPORT_C |
|
73 #endif |
|
74 |
|
75 void functable_calculate_multiply (Functable *t, FunctableFunc func, void *closure); |
|
76 #ifdef __SYMBIAN32__ |
|
77 IMPORT_C |
|
78 #endif |
|
79 |
|
80 |
|
81 |
|
82 double functable_evaluate (Functable *t,double x); |
|
83 #ifdef __SYMBIAN32__ |
|
84 IMPORT_C |
|
85 #endif |
|
86 |
|
87 |
|
88 double functable_fir(Functable *t,double x0,int n,double *data,int len); |
|
89 #ifdef __SYMBIAN32__ |
|
90 IMPORT_C |
|
91 #endif |
|
92 |
|
93 void functable_fir2(Functable *t,double *r0, double *r1, double x0, |
|
94 int n,double *data,int len); |
|
95 #ifdef __SYMBIAN32__ |
|
96 IMPORT_C |
|
97 #endif |
|
98 |
|
99 |
|
100 void functable_func_sinc(double *fx, double *dfx, double x, void *closure); |
|
101 #ifdef __SYMBIAN32__ |
|
102 IMPORT_C |
|
103 #endif |
|
104 |
|
105 void functable_func_boxcar(double *fx, double *dfx, double x, void *closure); |
|
106 #ifdef __SYMBIAN32__ |
|
107 IMPORT_C |
|
108 #endif |
|
109 |
|
110 void functable_func_hanning(double *fx, double *dfx, double x, void *closure); |
|
111 |
|
112 #endif /* __PRIVATE_H__ */ |
|
113 |
|