Go to the documentation of this file.
6 static int firstCall = 1;
7 static int nf0table = 600;
8 static float f0_table[600];
9 static int min_wl = 330;
10 static int del_wl = 1;
16 int32_t
i, imin, imax;
20 if ((filedir = getenv(
"OCDATAROOT")) ==
NULL) {
21 printf(
"-E- %s: OCDATAROOT env variable undefined.\n", __FILE__);
25 strcat(
filename,
"/common/f0_table_neckel.dat");
29 "-E- %s line %d: unable to open %s for reading\n",
34 for (
i = 0;
i < nf0table;
i++) {
37 "-E- %s line %d: error reading %s at line %d\n",
41 sscanf(
line,
"%f %f", &tmp_wl, &f0_table[
i]);
47 i = (wl - min_wl) / del_wl;
48 imin =
MAX(
i - width / 2 / del_wl, 0);
49 imax =
MIN(
i + width / 2 / del_wl, nf0table);
51 if (i < 0 || i > nf0table) {
53 "-E- %s line %d: wavelength of %d outside F0 table range.\n",
54 __FILE__, __LINE__, wl);
59 for (
i = imin;
i <= imax;
i++)
62 *f0 /= (imax - imin + 1);
72 static int firstCall = 1;
73 static int nf0table = 771;
74 static float f0_table[771];
75 static int min_wl = 380;
76 static int del_wl = 1;
82 int32_t
i, imin, imax;
86 if ((filedir = getenv(
"OCDATAROOT")) ==
NULL) {
87 printf(
"-E- %s: OCDATAROOT env variable undefined.\n", __FILE__);
91 strcat(
filename,
"/common/f0_table_thuillier.dat");
95 "-E- %s line %d: unable to open %s for reading\n",
100 for (
i = 0;
i < nf0table;
i++) {
103 "-E- %s line %d: error reading %s at line %d\n",
107 sscanf(
line,
"%f %f", &tmp_wl, &f0_table[
i]);
113 i = (wl - min_wl) / del_wl;
114 imin =
MAX(
i - width / 2 / del_wl, 0);
115 imax =
MIN(
i + width / 2 / del_wl, nf0table);
117 if (i < 0 || i > nf0table) {
119 "-E- %s line %d: wavelength of %d outside F0 table range.\n",
120 __FILE__, __LINE__, wl);
125 for (
i = imin;
i <= imax;
i++)
128 *f0 /= (imax - imin + 1);
138 static int firstCall = 1;
139 static int nheader = 15;
140 static int nf0table = 2198;
141 static float f0_table[2198];
142 static int min_wl = 200;
143 static int del_wl = 1;
149 int32_t
i, imin, imax;
153 if ((filedir = getenv(
"OCDATAROOT")) ==
NULL) {
154 printf(
"-E- %s: OCDATAROOT env variable undefined.\n", __FILE__);
158 strcat(
filename,
"/common/Thuillier_F0.dat");
162 "-E- %s line %d: unable to open %s for reading\n",
168 printf(
"Reading Thuillier_F0.dat\n");
169 for (
i = 0;
i < nheader;
i++) {
176 for (
i = 0;
i < nf0table;
i++) {
179 "-E- %s line %d: error reading %s at line %d\n",
183 sscanf(
line,
"%f %f", &tmp_wl, &f0_table[
i]);
189 i = (wl - min_wl) / del_wl;
190 imin =
MAX(
i - width / 2 / del_wl, 0);
191 imax =
MIN(
i + width / 2 / del_wl, nf0table);
193 if (i < 0 || i > nf0table) {
195 "-E- %s line %d: wavelength of %d outside F0 table range.\n",
196 __FILE__, __LINE__, wl);
201 for (
i = imin;
i <= imax;
i++)
204 *f0 /= (imax - imin + 1);
int get_f0_thuillier_(int32_t *wl, int32_t *width, float *f0)
int get_f0_neckel(int32_t wl, int32_t width, float *f0)
int get_f0_thuillier_ext_(int32_t *wl, int32_t *width, float *f0)
int get_f0_neckel_(int32_t *wl, int32_t *width, float *f0)
int get_f0_thuillier(int32_t wl, int32_t width, float *f0)
char filename[FILENAME_MAX]
void get_f0_thuillier_ext(int32_t wl, int32_t width, float *f0)
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")