\doxysection{fe\+\_\+warp.\+c}
\label{fe__warp_8c_source}\index{src/libsphinxbase/fe/fe\_warp.c@{src/libsphinxbase/fe/fe\_warp.c}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*\ -\/*-\/\ c-\/basic-\/offset:\ 4;\ indent-\/tabs-\/mode:\ nil\ -\/*-\/\ */}}
\DoxyCodeLine{00002\ \textcolor{comment}{/*\ ====================================================================}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *\ Copyright\ (c)\ 2006\ Carnegie\ Mellon\ University.\ \ All\ rights\ }}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ reserved.}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ Redistribution\ and\ use\ in\ source\ and\ binary\ forms,\ with\ or\ without}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ modification,\ are\ permitted\ provided\ that\ the\ following\ conditions}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ are\ met:}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *\ 1.\ Redistributions\ of\ source\ code\ must\ retain\ the\ above\ copyright}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer.\ }}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ 2.\ Redistributions\ in\ binary\ form\ must\ reproduce\ the\ above\ copyright}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer\ in}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ \ \ \ the\ documentation\ and/or\ other\ materials\ provided\ with\ the}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *\ \ \ \ distribution.}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ *\ This\ work\ was\ supported\ in\ part\ by\ funding\ from\ the\ Defense\ Advanced\ }}
\DoxyCodeLine{00019\ \textcolor{comment}{\ *\ Research\ Projects\ Agency\ and\ the\ National\ Science\ Foundation\ of\ the\ }}
\DoxyCodeLine{00020\ \textcolor{comment}{\ *\ United\ States\ of\ America,\ and\ the\ CMU\ Sphinx\ Speech\ Consortium.}}
\DoxyCodeLine{00021\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00022\ \textcolor{comment}{\ *\ THIS\ SOFTWARE\ IS\ PROVIDED\ BY\ CARNEGIE\ MELLON\ UNIVERSITY\ \`{}\`{}AS\ IS''\ AND\ }}
\DoxyCodeLine{00023\ \textcolor{comment}{\ *\ ANY\ EXPRESSED\ OR\ IMPLIED\ WARRANTIES,\ INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ }}
\DoxyCodeLine{00024\ \textcolor{comment}{\ *\ THE\ IMPLIED\ WARRANTIES\ OF\ MERCHANTABILITY\ AND\ FITNESS\ FOR\ A\ PARTICULAR}}
\DoxyCodeLine{00025\ \textcolor{comment}{\ *\ PURPOSE\ ARE\ DISCLAIMED.\ \ IN\ NO\ EVENT\ SHALL\ CARNEGIE\ MELLON\ UNIVERSITY}}
\DoxyCodeLine{00026\ \textcolor{comment}{\ *\ NOR\ ITS\ EMPLOYEES\ BE\ LIABLE\ FOR\ ANY\ DIRECT,\ INDIRECT,\ INCIDENTAL,}}
\DoxyCodeLine{00027\ \textcolor{comment}{\ *\ SPECIAL,\ EXEMPLARY,\ OR\ CONSEQUENTIAL\ DAMAGES\ (INCLUDING,\ BUT\ NOT\ }}
\DoxyCodeLine{00028\ \textcolor{comment}{\ *\ LIMITED\ TO,\ PROCUREMENT\ OF\ SUBSTITUTE\ GOODS\ OR\ SERVICES;\ LOSS\ OF\ USE,\ }}
\DoxyCodeLine{00029\ \textcolor{comment}{\ *\ DATA,\ OR\ PROFITS;\ OR\ BUSINESS\ INTERRUPTION)\ HOWEVER\ CAUSED\ AND\ ON\ ANY\ }}
\DoxyCodeLine{00030\ \textcolor{comment}{\ *\ THEORY\ OF\ LIABILITY,\ WHETHER\ IN\ CONTRACT,\ STRICT\ LIABILITY,\ OR\ TORT\ }}
\DoxyCodeLine{00031\ \textcolor{comment}{\ *\ (INCLUDING\ NEGLIGENCE\ OR\ OTHERWISE)\ ARISING\ IN\ ANY\ WAY\ OUT\ OF\ THE\ USE\ }}
\DoxyCodeLine{00032\ \textcolor{comment}{\ *\ OF\ THIS\ SOFTWARE,\ EVEN\ IF\ ADVISED\ OF\ THE\ POSSIBILITY\ OF\ SUCH\ DAMAGE.}}
\DoxyCodeLine{00033\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00034\ \textcolor{comment}{\ *\ ====================================================================}}
\DoxyCodeLine{00035\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00036\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00037\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{00038\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00039\ \textcolor{comment}{\ *\ File:\ fe\_warp.c}}
\DoxyCodeLine{00040\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00041\ \textcolor{comment}{\ *\ Description:\ }}
\DoxyCodeLine{00042\ \textcolor{comment}{\ *\ \ \ \ \ \ Allows\ a\ caller\ to\ choose\ a\ warping\ function.}}
\DoxyCodeLine{00043\ \textcolor{comment}{\ *********************************************************************/}}
\DoxyCodeLine{00044\ }
\DoxyCodeLine{00045\ \textcolor{comment}{/*\ static\ char\ rcsid[]\ =\ "{}@(\#)\$Id:\ fe\_warp.c,v\ 1.2\ 2006/02/17\ 00:31:34\ egouvea\ Exp\ \$"{};*/}}
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00047\ \textcolor{preprocessor}{\#include\ "{}fe\_warp\_inverse\_linear.h"{}}}
\DoxyCodeLine{00048\ \textcolor{preprocessor}{\#include\ "{}fe\_warp\_affine.h"{}}}
\DoxyCodeLine{00049\ \textcolor{preprocessor}{\#include\ "{}fe\_warp\_piecewise\_linear.h"{}}}
\DoxyCodeLine{00050\ \textcolor{preprocessor}{\#include\ "{}fe\_warp.h"{}}}
\DoxyCodeLine{00051\ }
\DoxyCodeLine{00052\ \textcolor{preprocessor}{\#include\ "{}sphinxbase/err.h"{}}}
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00054\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{00055\ \textcolor{preprocessor}{\#include\ <string.h>}}
\DoxyCodeLine{00056\ \textcolor{preprocessor}{\#include\ <assert.h>}}
\DoxyCodeLine{00057\ \textcolor{preprocessor}{\#include\ <stdlib.h>}}
\DoxyCodeLine{00058\ }
\DoxyCodeLine{00059\ \textcolor{comment}{/*\ This\ is\ for\ aliases\ for\ each\ of\ the\ entries\ below.\ Currently\ not}}
\DoxyCodeLine{00060\ \textcolor{comment}{\ \ \ used.}}
\DoxyCodeLine{00061\ \textcolor{comment}{*/}}
\DoxyCodeLine{00062\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{char}\ *\_\_name2id[]\ =\ \{}
\DoxyCodeLine{00063\ \ \ \ \ \textcolor{stringliteral}{"{}inverse"{}},}
\DoxyCodeLine{00064\ \ \ \ \ \textcolor{stringliteral}{"{}linear"{}},}
\DoxyCodeLine{00065\ \ \ \ \ \textcolor{stringliteral}{"{}piecewise"{}},}
\DoxyCodeLine{00066\ \ \ \ \ NULL}
\DoxyCodeLine{00067\ \};}
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00069\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{char}\ *name2id[]\ =\ \{}
\DoxyCodeLine{00070\ \ \ \ \ \textcolor{stringliteral}{"{}inverse\_linear"{}},}
\DoxyCodeLine{00071\ \ \ \ \ \textcolor{stringliteral}{"{}affine"{}},}
\DoxyCodeLine{00072\ \ \ \ \ \textcolor{stringliteral}{"{}piecewise\_linear"{}},}
\DoxyCodeLine{00073\ \ \ \ \ NULL}
\DoxyCodeLine{00074\ \};}
\DoxyCodeLine{00075\ }
\DoxyCodeLine{00076\ \textcolor{keyword}{static}\ fe\_warp\_conf\_t\ fe\_warp\_conf[FE\_WARP\_ID\_MAX\ +\ 1]\ =\ \{}
\DoxyCodeLine{00077\ \ \ \ \ \{fe\_warp\_inverse\_linear\_set\_parameters,}
\DoxyCodeLine{00078\ \ \ \ \ \ fe\_warp\_inverse\_linear\_doc,}
\DoxyCodeLine{00079\ \ \ \ \ \ fe\_warp\_inverse\_linear\_id,}
\DoxyCodeLine{00080\ \ \ \ \ \ fe\_warp\_inverse\_linear\_n\_param,}
\DoxyCodeLine{00081\ \ \ \ \ \ fe\_warp\_inverse\_linear\_warped\_to\_unwarped,}
\DoxyCodeLine{00082\ \ \ \ \ \ fe\_warp\_inverse\_linear\_unwarped\_to\_warped,}
\DoxyCodeLine{00083\ \ \ \ \ \ fe\_warp\_inverse\_linear\_print\},\ \ \ \ \ \textcolor{comment}{/*\ Inverse\ linear\ warping\ */}}
\DoxyCodeLine{00084\ \ \ \ \ \{fe\_warp\_affine\_set\_parameters,}
\DoxyCodeLine{00085\ \ \ \ \ \ fe\_warp\_affine\_doc,}
\DoxyCodeLine{00086\ \ \ \ \ \ fe\_warp\_affine\_id,}
\DoxyCodeLine{00087\ \ \ \ \ \ fe\_warp\_affine\_n\_param,}
\DoxyCodeLine{00088\ \ \ \ \ \ fe\_warp\_affine\_warped\_to\_unwarped,}
\DoxyCodeLine{00089\ \ \ \ \ \ fe\_warp\_affine\_unwarped\_to\_warped,}
\DoxyCodeLine{00090\ \ \ \ \ \ fe\_warp\_affine\_print\},\ \ \ \ \ \textcolor{comment}{/*\ Affine\ warping\ */}}
\DoxyCodeLine{00091\ \ \ \ \ \{fe\_warp\_piecewise\_linear\_set\_parameters,}
\DoxyCodeLine{00092\ \ \ \ \ \ fe\_warp\_piecewise\_linear\_doc,}
\DoxyCodeLine{00093\ \ \ \ \ \ fe\_warp\_piecewise\_linear\_id,}
\DoxyCodeLine{00094\ \ \ \ \ \ fe\_warp\_piecewise\_linear\_n\_param,}
\DoxyCodeLine{00095\ \ \ \ \ \ fe\_warp\_piecewise\_linear\_warped\_to\_unwarped,}
\DoxyCodeLine{00096\ \ \ \ \ \ fe\_warp\_piecewise\_linear\_unwarped\_to\_warped,}
\DoxyCodeLine{00097\ \ \ \ \ \ fe\_warp\_piecewise\_linear\_print\},\ \ \ \textcolor{comment}{/*\ Piecewise\_Linear\ warping\ */}}
\DoxyCodeLine{00098\ \};}
\DoxyCodeLine{00099\ }
\DoxyCodeLine{00100\ \textcolor{keywordtype}{int}}
\DoxyCodeLine{00101\ fe\_warp\_set(melfb\_t\ *mel,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *id\_name)}
\DoxyCodeLine{00102\ \{}
\DoxyCodeLine{00103\ \ \ \ \ uint32\ i;}
\DoxyCodeLine{00104\ }
\DoxyCodeLine{00105\ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0;\ name2id[i];\ i++)\ \{}
\DoxyCodeLine{00106\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (strcmp(id\_name,\ name2id[i])\ ==\ 0)\ \{}
\DoxyCodeLine{00107\ \ \ \ \ \ \ \ \ \ \ \ \ mel-\/>warp\_id\ =\ i;}
\DoxyCodeLine{00108\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{00109\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00110\ \ \ \ \ \}}
\DoxyCodeLine{00111\ }
\DoxyCodeLine{00112\ \ \ \ \ \textcolor{keywordflow}{if}\ (name2id[i]\ ==\ NULL)\ \{}
\DoxyCodeLine{00113\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0;\ \_\_name2id[i];\ i++)\ \{}
\DoxyCodeLine{00114\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (strcmp(id\_name,\ \_\_name2id[i])\ ==\ 0)\ \{}
\DoxyCodeLine{00115\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ mel-\/>warp\_id\ =\ i;}
\DoxyCodeLine{00116\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{break};}
\DoxyCodeLine{00117\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00118\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00119\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\_\_name2id[i]\ ==\ NULL)\ \{}
\DoxyCodeLine{00120\ \ \ \ \ \ \ \ \ \ \ \ \ E\_ERROR(\textcolor{stringliteral}{"{}Unimplemented\ warping\ function\ \%s\(\backslash\)n"{}},\ id\_name);}
\DoxyCodeLine{00121\ \ \ \ \ \ \ \ \ \ \ \ \ E\_ERROR(\textcolor{stringliteral}{"{}Implemented\ functions\ are:\(\backslash\)n"{}});}
\DoxyCodeLine{00122\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0;\ name2id[i];\ i++)\ \{}
\DoxyCodeLine{00123\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fprintf(stderr,\ \textcolor{stringliteral}{"{}\(\backslash\)t\%s\(\backslash\)n"{}},\ name2id[i]);}
\DoxyCodeLine{00124\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00125\ \ \ \ \ \ \ \ \ \ \ \ \ mel-\/>warp\_id\ =\ FE\_WARP\_ID\_NONE;}
\DoxyCodeLine{00126\ }
\DoxyCodeLine{00127\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ FE\_START\_ERROR;}
\DoxyCodeLine{00128\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00129\ \ \ \ \ \}}
\DoxyCodeLine{00130\ }
\DoxyCodeLine{00131\ \ \ \ \ \textcolor{keywordflow}{return}\ FE\_SUCCESS;}
\DoxyCodeLine{00132\ \}}
\DoxyCodeLine{00133\ }
\DoxyCodeLine{00134\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{00135\ fe\_warp\_set\_parameters(melfb\_t\ *mel,\ \textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *param\_str,\ \textcolor{keywordtype}{float}\ sampling\_rate)}
\DoxyCodeLine{00136\ \{}
\DoxyCodeLine{00137\ \ \ \ \ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ <=\ FE\_WARP\_ID\_MAX)\ \{}
\DoxyCodeLine{00138\ \ \ \ \ \ \ \ \ fe\_warp\_conf[mel-\/>warp\_id].set\_parameters(param\_str,\ sampling\_rate);}
\DoxyCodeLine{00139\ \ \ \ \ \}}
\DoxyCodeLine{00140\ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ ==\ FE\_WARP\_ID\_NONE)\ \{}
\DoxyCodeLine{00141\ \ \ \ \ \ \ \ \ E\_FATAL(\textcolor{stringliteral}{"{}feat\ module\ must\ be\ configured\ w/\ a\ valid\ ID\(\backslash\)n"{}});}
\DoxyCodeLine{00142\ \ \ \ \ \}}
\DoxyCodeLine{00143\ \ \ \ \ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00144\ \ \ \ \ \ \ \ \ E\_FATAL}
\DoxyCodeLine{00145\ \ \ \ \ \ \ \ \ \ \ \ \ (\textcolor{stringliteral}{"{}fe\_warp\ module\ misconfigured\ with\ invalid\ fe\_warp\_id\ \%u\(\backslash\)n"{}},}
\DoxyCodeLine{00146\ \ \ \ \ \ \ \ \ \ \ \ \ \ mel-\/>warp\_id);}
\DoxyCodeLine{00147\ \ \ \ \ \}}
\DoxyCodeLine{00148\ \}}
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00150\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *}
\DoxyCodeLine{00151\ fe\_warp\_doc(melfb\_t\ *mel)}
\DoxyCodeLine{00152\ \{}
\DoxyCodeLine{00153\ \ \ \ \ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ <=\ FE\_WARP\_ID\_MAX)\ \{}
\DoxyCodeLine{00154\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ fe\_warp\_conf[mel-\/>warp\_id].doc();}
\DoxyCodeLine{00155\ \ \ \ \ \}}
\DoxyCodeLine{00156\ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ ==\ FE\_WARP\_ID\_NONE)\ \{}
\DoxyCodeLine{00157\ \ \ \ \ \ \ \ \ E\_FATAL(\textcolor{stringliteral}{"{}fe\_warp\ module\ must\ be\ configured\ w/\ a\ valid\ ID\(\backslash\)n"{}});}
\DoxyCodeLine{00158\ \ \ \ \ \}}
\DoxyCodeLine{00159\ \ \ \ \ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00160\ \ \ \ \ \ \ \ \ E\_FATAL}
\DoxyCodeLine{00161\ \ \ \ \ \ \ \ \ \ \ \ \ (\textcolor{stringliteral}{"{}fe\_warp\ module\ misconfigured\ with\ invalid\ fe\_warp\_id\ \%u\(\backslash\)n"{}},}
\DoxyCodeLine{00162\ \ \ \ \ \ \ \ \ \ \ \ \ \ mel-\/>warp\_id);}
\DoxyCodeLine{00163\ \ \ \ \ \}}
\DoxyCodeLine{00164\ }
\DoxyCodeLine{00165\ \ \ \ \ \textcolor{keywordflow}{return}\ NULL;}
\DoxyCodeLine{00166\ \}}
\DoxyCodeLine{00167\ }
\DoxyCodeLine{00168\ uint32}
\DoxyCodeLine{00169\ fe\_warp\_id(melfb\_t\ *mel)}
\DoxyCodeLine{00170\ \{}
\DoxyCodeLine{00171\ \ \ \ \ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ <=\ FE\_WARP\_ID\_MAX)\ \{}
\DoxyCodeLine{00172\ \ \ \ \ \ \ \ \ assert(mel-\/>warp\_id\ ==\ fe\_warp\_conf[mel-\/>warp\_id].id());}
\DoxyCodeLine{00173\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ mel-\/>warp\_id;}
\DoxyCodeLine{00174\ \ \ \ \ \}}
\DoxyCodeLine{00175\ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ !=\ FE\_WARP\_ID\_NONE)\ \{}
\DoxyCodeLine{00176\ \ \ \ \ \ \ \ \ E\_FATAL}
\DoxyCodeLine{00177\ \ \ \ \ \ \ \ \ \ \ \ \ (\textcolor{stringliteral}{"{}fe\_warp\ module\ misconfigured\ with\ invalid\ fe\_warp\_id\ \%u\(\backslash\)n"{}},}
\DoxyCodeLine{00178\ \ \ \ \ \ \ \ \ \ \ \ \ \ mel-\/>warp\_id);}
\DoxyCodeLine{00179\ \ \ \ \ \}}
\DoxyCodeLine{00180\ }
\DoxyCodeLine{00181\ \ \ \ \ \textcolor{keywordflow}{return}\ FE\_WARP\_ID\_NONE;}
\DoxyCodeLine{00182\ \}}
\DoxyCodeLine{00183\ }
\DoxyCodeLine{00184\ uint32}
\DoxyCodeLine{00185\ fe\_warp\_n\_param(melfb\_t\ *mel)}
\DoxyCodeLine{00186\ \{}
\DoxyCodeLine{00187\ \ \ \ \ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ <=\ FE\_WARP\_ID\_MAX)\ \{}
\DoxyCodeLine{00188\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ fe\_warp\_conf[mel-\/>warp\_id].n\_param();}
\DoxyCodeLine{00189\ \ \ \ \ \}}
\DoxyCodeLine{00190\ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ ==\ FE\_WARP\_ID\_NONE)\ \{}
\DoxyCodeLine{00191\ \ \ \ \ \ \ \ \ E\_FATAL(\textcolor{stringliteral}{"{}fe\_warp\ module\ must\ be\ configured\ w/\ a\ valid\ ID\(\backslash\)n"{}});}
\DoxyCodeLine{00192\ \ \ \ \ \}}
\DoxyCodeLine{00193\ \ \ \ \ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00194\ \ \ \ \ \ \ \ \ E\_FATAL}
\DoxyCodeLine{00195\ \ \ \ \ \ \ \ \ \ \ \ \ (\textcolor{stringliteral}{"{}fe\_warp\ module\ misconfigured\ with\ invalid\ fe\_warp\_id\ \%u\(\backslash\)n"{}},}
\DoxyCodeLine{00196\ \ \ \ \ \ \ \ \ \ \ \ \ \ mel-\/>warp\_id);}
\DoxyCodeLine{00197\ \ \ \ \ \}}
\DoxyCodeLine{00198\ }
\DoxyCodeLine{00199\ \ \ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{00200\ \}}
\DoxyCodeLine{00201\ }
\DoxyCodeLine{00202\ \textcolor{keywordtype}{float}}
\DoxyCodeLine{00203\ fe\_warp\_warped\_to\_unwarped(melfb\_t\ *mel,\ \textcolor{keywordtype}{float}\ nonlinear)}
\DoxyCodeLine{00204\ \{}
\DoxyCodeLine{00205\ \ \ \ \ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ <=\ FE\_WARP\_ID\_MAX)\ \{}
\DoxyCodeLine{00206\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ fe\_warp\_conf[mel-\/>warp\_id].warped\_to\_unwarped(nonlinear);}
\DoxyCodeLine{00207\ \ \ \ \ \}}
\DoxyCodeLine{00208\ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ ==\ FE\_WARP\_ID\_NONE)\ \{}
\DoxyCodeLine{00209\ \ \ \ \ \ \ \ \ E\_FATAL(\textcolor{stringliteral}{"{}fe\_warp\ module\ must\ be\ configured\ w/\ a\ valid\ ID\(\backslash\)n"{}});}
\DoxyCodeLine{00210\ \ \ \ \ \}}
\DoxyCodeLine{00211\ \ \ \ \ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00212\ \ \ \ \ \ \ \ \ E\_FATAL}
\DoxyCodeLine{00213\ \ \ \ \ \ \ \ \ \ \ \ \ (\textcolor{stringliteral}{"{}fe\_warp\ module\ misconfigured\ with\ invalid\ fe\_warp\_id\ \%u\(\backslash\)n"{}},}
\DoxyCodeLine{00214\ \ \ \ \ \ \ \ \ \ \ \ \ \ mel-\/>warp\_id);}
\DoxyCodeLine{00215\ \ \ \ \ \}}
\DoxyCodeLine{00216\ }
\DoxyCodeLine{00217\ \ \ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{00218\ \}}
\DoxyCodeLine{00219\ }
\DoxyCodeLine{00220\ \textcolor{keywordtype}{float}}
\DoxyCodeLine{00221\ fe\_warp\_unwarped\_to\_warped(melfb\_t\ *mel,\textcolor{keywordtype}{float}\ linear)}
\DoxyCodeLine{00222\ \{}
\DoxyCodeLine{00223\ \ \ \ \ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ <=\ FE\_WARP\_ID\_MAX)\ \{}
\DoxyCodeLine{00224\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ fe\_warp\_conf[mel-\/>warp\_id].unwarped\_to\_warped(linear);}
\DoxyCodeLine{00225\ \ \ \ \ \}}
\DoxyCodeLine{00226\ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ ==\ FE\_WARP\_ID\_NONE)\ \{}
\DoxyCodeLine{00227\ \ \ \ \ \ \ \ \ E\_FATAL(\textcolor{stringliteral}{"{}fe\_warp\ module\ must\ be\ configured\ w/\ a\ valid\ ID\(\backslash\)n"{}});}
\DoxyCodeLine{00228\ \ \ \ \ \}}
\DoxyCodeLine{00229\ \ \ \ \ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00230\ \ \ \ \ \ \ \ \ E\_FATAL}
\DoxyCodeLine{00231\ \ \ \ \ \ \ \ \ \ \ \ \ (\textcolor{stringliteral}{"{}fe\_warp\ module\ misconfigured\ with\ invalid\ fe\_warp\_id\ \%u\(\backslash\)n"{}},}
\DoxyCodeLine{00232\ \ \ \ \ \ \ \ \ \ \ \ \ \ mel-\/>warp\_id);}
\DoxyCodeLine{00233\ \ \ \ \ \}}
\DoxyCodeLine{00234\ }
\DoxyCodeLine{00235\ \ \ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{00236\ \}}
\DoxyCodeLine{00237\ }
\DoxyCodeLine{00238\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{00239\ fe\_warp\_print(melfb\_t\ *mel,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *label)}
\DoxyCodeLine{00240\ \{}
\DoxyCodeLine{00241\ \ \ \ \ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ <=\ FE\_WARP\_ID\_MAX)\ \{}
\DoxyCodeLine{00242\ \ \ \ \ \ \ \ \ fe\_warp\_conf[mel-\/>warp\_id].print(label);}
\DoxyCodeLine{00243\ \ \ \ \ \}}
\DoxyCodeLine{00244\ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (mel-\/>warp\_id\ ==\ FE\_WARP\_ID\_NONE)\ \{}
\DoxyCodeLine{00245\ \ \ \ \ \ \ \ \ E\_FATAL(\textcolor{stringliteral}{"{}fe\_warp\ module\ must\ be\ configured\ w/\ a\ valid\ ID\(\backslash\)n"{}});}
\DoxyCodeLine{00246\ \ \ \ \ \}}
\DoxyCodeLine{00247\ \ \ \ \ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00248\ \ \ \ \ \ \ \ \ E\_FATAL}
\DoxyCodeLine{00249\ \ \ \ \ \ \ \ \ \ \ \ \ (\textcolor{stringliteral}{"{}fe\_warp\ module\ misconfigured\ with\ invalid\ fe\_warp\_id\ \%u\(\backslash\)n"{}},}
\DoxyCodeLine{00250\ \ \ \ \ \ \ \ \ \ \ \ \ \ mel-\/>warp\_id);}
\DoxyCodeLine{00251\ \ \ \ \ \}}
\DoxyCodeLine{00252\ \}}
\DoxyCodeLine{00253\ }
\DoxyCodeLine{00254\ \textcolor{comment}{/*}}
\DoxyCodeLine{00255\ \textcolor{comment}{\ *\ Log\ record.\ \ Maintained\ by\ RCS.}}
\DoxyCodeLine{00256\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00257\ \textcolor{comment}{\ *\ \$Log:\ fe\_warp.c,v\ \$}}
\DoxyCodeLine{00258\ \textcolor{comment}{\ *\ Revision\ 1.2\ \ 2006/02/17\ 00:31:34\ \ egouvea}}
\DoxyCodeLine{00259\ \textcolor{comment}{\ *\ Removed\ switch\ -\/melwarp.\ Changed\ the\ default\ for\ window\ length\ to}}
\DoxyCodeLine{00260\ \textcolor{comment}{\ *\ 0.025625\ from\ 0.256\ (so\ that\ a\ window\ at\ 16kHz\ sampling\ rate\ has}}
\DoxyCodeLine{00261\ \textcolor{comment}{\ *\ exactly\ 410\ samples).\ Cleaned\ up\ include's.\ Replaced\ some\ E\_FATAL()}}
\DoxyCodeLine{00262\ \textcolor{comment}{\ *\ with\ E\_WARN()\ and\ return.}}
\DoxyCodeLine{00263\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00264\ \textcolor{comment}{\ *\ Revision\ 1.1\ \ 2006/02/16\ 00:18:26\ \ egouvea}}
\DoxyCodeLine{00265\ \textcolor{comment}{\ *\ Implemented\ flexible\ warping\ function.\ The\ user\ can\ specify\ at\ run}}
\DoxyCodeLine{00266\ \textcolor{comment}{\ *\ time\ which\ of\ several\ shapes\ they\ want\ to\ use.\ Currently\ implemented}}
\DoxyCodeLine{00267\ \textcolor{comment}{\ *\ are\ an\ affine\ function\ (y\ =\ ax\ +\ b),\ an\ inverse\ linear\ (y\ =\ a/x)\ and\ a}}
\DoxyCodeLine{00268\ \textcolor{comment}{\ *\ piecewise\ linear\ (y\ =\ ax,\ up\ to\ a\ frequency\ F,\ and\ then\ it\ "{}breaks"{}\ so}}
\DoxyCodeLine{00269\ \textcolor{comment}{\ *\ Nyquist\ frequency\ matches\ in\ both\ scales.}}
\DoxyCodeLine{00270\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00271\ \textcolor{comment}{\ *\ Added\ two\ switches,\ -\/warp\_type\ and\ -\/warp\_params.\ The\ first\ specifies}}
\DoxyCodeLine{00272\ \textcolor{comment}{\ *\ the\ type,\ which\ valid\ values:}}
\DoxyCodeLine{00273\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00274\ \textcolor{comment}{\ *\ -\/inverse\ or\ inverse\_linear}}
\DoxyCodeLine{00275\ \textcolor{comment}{\ *\ -\/linear\ or\ affine}}
\DoxyCodeLine{00276\ \textcolor{comment}{\ *\ -\/piecewise\ or\ piecewise\_linear}}
\DoxyCodeLine{00277\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00278\ \textcolor{comment}{\ *\ The\ inverse\_linear\ is\ the\ same\ as\ implemented\ by\ EHT.\ The\ -\/mel\_warp}}
\DoxyCodeLine{00279\ \textcolor{comment}{\ *\ switch\ was\ kept\ for\ compatibility\ (maybe\ remove\ it\ in\ the}}
\DoxyCodeLine{00280\ \textcolor{comment}{\ *\ future?).\ The\ code\ is\ compatible\ with\ EHT's\ changes:\ cepstra\ created}}
\DoxyCodeLine{00281\ \textcolor{comment}{\ *\ from\ code\ after\ his\ changes\ should\ be\ the\ same\ as\ now.\ Scripts\ that}}
\DoxyCodeLine{00282\ \textcolor{comment}{\ *\ worked\ with\ his\ changes\ should\ work\ now\ without\ changes.\ Tested\ a\ few}}
\DoxyCodeLine{00283\ \textcolor{comment}{\ *\ cases,\ same\ results.}}
\DoxyCodeLine{00284\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00285\ \textcolor{comment}{\ */}}

\end{DoxyCode}
