tied_mgau_common.h File Reference

Common code shared between SC and PTM (tied-state) models. More...

`#include <sphinxbase/logmath.h>`
`#include <sphinxbase/fixpoint.h>`

Go to the source code of this file.

## Macros

#define | MGAU_MIXW_VERSION "1.0" /* Sphinx-3 file format version for mixw */
#define | MGAU_PARAM_VERSION "1.0" /* Sphinx-3 file format version for mean/var */
#define | NONE -1
#define | WORST_DIST (int32)(0x80000000)
#define | GMMSUB(a, b) ((a)-(b))
| Subtract GMM component b (assumed to be positive) and saturate.
#define | GMMADD(a, b) ((a)+(b))
#define | MIN(a, b) ((a) < (b) ? (a) : (b))
#define | LOGMATH_INLINE static
#define | MAX_NEG_MIXW 159
| Maximum negated mixture weight value.
#define | MAX_NEG_ASCR 96
| Maximum negated acoustic score value.

## Functions

LOGMATH_INLINE int | fast_logmath_add (logmath_t *lmath, int mlx, int mly)
| Quickly log-add two negated log probabilities.

## Detailed Description

Common code shared between SC and PTM (tied-state) models.

Definition in file tied_mgau_common.h.

## Macro Definition Documentation

## GMMADD

#define GMMADD | ( |  | a,
|  |  | b
| ) |  | ((a)+(b))

Definition at line 63 of file tied_mgau_common.h.

## GMMSUB

#define GMMSUB | ( |  | a,
|  |  | b
| ) |  | ((a)-(b))

Subtract GMM component b (assumed to be positive) and saturate.

Definition at line 62 of file tied_mgau_common.h.

## LOGMATH_INLINE

#define LOGMATH_INLINE static

Definition at line 76 of file tied_mgau_common.h.

## MAX_NEG_ASCR

#define MAX_NEG_ASCR 96

Maximum negated acoustic score value.

Definition at line 83 of file tied_mgau_common.h.

## MAX_NEG_MIXW

#define MAX_NEG_MIXW 159

Maximum negated mixture weight value.

Definition at line 82 of file tied_mgau_common.h.

## MGAU_MIXW_VERSION

#define MGAU_MIXW_VERSION "1.0" /* Sphinx-3 file format version for mixw */

Definition at line 49 of file tied_mgau_common.h.

## MGAU_PARAM_VERSION

#define MGAU_PARAM_VERSION "1.0" /* Sphinx-3 file format version for mean/var */

Definition at line 50 of file tied_mgau_common.h.

## MIN

#define MIN | ( |  | a,
|  |  | b
| ) |  | ((a) < (b) ? (a) : (b))

Definition at line 67 of file tied_mgau_common.h.

## NONE

#define NONE -1

Definition at line 51 of file tied_mgau_common.h.

## WORST_DIST

#define WORST_DIST (int32)(0x80000000)

Definition at line 52 of file tied_mgau_common.h.

## Function Documentation

## fast_logmath_add()

LOGMATH_INLINE int fast_logmath_add | ( | logmath_t * | lmath,
|  | int | mlx,
|  | int | mly
| ) |  |

Quickly log-add two negated log probabilities.

Parameters

  lmath | The log-math object
  mlx | A negative log probability (0 < mlx < 255)
  mly | A negative log probability (0 < mly < 255)

Returns
  -log(exp(-mlx)+exp(-mly))

We can do some extra-fast log addition since we know that mixw+ascr is always less than 256 and hence x-y is also always less than 256. This relies on some cooperation from logmath_t which will never produce a logmath table smaller than 256 entries.

Note that the parameters are negated log probabilities (and hence, are positive numbers), as is the return value. This is the key to the "fastness" of this function.

Definition at line 103 of file tied_mgau_common.h.