PocketSphinx  5.0.0
A small speech recognizer
Public Member Functions | List of all members
logmath_t Struct Reference

Integer log math computation class. More...

#include <pocketsphinx/logmath.h>

Public Member Functions

POCKETSPHINX_EXPORT logmath_tlogmath_init (float64 base, int shift, int use_table)
 
POCKETSPHINX_EXPORT logmath_tlogmath_read (const char *filename)
 
POCKETSPHINX_EXPORT int32 logmath_write (logmath_t *lmath, const char *filename)
 
POCKETSPHINX_EXPORT int32 logmath_get_table_shape (logmath_t *lmath, uint32 *out_size, uint32 *out_width, uint32 *out_shift)
 
POCKETSPHINX_EXPORT float64 logmath_get_base (logmath_t *lmath)
 
POCKETSPHINX_EXPORT int logmath_get_zero (logmath_t *lmath)
 
POCKETSPHINX_EXPORT int logmath_get_width (logmath_t *lmath)
 
POCKETSPHINX_EXPORT int logmath_get_shift (logmath_t *lmath)
 
POCKETSPHINX_EXPORT logmath_tlogmath_retain (logmath_t *lmath)
 
POCKETSPHINX_EXPORT int logmath_free (logmath_t *lmath)
 
POCKETSPHINX_EXPORT int logmath_add_exact (logmath_t *lmath, int logb_p, int logb_q)
 
POCKETSPHINX_EXPORT int logmath_add (logmath_t *lmath, int logb_p, int logb_q)
 
POCKETSPHINX_EXPORT int logmath_log (logmath_t *lmath, float64 p)
 
POCKETSPHINX_EXPORT float64 logmath_exp (logmath_t *lmath, int logb_p)
 
POCKETSPHINX_EXPORT int logmath_ln_to_log (logmath_t *lmath, float64 log_p)
 
POCKETSPHINX_EXPORT float64 logmath_log_to_ln (logmath_t *lmath, int logb_p)
 
POCKETSPHINX_EXPORT int logmath_log10_to_log (logmath_t *lmath, float64 log_p)
 
POCKETSPHINX_EXPORT float logmath_log10_to_log_float (logmath_t *lmath, float64 log_p)
 
POCKETSPHINX_EXPORT float64 logmath_log_to_log10 (logmath_t *lmath, int logb_p)
 
POCKETSPHINX_EXPORT float64 logmath_log_float_to_log10 (logmath_t *lmath, float log_p)
 

Detailed Description

Integer log math computation class.

Member Function Documentation

◆ logmath_init()

POCKETSPHINX_EXPORT logmath_t * logmath_init ( float64  base,
int  shift,
int  use_table 
)

Initialize a log math computation table.

Parameters
baseThe base B in which computation is to be done.
shiftLog values are shifted right by this many bits.
use_tableWhether to use an add table or not
Returns
The newly created log math table.

◆ logmath_read()

POCKETSPHINX_EXPORT logmath_t * logmath_read ( const char *  filename)

Memory-map (or read) a log table from a file.

◆ logmath_write()

POCKETSPHINX_EXPORT int32 logmath_write ( logmath_t lmath,
const char *  filename 
)

Write a log table to a file.

◆ logmath_get_table_shape()

POCKETSPHINX_EXPORT int32 logmath_get_table_shape ( logmath_t lmath,
uint32 *  out_size,
uint32 *  out_width,
uint32 *  out_shift 
)

Get the log table size and dimensions.

◆ logmath_get_base()

POCKETSPHINX_EXPORT float64 logmath_get_base ( logmath_t lmath)

Get the log base.

◆ logmath_get_zero()

POCKETSPHINX_EXPORT int logmath_get_zero ( logmath_t lmath)

Get the smallest possible value represented in this base.

◆ logmath_get_width()

POCKETSPHINX_EXPORT int logmath_get_width ( logmath_t lmath)

Get the width of the values in a log table.

◆ logmath_get_shift()

POCKETSPHINX_EXPORT int logmath_get_shift ( logmath_t lmath)

Get the shift of the values in a log table.

◆ logmath_retain()

POCKETSPHINX_EXPORT logmath_t * logmath_retain ( logmath_t lmath)

Retain ownership of a log table.

Returns
pointer to retained log table.

◆ logmath_free()

POCKETSPHINX_EXPORT int logmath_free ( logmath_t lmath)

Free a log table.

Returns
new reference count (0 if freed completely)

◆ logmath_add_exact()

POCKETSPHINX_EXPORT int logmath_add_exact ( logmath_t lmath,
int  logb_p,
int  logb_q 
)

Add two values in log space exactly and slowly (without using add table).

◆ logmath_add()

POCKETSPHINX_EXPORT int logmath_add ( logmath_t lmath,
int  logb_p,
int  logb_q 
)

Add two values in log space (i.e. return log(exp(p)+exp(q)))

◆ logmath_log()

POCKETSPHINX_EXPORT int logmath_log ( logmath_t lmath,
float64  p 
)

Convert linear floating point number to integer log in base B.

◆ logmath_exp()

POCKETSPHINX_EXPORT float64 logmath_exp ( logmath_t lmath,
int  logb_p 
)

Convert integer log in base B to linear floating point.

◆ logmath_ln_to_log()

POCKETSPHINX_EXPORT int logmath_ln_to_log ( logmath_t lmath,
float64  log_p 
)

Convert natural log (in floating point) to integer log in base B.

◆ logmath_log_to_ln()

POCKETSPHINX_EXPORT float64 logmath_log_to_ln ( logmath_t lmath,
int  logb_p 
)

Convert integer log in base B to natural log (in floating point).

◆ logmath_log10_to_log()

POCKETSPHINX_EXPORT int logmath_log10_to_log ( logmath_t lmath,
float64  log_p 
)

Convert base 10 log (in floating point) to integer log in base B.

◆ logmath_log10_to_log_float()

POCKETSPHINX_EXPORT float logmath_log10_to_log_float ( logmath_t lmath,
float64  log_p 
)

Convert base 10 log (in floating point) to float log in base B.

◆ logmath_log_to_log10()

POCKETSPHINX_EXPORT float64 logmath_log_to_log10 ( logmath_t lmath,
int  logb_p 
)

Convert integer log in base B to base 10 log (in floating point).

◆ logmath_log_float_to_log10()

POCKETSPHINX_EXPORT float64 logmath_log_float_to_log10 ( logmath_t lmath,
float  log_p 
)

Convert float log in base B to base 10 log.


The documentation for this struct was generated from the following file: