Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

wav2mfcc-buffer.c File Reference

Convert speech inputs into MFCC parameter vectors (per utterance). More...

#include <sent/stddefs.h>
#include <sent/mfcc.h>

Include dependency graph for wav2mfcc-buffer.c:

Go to the source code of this file.

Functions

void make_costbl_hamming (int framesize)
void make_fft_table (int n)
void make_costbl_makemfcc (int fbank_num, int mfcc_dim)
void make_sintbl_wcep (int lifter, int mfcc_dim)
int Wav2MFCC (SP16 *wave, float **mfcc, Value para, int nSamples, float *ssbuf, int ssbuflen)
float CalcLogRawE (float *wave, int framesize)
void ZMeanFrame (float *wave, int framesize)
void Hamming (float *wave, int framesize)
void PreEmphasise (float *wave, Value para)
void WeightCepstrum (float *mfcc, Value para)
float Mel (int k, float fres)
FBankInfo InitFBank (Value para)
void FreeFBank (FBankInfo fb)
void MakeFBank (float *wave, double *fbank, FBankInfo fb, Value para, float *ssbuf)
void MakeMFCC (double *fbank, float *mfcc, Value para)
float CalcC0 (double *fbank, Value para)
void NormaliseLogE (float **mfcc, int frame_num, Value para)
void Delta (float **c, int frame, Value para)
void Accel (float **c, int frame, Value para)
void FFT (float *xRe, float *xIm, int p)
void CMN (float **mfcc, int frame_num, int dim)

Variables

static double * costbl_hamming
 Cos table for hamming window.
static int costbl_hamming_len = 0
 Length of above.
static double * costbl_fft
 Cos table for FFT.
static double * sintbl_fft
 Sin table for FFT.
static int tbllen = 0
 Length of above.
static double * costbl_makemfcc
 Cos table for DCT.
static int costbl_makemfcc_len = 0
 Length of above.
static double * sintbl_wcep
 Sin table for cepstrum weighting.
static int sintbl_wcep_len = 0
 Length of above.
static float sqrt2var
 Work area that holds value of sqrt(2.0) / fbank_num.


Detailed Description

Convert speech inputs into MFCC parameter vectors (per utterance).

Author:
Akinobu LEE
Date:
Thu Feb 17 17:43:35 2005
This file contains functions to convert the whole speech input to MFCC vector array. The frame-wise MFCC computation needed for real-time recognition is defined in wav2mfcc-pipe.c.

The supported format is MFCC[_0][_E][_D][_A][_Z].

Revision
1.2

Definition in file wav2mfcc-buffer.c.


Function Documentation

void make_costbl_hamming int  framesize  ) 
 

Generate table for hamming window.

Parameters:
framesize [in] window size

Definition at line 74 of file wav2mfcc-buffer.c.

Referenced by InitFBank(), and new_SS_calculate().

void make_fft_table int  n  ) 
 

Build tables for FFT.

Parameters:
n [in] 2^n = FFT point

Definition at line 105 of file wav2mfcc-buffer.c.

Referenced by InitFBank(), and new_SS_calculate().

void make_costbl_makemfcc int  fbank_num,
int  mfcc_dim
 

Generate table for DCT operation to make mfcc from fbank.

Parameters:
fbank_num [in] number of filer banks
mfcc_dim [in] number of dimensions in MFCC

Definition at line 138 of file wav2mfcc-buffer.c.

Referenced by InitFBank().

void make_sintbl_wcep int  lifter,
int  mfcc_dim
 

Generate table for weighing cepstrum.

Parameters:
lifter [in] cepstral liftering coefficient
mfcc_dim [in] number of dimensions in MFCC

Definition at line 176 of file wav2mfcc-buffer.c.

Referenced by InitFBank().

int Wav2MFCC SP16 wave,
float **  mfcc,
Value  para,
int  nSamples,
float *  ssbuf,
int  ssbuflen
 

Convert wave data to MFCC. Also does spectral subtraction if ssbuf specified.

Parameters:
wave [in] waveform data
mfcc [out] buffer to store the resulting MFCC parameter vector [t][0..veclen-1], should be already allocated
para [in] configuration parameters
nSamples [in] length of waveform data
ssbuf [in] buffer that holds noise spectrum to be subtracted from input, or NULL if not use spectral subtraction
ssbuflen [in] length of above, ignored when ssbuf is NULL
Returns:
the number of processed frames.

Definition at line 217 of file wav2mfcc-buffer.c.

Referenced by new_wav2mfcc().

float CalcLogRawE float *  wave,
int  framesize
 

Calculate Log Raw Energy.

Parameters:
wave [in] waveform data in the current frame
framesize [in] frame size
Returns:
the calculated log raw energy.

Definition at line 316 of file wav2mfcc-buffer.c.

Referenced by Wav2MFCC(), and WMP_calc().

void ZMeanFrame float *  wave,
int  framesize
 

Remove DC offset per frame

Parameters:
wave [i/o] waveform data in the current frame
framesize [in] frame size

