\doxysection{include/sphinxbase/cmn.h File Reference}
\label{cmn_8h}\index{include/sphinxbase/cmn.h@{include/sphinxbase/cmn.h}}


Apply Cepstral Mean Normalization (CMN) to the set of input mfc frames.  


{\ttfamily \#include $<$sphinxbase/sphinxbase\+\_\+export.\+h$>$}\newline
{\ttfamily \#include $<$sphinxbase/prim\+\_\+type.\+h$>$}\newline
{\ttfamily \#include $<$sphinxbase/fe.\+h$>$}\newline
\doxysubsubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ cmn\+\_\+t}
\begin{DoxyCompactList}\small\item\em wrapper of operation of the cepstral mean normalization. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ CMN\+\_\+\+WIN\+\_\+\+HWM}~800     /$\ast$ \#frames after which window shifted $\ast$/
\item 
\#define \textbf{ CMN\+\_\+\+WIN}~500
\end{DoxyCompactItemize}
\doxysubsubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\label{cmn_8h_aa531ad5066da796fcd55e31121c1f943} 
typedef enum \textbf{ cmn\+\_\+type\+\_\+e} {\bfseries cmn\+\_\+type\+\_\+t}
\begin{DoxyCompactList}\small\item\em Types of cepstral mean normalization to apply to the features. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ cmn\+\_\+type\+\_\+e} \{ {\bfseries CMN\+\_\+\+NONE} = 0
, {\bfseries CMN\+\_\+\+CURRENT}
, {\bfseries CMN\+\_\+\+PRIOR}
 \}
\begin{DoxyCompactList}\small\item\em Types of cepstral mean normalization to apply to the features. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
SPHINXBASE\+\_\+\+EXPORT \textbf{ cmn\+\_\+type\+\_\+t} \textbf{ cmn\+\_\+type\+\_\+from\+\_\+str} (const char $\ast$str)
\begin{DoxyCompactList}\small\item\em Convert string representation (from command-\/line) to cmn\+\_\+type\+\_\+t. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT \textbf{ cmn\+\_\+t} $\ast$ \textbf{ cmn\+\_\+init} (int32 veclen)
\item 
SPHINXBASE\+\_\+\+EXPORT void \textbf{ cmn} (\textbf{ cmn\+\_\+t} $\ast$cmn, mfcc\+\_\+t $\ast$$\ast$mfc, int32 varnorm, int32 n\+\_\+frame)
\begin{DoxyCompactList}\small\item\em CMN for the whole sentence. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT void \textbf{ cmn\+\_\+prior} (\textbf{ cmn\+\_\+t} $\ast$\textbf{ cmn}, mfcc\+\_\+t $\ast$$\ast$incep, int32 varnorm, int32 nfr)
\begin{DoxyCompactList}\small\item\em CMN for one block of data, using prior mean. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT void \textbf{ cmn\+\_\+prior\+\_\+update} (\textbf{ cmn\+\_\+t} $\ast$\textbf{ cmn})
\begin{DoxyCompactList}\small\item\em Update prior mean based on observed data. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT void \textbf{ cmn\+\_\+prior\+\_\+set} (\textbf{ cmn\+\_\+t} $\ast$\textbf{ cmn}, mfcc\+\_\+t const $\ast$vec)
\begin{DoxyCompactList}\small\item\em Set the prior mean. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT void \textbf{ cmn\+\_\+prior\+\_\+get} (\textbf{ cmn\+\_\+t} $\ast$\textbf{ cmn}, mfcc\+\_\+t $\ast$vec)
\begin{DoxyCompactList}\small\item\em Get the prior mean. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT void \textbf{ cmn\+\_\+free} (\textbf{ cmn\+\_\+t} $\ast$\textbf{ cmn})
\end{DoxyCompactItemize}
\doxysubsubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
SPHINXBASE\+\_\+\+EXPORT const char $\ast$ \textbf{ cmn\+\_\+type\+\_\+str} [$\,$]
\begin{DoxyCompactList}\small\item\em String representations of cmn\+\_\+type\+\_\+t values. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Apply Cepstral Mean Normalization (CMN) to the set of input mfc frames. 

