libsent/src/wav2mfcc/wav2mfcc-pipe.c File Reference

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

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

Include dependency graph for wav2mfcc-pipe.c:

Go to the source code of this file.

Data Structures

struct  CMEAN

Defines

#define CPMAX   500
 Maximum number of frames to store ceptral mean for CMN update.
#define CPSTEP   5
 clist allocate step

Functions

void WMP_init (Value para, float **bf, float *ssbuf, int ssbuflen)
DeltaBufWMP_deltabuf_new (int veclen, int windowlen)
void WMP_deltabuf_free (DeltaBuf *db)
void WMP_deltabuf_prepare (DeltaBuf *db)
static void WMP_deltabuf_calc (DeltaBuf *db, int cur)
boolean WMP_deltabuf_proceed (DeltaBuf *db, float *new_mfcc)
boolean WMP_deltabuf_flush (DeltaBuf *db)
void CMN_realtime_init (int dimension, float weight)
void CMN_realtime_prepare ()
void CMN_realtime (float *mfcc, int dim)
void CMN_realtime_update ()
static boolean myread (void *buf, size_t unitbyte, int unitnum, FILE *fp)
static boolean mywrite (void *buf, size_t unitbyte, int unitnum, int fd)
boolean CMN_load_from_file (char *filename, int dim)
boolean CMN_save_to_file (char *filename)
void energy_max_init ()
void energy_max_prepare (Value *para)
LOGPROB energy_max_normalize (LOGPROB f, Value *para)

Variables

static CMEANclist
 List of MFCC sum for previous inputs.
static int clist_max
 Allocated number of CMEAN in clist.
static int clist_num
 Currentlly filled CMEAN in clist.
static int dim
 Local workarea to store the number of MFCC dimension.
static float cweight
 Weight of initial cepstral mean.
static float * cmean_init
 Initial cepstral mean for each input.
static boolean cmean_init_set
 TRUE if cmean_init was set.
static CMEAN now
 Work area to hold current cepstral mean.
static LOGPROB energy_max_last
 Maximum energy value of last input.
static LOGPROB energy_min_last
 Minimum floored energy value of last input.
static LOGPROB energy_max
 Maximum energy value of current input.


Detailed Description

Convert speech inputs into MFCC parameter vectors (per input frame).

Author:
Akinobu LEE
Date:
Thu Feb 17 18:12:30 2005
There are functions are derived from wav2mfcc.c, to compute MFCC vectors in per-frame basis. When performing on-line recognition, these functions will be used instead of ones in wav2mfcc.c

Revision
1.9

Definition in file wav2mfcc-pipe.c.


Function Documentation

void WMP_init ( Value  para,
float **  bf,
float *  ssbuf,
int  ssbuflen 
)

initialize and setup buffers for a MFCC computataion.

Parameters:
para [in] configuration parameters
bf [out] pointer to the entry point of workspace for FFT
ssbuf [in] noise spectrum, or NULL if not using spectral subtraction
ssbuflen [in] length of above, ignoredwhen ssbuf is NULL

Definition at line 57 of file wav2mfcc-pipe.c.

Referenced by RealTimeInit(), and Wav2MFCC().

DeltaBuf* WMP_deltabuf_new ( int  veclen,
int  windowlen 
)

Allocate a new delta cycle buffer.

Parameters:
veclen [in] length of a vector
windowlen [in] window width for computing delta
Returns:
pointer to newly allocated delta cycle buffer structure.

Definition at line 83 of file wav2mfcc-pipe.c.

Referenced by RealTimeInit().

void WMP_deltabuf_free ( DeltaBuf db  ) 

Destroy the delta cycle buffer.

Parameters:
db [i/o] delta cycle buffer

Definition at line 110 of file wav2mfcc-pipe.c.

void WMP_deltabuf_prepare ( DeltaBuf db  ) 

Reset and clear the delta cycle buffer.

Parameters:
db [i/o] delta cycle buffer

Definition at line 128 of file wav2mfcc-pipe.c.

Referenced by RealTimePipeLinePrepare().

static void WMP_deltabuf_calc ( DeltaBuf db,
int  cur 
) [static]

Calculate delta coefficients of the specified point in the cycle buffer.

Parameters:
db [i/o] delta cycle buffer
cur [in] target point to calculate the delta coefficients

Definition at line 144 of file wav2mfcc-pipe.c.

Referenced by WMP_deltabuf_flush(), and WMP_deltabuf_proceed().

boolean WMP_deltabuf_proceed ( DeltaBuf db,
float *  new_mfcc 
)