Definition at line 337 of file wav2mfcc-buffer.c.

Referenced by Wav2MFCC(), and WMP_calc().

void Hamming float *  wave,
int  framesize
 

Apply hamming window.

Parameters:
wave [i/o] waveform data in the current frame
framesize [in] frame size

Definition at line 354 of file wav2mfcc-buffer.c.

Referenced by new_SS_calculate(), Wav2MFCC(), and WMP_calc().

void PreEmphasise float *  wave,
Value  para
 

Apply pre-emphasis filter.

Parameters:
wave [i/o] waveform data in the current frame
para [in] configuration parameters

Definition at line 374 of file wav2mfcc-buffer.c.

Referenced by new_SS_calculate(), Wav2MFCC(), and WMP_calc().

void WeightCepstrum float *  mfcc,
Value  para
 

Re-scale cepstral coefficients.

Parameters:
mfcc [i/o] a MFCC vector
para [in] configuration parameters

Definition at line 389 of file wav2mfcc-buffer.c.

Referenced by Wav2MFCC(), and WMP_calc().

float Mel int  k,
float  fres
 

Return mel-frequency.

Parameters:
k [in] channel number of filter bank
fres [in] constant value computed by "1.0E7 / (para.smp_period * fb.fftN * 700.0)"
Returns:
the mel frequency.

Definition at line 423 of file wav2mfcc-buffer.c.

Referenced by InitFBank().

FBankInfo InitFBank Value  para  ) 
 

Build filterbank information and generate tables for MFCC comptutation.

Parameters:
para [in] configuration parameters
Returns:
the generated filterbank information.

Definition at line 435 of file wav2mfcc-buffer.c.

Referenced by Wav2MFCC(), and WMP_init().

void FreeFBank FBankInfo  fb  ) 
 

Free FBankInfo.

Parameters:
fb [in] filterbank information

Definition at line 529 of file wav2mfcc-buffer.c.

Referenced by Wav2MFCC().

void MakeFBank float *  wave,
double *  fbank,
FBankInfo  fb,
Value  para,
float *  ssbuf
 

Convert wave -> (spectral subtraction) -> mel-frequency filterbank

Parameters:
wave [in] waveform data in the current frame
fbank [out] the resulting mel-frequency filterbank
fb [in] filterbank information
para [in] configuration parameters
ssbuf [in] noise spectrum, or NULL if not apply subtraction

Definition at line 547 of file wav2mfcc-buffer.c.

Referenced by Wav2MFCC(), and WMP_calc().

void MakeMFCC double *  fbank,
float *  mfcc,
Value  para
 

Apply DCT to filterbank to make MFCC.

Parameters:
fbank [in] filterbank
mfcc [out] output MFCC vector
para [in] configuration parameters

Definition at line 607 of file wav2mfcc-buffer.c.

Referenced by Wav2MFCC(), and WMP_calc().

float CalcC0 double *  fbank,
Value  para
 

Calculate 0'th cepstral coefficient.

Parameters:
fbank [in] filterbank
para [in] configuration parameters
Returns:

Definition at line 644 of file wav2mfcc-buffer.c.

Referenced by Wav2MFCC(), and WMP_calc().

void NormaliseLogE float **  mfcc,
int  frame_num,
Value  para
 

Normalise log energy

Parameters:
mfcc [i/o] array of MFCC vectors
frame_num [in] number of frames
para [in] configuration parameters

Definition at line 663 of file wav2mfcc-buffer.c.

Referenced by Wav2MFCC().

void Delta float **  c,
int  frame,
Value  para
 

Calculate delta coefficients

Parameters:
c [i/o] MFCC vectors, in which the delta coeff. will be appended.
frame [in] number of frames
para [in] configuration parameters

Definition at line 695 of file wav2mfcc-buffer.c.

Referenced by Wav2MFCC().

void Accel float **  c,
int  frame,
Value  para
 

Calculate acceleration coefficients.

Parameters:
c [i/o] MFCC vectors, in which the delta coeff. will be appended.
frame [in] number of frames
para [in] configuration parameters

Definition at line 744 of file wav2mfcc-buffer.c.

Referenced by Wav2MFCC().

void FFT float *  xRe,
float *  xIm,
int  p
 

Apply FFT

Parameters:
xRe [i/o] real part of waveform
xIm [i/o] imaginal part of waveform
p [in] 2^p = FFT point

Definition at line 782 of file wav2mfcc-buffer.c.

Referenced by MakeFBank(), and new_SS_calculate().

void CMN float **  mfcc,
int  frame_num,
int  dim
 

Cepstrum Mean Normalization (buffered) Cepstral mean will be computed within the given MFCC vectors.

Parameters:
mfcc [i/o] array of MFCC vectors
frame_num [in] number of frames
dim [in] total dimension of MFCC vectors

Definition at line 835 of file wav2mfcc-buffer.c.

Referenced by Wav2MFCC().


Generated on Tue Mar 28 16:03:42 2006 for Julius by  doxygen 1.4.2