ms_gauden.h
Go to the documentation of this file.
/* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* ====================================================================
* Copyright (c) 1999-2004 Carnegie Mellon University. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* This work was supported in part by funding from the Defense Advanced
* Research Projects Agency and the National Science Foundation of the
* United States of America, and the CMU Sphinx Speech Consortium.
*
* THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
* NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ====================================================================
*
*/
#ifndef _LIBFBS_GAUDEN_H_
#define _LIBFBS_GAUDEN_H_
/* SphinxBase headers. */
#include <sphinxbase/feat.h>
#include <sphinxbase/logmath.h>
#include <sphinxbase/cmd_ln.h>
/* Local headers. */
#include "vector.h"
#include "pocketsphinx_internal.h"
#include "hmm.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
int32 id;
mfcc_t dist;
} gauden_dist_t;
typedef struct {
mfcc_t ****mean;
mfcc_t ****var;
mfcc_t ***det;
logmath_t *lmath;
int32 n_mgau;
int32 n_feat;
int32 n_density;
int32 *featlen;
} gauden_t;
gauden_t *
gauden_init (char const *meanfile,
char const *varfile,
float32 varfloor,
logmath_t *lmath
);
void gauden_free(gauden_t *g);
int32 gauden_mllr_transform(gauden_t *s, ps_mllr_t *mllr, cmd_ln_t *config);
int32
gauden_dist (gauden_t *g,
int mgau,
int n_top,
mfcc_t **obs,
gauden_dist_t **out_dist
);
void gauden_dump (const gauden_t *g
);
void gauden_dump_ind (const gauden_t *g,
int senidx
);
#ifdef __cplusplus
}
#endif
#endif /* GAUDEN_H */
hmm.h
Implementation of HMM base structure.
gauden_free
void gauden_free(gauden_t *g)
Release memory allocated by gauden_init.
Definition ms_gauden.c:358
gauden_dist
int32 gauden_dist(gauden_t *g, int mgau, int n_top, mfcc_t **obs, gauden_dist_t **out_dist)
Compute gaussian density values for the given input observation vector wrt the specified mixture gaus...
gauden_dump
void gauden_dump(const gauden_t *g)
Dump the definitionn of Gaussian distribution.
Definition ms_gauden.c:58
gauden_dump_ind
void gauden_dump_ind(const gauden_t *g, int senidx)
Dump the definition of Gaussian distribution of a particular index to the standard output stream.
Definition ms_gauden.c:68
gauden_mllr_transform
int32 gauden_mllr_transform(gauden_t *s, ps_mllr_t *mllr, cmd_ln_t *config)
Transform Gaussians according to an MLLR matrix (or, eventually, more).
Definition ms_gauden.c:509
gauden_init
gauden_t * gauden_init(char const *meanfile, char const *varfile, float32 varfloor, logmath_t *lmath)
Read mixture gaussian codebooks from the given files.
Definition ms_gauden.c:311
pocketsphinx_internal.h
Internal implementation of PocketSphinx decoder.
gauden_dist_t
Structure to store distance (density) values for a given input observation wrt density values in some...
Definition ms_gauden.h:71
gauden_dist_t::id
int32 id
Index of codeword (gaussian density)
Definition ms_gauden.h:72
gauden_dist_t::dist
mfcc_t dist
Density value for input observation wrt above codeword; NOTE: result in logs3 domain,...
Definition ms_gauden.h:73
gauden_t
Multivariate gaussian mixture density parameters.
Definition ms_gauden.h:82
gauden_t::var
mfcc_t **** var
like mean; diagonal covariance vector only
Definition ms_gauden.h:84
gauden_t::det
mfcc_t *** det
log(determinant) for each variance vector; actually, log(sqrt(2*pi*det))
Definition ms_gauden.h:85
gauden_t::n_feat
int32 n_feat
Number feature streams in each codebook.
Definition ms_gauden.h:89
gauden_t::mean
mfcc_t **** mean
mean[codebook][feature][codeword] vector
Definition ms_gauden.h:83
gauden_t::n_density
int32 n_density
Number gaussian densities in each codebook-feature stream.
Definition ms_gauden.h:90
gauden_t::featlen
int32 * featlen
feature length for each feature
Definition ms_gauden.h:91
gauden_t::lmath
logmath_t * lmath
log math computation
Definition ms_gauden.h:87
gauden_t::n_mgau
int32 n_mgau
Number codebooks.
Definition ms_gauden.h:88
ps_mllr_s
Feature space linear transform structure.
Definition acmod.h:82