38 #ifndef __FE_INTERNAL_H__
39 #define __FE_INTERNAL_H__
45 #include "sphinxbase/fe.h"
46 #include "sphinxbase/fixpoint.h"
58 typedef int16 frame_t;
59 typedef int16 window_t;
60 typedef int32 powspec_t;
61 typedef struct { int16 r, i; }
complex;
62 #elif defined(FIXED_POINT)
63 typedef fixed32 frame_t;
64 typedef int32 powspec_t;
65 typedef fixed32 window_t;
66 typedef struct { fixed32 r, i; }
complex;
68 typedef float64 frame_t;
69 typedef float64 powspec_t;
70 typedef float64 window_t;
71 typedef struct { float64 r, i; }
complex;
90 float32 sampling_rate;
94 float32 lower_filt_freq;
95 float32 upper_filt_freq;
105 char const *warp_type;
106 char const *warp_params;
109 mfcc_t sqrt_inv_n, sqrt_inv_2n;
121 #define SQRT_HALF FLOAT2MFCC(0.707106781186548)
128 float32 sampling_rate;
132 float32 window_length;
137 uint8 feature_dimension;
145 float32 pre_emphasis_alpha;
157 window_t *hamming_window;
163 powspec_t *spec, *mfspec;
164 int16 *overflow_samps;
165 int16 num_overflow_samps;
169 #define BB_SAMPLING_RATE 16000
170 #define DEFAULT_BB_FFT_SIZE 512
171 #define DEFAULT_BB_FRAME_SHIFT 160
172 #define DEFAULT_BB_NUM_FILTERS 40
173 #define DEFAULT_BB_LOWER_FILT_FREQ 133.33334
174 #define DEFAULT_BB_UPPER_FILT_FREQ 6855.4976
176 #define NB_SAMPLING_RATE 8000
177 #define DEFAULT_NB_FFT_SIZE 256
178 #define DEFAULT_NB_FRAME_SHIFT 80
179 #define DEFAULT_NB_NUM_FILTERS 31
180 #define DEFAULT_NB_LOWER_FILT_FREQ 200
181 #define DEFAULT_NB_UPPER_FILT_FREQ 3500
183 void fe_init_dither(int32 seed);
186 int32 fe_dither(int16 *buffer, int32 nsamps);
189 int fe_read_frame(
fe_t *fe, int16
const *in, int32 len);
192 int fe_shift_frame(
fe_t *fe, int16
const *in, int32 len);
195 int32 fe_write_frame(
fe_t *fe, mfcc_t *fea);
198 int32 fe_build_melfilters(
melfb_t *MEL_FB);
199 int32 fe_compute_melcosine(
melfb_t *MEL_FB);
200 void fe_create_hamming(window_t *in, int32 in_len);
201 void fe_create_twiddle(
fe_t *fe);
204 void fe_spec2cep(
fe_t * fe,
const powspec_t * mflogspec, mfcc_t * mfcep);
205 void fe_dct2(
fe_t *fe,
const powspec_t *mflogspec, mfcc_t *mfcep,
int htk);
206 void fe_dct3(
fe_t *fe,
const mfcc_t *mfcep, powspec_t *mflogspec);
Base Struct to hold all structure for MFCC computation.
Opaque structure used to hold the results of command-line parsing.
Structure for the front-end computation.