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>

Go to the source code of this file.

Functions

DeltaBufWMP_deltabuf_new (int veclen, int windowlen)
 Allocate a new delta cycle buffer.
void WMP_deltabuf_free (DeltaBuf *db)
 Destroy the delta cycle buffer.
void WMP_deltabuf_prepare (DeltaBuf *db)
 Reset and clear the delta cycle buffer.
static void WMP_deltabuf_calc (DeltaBuf *db, int cur)
 Calculate delta coefficients of the specified point in the cycle buffer.
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.
boolean WMP_deltabuf_flush (DeltaBuf *db)
 Flush the delta cycle buffer the delta coefficients left in the cycle buffer.
CMNWorkCMN_realtime_new (int dimension, float weight)
 Initialize MAP-CMN at startup.
void CMN_realtime_free (CMNWork *c)
 Free work area for real-time CMN.
void CMN_realtime_prepare (CMNWork *c)
 Prepare for MAP-CMN at start of each input.
void CMN_realtime (CMNWork *c, float *mfcc)
 Perform MAP-CMN for incoming MFCC vectors.
void CMN_realtime_update (CMNWork *c)
 Update initial cepstral mean from previous utterances for next input.
static boolean myread (void *buf, size_t unitbyte, int unitnum, FILE *fp)
 Read binary with byte swap (assume file is Big Endian).
static boolean mywrite (void *buf, size_t unitbyte, size_t unitnum, int fd)
 Write binary with byte swap (assume data is Big Endian).
boolean CMN_load_from_file (CMNWork *c, char *filename)
 Load CMN parameter from file.
boolean CMN_save_to_file (CMNWork *c, char *filename)
 Save the current CMN vector to a file.
void energy_max_init (ENERGYWork *energy)
 Initialize work area for energy normalization on live input.
void energy_max_prepare (ENERGYWork *energy, Value *para)
 Prepare values for energy normalization on live input.
LOGPROB energy_max_normalize (ENERGYWork *energy, LOGPROB f, Value *para)
 Peform energy normalization using maximum of last input.


Detailed Description

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

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

Author:
Akinobu LEE
Date:
Thu Feb 17 18:12:30 2005
Revision
1.1.1.1

Definition in file wav2mfcc-pipe.c.


Function Documentation

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 59 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 86 of file wav2mfcc-pipe.c.

Referenced by j_mfcccalc_free().

void WMP_deltabuf_prepare ( DeltaBuf db  ) 

Reset and clear the delta cycle buffer.

Parameters:
db [i/o] delta cycle buffer

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

Referenced by reset_mfcc().

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 120 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 163 of file wav2mfcc-pipe.c.

Referenced by RealTimeMFCC(), and RealTimeParam().

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 205 of file wav2mfcc-pipe.c.

Referenced by RealTimeParam().

CMNWork* CMN_realtime_new ( int  dimension,
float  weight 
)

Initialize MAP-CMN at startup.

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

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

Referenced by RealTimeInit().

void CMN_realtime_free ( CMNWork c  ) 

Free work area for real-time CMN.

Parameters:
c [i/o] CMN calculation work area

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

Referenced by j_mfcccalc_free().

void CMN_realtime_prepare ( CMNWork c  ) 

Prepare for MAP-CMN at start of each input.

Parameters:
c [i/o] CMN calculation work area

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

Referenced by RealTimePipeLinePrepare().

void CMN_realtime ( CMNWork c,
float *  mfcc 
)

Perform MAP-CMN for incoming MFCC vectors.

Parameters:
c [i/o] CMN calculation work area
mfcc [in] MFCC vector

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

Referenced by RealTimeMFCC(), and RealTimeParam().

void CMN_realtime_update ( CMNWork c  ) 

Update initial cepstral mean from previous utterances for next input.

Parameters:
c [i/o] CMN calculation work area

Definition at line 343 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 397 of file wav2mfcc-pipe.c.

static boolean mywrite ( void *  buf,
size_t  unitbyte,
size_t  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 419 of file wav2mfcc-pipe.c.

boolean CMN_load_from_file ( CMNWork c,
char *  filename 
)

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:
c [i/o] CMN calculation work area
filename [in] file name
Returns:
TRUE on success, FALSE on failure.

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

Referenced by RealTimeInit().

boolean CMN_save_to_file ( CMNWork c,
char *  filename 
)

Save the current CMN vector to a file.

Parameters:
c [i/o] CMN calculation work area
filename [in] filename to save the data.
Returns:
TRUE on success, FALSE on failure.

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

Referenced by RealTimeCMNUpdate().

void energy_max_init ( ENERGYWork energy  ) 

Initialize work area for energy normalization on live input.

This should be called once on startup.

Parameters:
energy [in] energy normalization work area

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

Referenced by RealTimeInit().

void energy_max_prepare ( ENERGYWork energy,
Value para 
)

Prepare values for energy normalization on live input.

This should be called before each input segment.

Parameters:
energy [in] energy normalization work area
para [in] MFCC computation configuration parameter

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

Referenced by reset_mfcc().

LOGPROB energy_max_normalize ( ENERGYWork energy,
LOGPROB  f,
Value para 
)

Peform energy normalization using maximum of last input.

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

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

Referenced by RealTimeMFCC().


Generated on Tue Dec 18 16:01:41 2007 for Julius by  doxygen 1.5.4