By subtractingthe mean of the input from each frame. C0 is also included in this process. This function operates on an entire utterance at a time. Hence, the entire utterance must be available beforehand (batchmode). 

Definition in file \textbf{ cmn.\+h}.



\doxysubsection{Macro Definition Documentation}
\label{cmn_8h_a500dafed8351d334da9290ec4f3f6ab3} 
\index{cmn.h@{cmn.h}!CMN\_WIN@{CMN\_WIN}}
\index{CMN\_WIN@{CMN\_WIN}!cmn.h@{cmn.h}}
\doxysubsubsection{CMN\_WIN}
{\footnotesize\ttfamily \#define CMN\+\_\+\+WIN~500}



Definition at line \textbf{ 152} of file \textbf{ cmn.\+h}.

\label{cmn_8h_abbf37b74032c295136b4b299ecfcedae} 
\index{cmn.h@{cmn.h}!CMN\_WIN\_HWM@{CMN\_WIN\_HWM}}
\index{CMN\_WIN\_HWM@{CMN\_WIN\_HWM}!cmn.h@{cmn.h}}
\doxysubsubsection{CMN\_WIN\_HWM}
{\footnotesize\ttfamily \#define CMN\+\_\+\+WIN\+\_\+\+HWM~800     /$\ast$ \#frames after which window shifted $\ast$/}



Definition at line \textbf{ 151} of file \textbf{ cmn.\+h}.



\doxysubsection{Enumeration Type Documentation}
\label{cmn_8h_a5bb134416e9e63a317eac20b0102bd59} 
\index{cmn.h@{cmn.h}!cmn\_type\_e@{cmn\_type\_e}}
\index{cmn\_type\_e@{cmn\_type\_e}!cmn.h@{cmn.h}}
\doxysubsubsection{cmn\_type\_e}
{\footnotesize\ttfamily enum \textbf{ cmn\+\_\+type\+\_\+e}}



Types of cepstral mean normalization to apply to the features. 



Definition at line \textbf{ 110} of file \textbf{ cmn.\+h}.



\doxysubsection{Function Documentation}
\label{cmn_8h_accf10de8ef4d98b4bf591529cf16565e} 
\index{cmn.h@{cmn.h}!cmn@{cmn}}
\index{cmn@{cmn}!cmn.h@{cmn.h}}
\doxysubsubsection{cmn()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT void cmn (\begin{DoxyParamCaption}\item[{\textbf{ cmn\+\_\+t} $\ast$}]{cmn,  }\item[{mfcc\+\_\+t $\ast$$\ast$}]{mfc,  }\item[{int32}]{varnorm,  }\item[{int32}]{n\+\_\+frame }\end{DoxyParamCaption})}



CMN for the whole sentence. 


\begin{DoxyParams}{Parameters}
{\em cmn} & In/\+Out\+: cmn normalization, which contains the cmn\+\_\+mean and cmn\+\_\+var)  \\
\hline
{\em mfc} & In/\+Out\+: mfc[f] = mfc vector in frame f  \\
\hline
{\em varnorm} & In\+: if not FALSE, variance normalize the input vectors to have unit variance (along each dimension independently); Irrelevant if no cmn is performed  \\
\hline
{\em n\+\_\+frame} & In\+: Number of frames of mfc vectors \\
\hline
\end{DoxyParams}


Definition at line \textbf{ 150} of file \textbf{ cmn.\+c}.



References \textbf{ cmn()}, \textbf{ E\+\_\+\+INFO}, and \textbf{ E\+\_\+\+INFOCONT}.



Referenced by \textbf{ cmn()}, \textbf{ cmn\+\_\+prior()}, \textbf{ cmn\+\_\+prior\+\_\+get()}, \textbf{ cmn\+\_\+prior\+\_\+set()}, \textbf{ cmn\+\_\+prior\+\_\+update()}, and \textbf{ feat\+\_\+init()}.

\label{cmn_8h_a0f70f378107e3d4e861e39d4f76d8d50} 
\index{cmn.h@{cmn.h}!cmn\_free@{cmn\_free}}
\index{cmn\_free@{cmn\_free}!cmn.h@{cmn.h}}
\doxysubsubsection{cmn\_free()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT void cmn\+\_\+free (\begin{DoxyParamCaption}\item[{\textbf{ cmn\+\_\+t} $\ast$}]{cmn }\end{DoxyParamCaption})}



Definition at line \textbf{ 216} of file \textbf{ cmn.\+c}.

\label{cmn_8h_a34489b2d17f9493351166a9a8f50968f} 
\index{cmn.h@{cmn.h}!cmn\_init@{cmn\_init}}
\index{cmn\_init@{cmn\_init}!cmn.h@{cmn.h}}
\doxysubsubsection{cmn\_init()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT \textbf{ cmn\+\_\+t} $\ast$ cmn\+\_\+init (\begin{DoxyParamCaption}\item[{int32}]{veclen }\end{DoxyParamCaption})}



Definition at line \textbf{ 131} of file \textbf{ cmn.\+c}.

\label{cmn_8h_aa622cf1b6a1b9a9bffd8f60b903bfc42} 
\index{cmn.h@{cmn.h}!cmn\_prior@{cmn\_prior}}
\index{cmn\_prior@{cmn\_prior}!cmn.h@{cmn.h}}
\doxysubsubsection{cmn\_prior()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT void cmn\+\_\+prior (\begin{DoxyParamCaption}\item[{\textbf{ cmn\+\_\+t} $\ast$}]{cmn,  }\item[{mfcc\+\_\+t $\ast$$\ast$}]{incep,  }\item[{int32}]{varnorm,  }\item[{int32}]{nfr }\end{DoxyParamCaption})}



CMN for one block of data, using prior mean. 


\begin{DoxyParams}{Parameters}
{\em cmn} & In/\+Out\+: cmn normalization, which contains the cmn\+\_\+mean and cmn\+\_\+var)  \\
\hline
{\em incep} & In/\+Out\+: mfc[f] = mfc vector in frame f  \\
\hline
{\em varnorm} & This flag should always be 0 for live  \\
\hline
{\em nfr} & Number of incoming frames \\
\hline
\end{DoxyParams}