Store the given MFCC vector into the delta cycle buffer, and compute the latest delta coefficients.

Parameters:
db [i/o] delta cycle buffer
new_mfcc [in] MFCC vector
Returns:
TRUE if next delta coeff. computed, in that case it is saved in db->delta[], or FALSE if delta is not yet computed by short of data.

Definition at line 187 of file wav2mfcc-pipe.c.

Referenced by RealTimeParam(), and RealTimePipeLine().

boolean WMP_deltabuf_flush ( DeltaBuf db  ) 

Flush the delta cycle buffer the delta coefficients left in the cycle buffer.

Parameters:
db [i/o] delta cycle buffer
Returns:
TRUE if next delta coeff. computed, in that case it is saved in db->delta[], or FALSE if all delta computation has been flushed and no data is available.

Definition at line 229 of file wav2mfcc-pipe.c.

Referenced by RealTimeParam().

void CMN_realtime_init ( int  dimension,
float  weight 
)

Initialize MAP-CMN at startup.

Parameters:
dimension [in] vector dimension
weight [in] initial cepstral mean weight

Definition at line 290 of file wav2mfcc-pipe.c.

Referenced by RealTimeInit().

void CMN_realtime_prepare (  ) 

Prepare for MAP-CMN at start of each input

Definition at line 317 of file wav2mfcc-pipe.c.

Referenced by RealTimePipeLinePrepare().

void CMN_realtime ( float *  mfcc,
int  dim 
)

Perform MAP-CMN for incoming MFCC vectors

Parameters:
mfcc [in] MFCC vector
dim [in] dimension

Definition at line 332 of file wav2mfcc-pipe.c.

Referenced by RealTimeParam(), and RealTimePipeLine().

void CMN_realtime_update (  ) 

Update initial cepstral mean from previous utterances for next input.

Definition at line 360 of file wav2mfcc-pipe.c.

Referenced by RealTimeCMNUpdate().

static boolean myread ( void *  buf,
size_t  unitbyte,
int  unitnum,
FILE *  fp 
) [static]

Read binary with byte swap (assume file is Big Endian)

Parameters:
buf [out] data buffer
unitbyte [in] size of unit in bytes
unitnum [in] number of units to be read
fp [in] file pointer
Returns:
TRUE if required number of units are fully read, FALSE if failed.

Definition at line 414 of file wav2mfcc-pipe.c.

static boolean mywrite ( void *  buf,
size_t  unitbyte,
int  unitnum,
int  fd 
) [static]

Write binary with byte swap (assume data is Big Endian)

Parameters:
buf [in] data buffer
unitbyte [in] size of unit in bytes
unitnum [in] number of units to write
fd [in] file descriptor
Returns:
TRUE if required number of units are fully written, FALSE if failed.

Definition at line 436 of file wav2mfcc-pipe.c.

boolean CMN_load_from_file ( char *  filename,
int  dim 
)

Load CMN parameter from file. If the number of MFCC dimension in the file does not match the specified one, an error will occur.

Parameters:
filename [in] file name
dim [in] required number of MFCC dimensions
Returns:
TRUE on success, FALSE on failure.

Definition at line 460 of file wav2mfcc-pipe.c.

Referenced by RealTimeInit().

boolean CMN_save_to_file ( char *  filename  ) 

Save the current CMN vector to a file.

Parameters:
filename [in] filename to save the data.
Returns:
TRUE on success, FALSE on failure.

Definition at line 504 of file wav2mfcc-pipe.c.

Referenced by RealTimeCMNUpdate().

void energy_max_init (  ) 

Initialize work area for energy normalization on live input. This should be called once on startup.

Definition at line 543 of file wav2mfcc-pipe.c.

Referenced by RealTimeInit().

void energy_max_prepare ( Value para  ) 

Prepare values for energy normalization on live input. This should be called before each input segment.

Parameters:
para [in] MFCC computation configuration parameter

Definition at line 555 of file wav2mfcc-pipe.c.

Referenced by RealTimePipeLinePrepare().

LOGPROB energy_max_normalize ( LOGPROB  f,
Value para 
)

Peform energy normalization using maximum of last input.

Parameters:
f [in] raw energy
para [in] MFCC computation configuration parameter
Returns:
value of the normalized log energy.

Definition at line 571 of file wav2mfcc-pipe.c.

Referenced by RealTimePipeLine().


Generated on Tue Dec 26 12:55:17 2006 for Julian by  doxygen 1.5.0