Definition at line \textbf{ 146} of file \textbf{ cmn\+\_\+prior.\+c}.



References \textbf{ cmn()}, \textbf{ cmn\+\_\+prior()}, and \textbf{ E\+\_\+\+FATAL}.



Referenced by \textbf{ cmn\+\_\+prior()}.

\label{cmn_8h_a4f624f5b805288f66fa05b79b1e4f383} 
\index{cmn.h@{cmn.h}!cmn\_prior\_get@{cmn\_prior\_get}}
\index{cmn\_prior\_get@{cmn\_prior\_get}!cmn.h@{cmn.h}}
\doxysubsubsection{cmn\_prior\_get()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT void cmn\+\_\+prior\+\_\+get (\begin{DoxyParamCaption}\item[{\textbf{ cmn\+\_\+t} $\ast$}]{cmn,  }\item[{mfcc\+\_\+t $\ast$}]{vec }\end{DoxyParamCaption})}



Get the prior mean. 



Definition at line \textbf{ 84} of file \textbf{ cmn\+\_\+prior.\+c}.



References \textbf{ cmn()}, and \textbf{ cmn\+\_\+prior\+\_\+get()}.



Referenced by \textbf{ cmn\+\_\+prior\+\_\+get()}.

\label{cmn_8h_a0f6f70d51143d6a33130650b8d4758ab} 
\index{cmn.h@{cmn.h}!cmn\_prior\_set@{cmn\_prior\_set}}
\index{cmn\_prior\_set@{cmn\_prior\_set}!cmn.h@{cmn.h}}
\doxysubsubsection{cmn\_prior\_set()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT void cmn\+\_\+prior\+\_\+set (\begin{DoxyParamCaption}\item[{\textbf{ cmn\+\_\+t} $\ast$}]{cmn,  }\item[{mfcc\+\_\+t const $\ast$}]{vec }\end{DoxyParamCaption})}



Set the prior mean. 



Definition at line \textbf{ 62} of file \textbf{ cmn\+\_\+prior.\+c}.



References \textbf{ cmn()}, \textbf{ cmn\+\_\+prior\+\_\+set()}, \textbf{ E\+\_\+\+INFO}, and \textbf{ E\+\_\+\+INFOCONT}.



Referenced by \textbf{ cmn\+\_\+prior\+\_\+set()}.

\label{cmn_8h_aae61df2ec71082520669fc63d94bb1ef} 
\index{cmn.h@{cmn.h}!cmn\_prior\_update@{cmn\_prior\_update}}
\index{cmn\_prior\_update@{cmn\_prior\_update}!cmn.h@{cmn.h}}
\doxysubsubsection{cmn\_prior\_update()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT void cmn\+\_\+prior\+\_\+update (\begin{DoxyParamCaption}\item[{\textbf{ cmn\+\_\+t} $\ast$}]{cmn }\end{DoxyParamCaption})}



Update prior mean based on observed data. 



Definition at line \textbf{ 113} of file \textbf{ cmn\+\_\+prior.\+c}.



References \textbf{ cmn()}, \textbf{ cmn\+\_\+prior\+\_\+update()}, \textbf{ E\+\_\+\+INFO}, and \textbf{ E\+\_\+\+INFOCONT}.



Referenced by \textbf{ cmn\+\_\+prior\+\_\+update()}.

\label{cmn_8h_acf5e65a03a0d74630add4a400fed0ce8} 
\index{cmn.h@{cmn.h}!cmn\_type\_from\_str@{cmn\_type\_from\_str}}
\index{cmn\_type\_from\_str@{cmn\_type\_from\_str}!cmn.h@{cmn.h}}
\doxysubsubsection{cmn\_type\_from\_str()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT \textbf{ cmn\+\_\+type\+\_\+t} cmn\+\_\+type\+\_\+from\+\_\+str (\begin{DoxyParamCaption}\item[{const char $\ast$}]{str }\end{DoxyParamCaption})}



Convert string representation (from command-\/line) to cmn\+\_\+type\+\_\+t. 



Definition at line \textbf{ 118} of file \textbf{ cmn.\+c}.



References \textbf{ cmn\+\_\+type\+\_\+from\+\_\+str()}, \textbf{ cmn\+\_\+type\+\_\+str}, and \textbf{ E\+\_\+\+FATAL}.



Referenced by \textbf{ cmn\+\_\+type\+\_\+from\+\_\+str()}.



\doxysubsection{Variable Documentation}
\label{cmn_8h_ae2ab0bad7168386076c43fc2a421867f} 
\index{cmn.h@{cmn.h}!cmn\_type\_str@{cmn\_type\_str}}
\index{cmn\_type\_str@{cmn\_type\_str}!cmn.h@{cmn.h}}
\doxysubsubsection{cmn\_type\_str}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT const char$\ast$ cmn\+\_\+type\+\_\+str[$\,$]\hspace{0.3cm}{\ttfamily [extern]}}



String representations of cmn\+\_\+type\+\_\+t values. 



Definition at line \textbf{ 110} of file \textbf{ cmn.\+c}.



Referenced by \textbf{ cmn\+\_\+type\+\_\+from\+\_\+str()}, and \textbf{ feat\+\_\+init()}.

