<?php $isip_window_title = "ISIP Homepage"; ?>
<?php include("/data/isip/www/templates/documentation/header/header.html"); ?>

<!--#set var="isip_page_title" value="LogAreaRatio" -->
<?php include("/data/isip/www/templates/documentation/body/index_class.html"); ?>
<?php include("/data/isip/www/templates/documentation/body/bar.html"); ?>

<a name="name">
<b>
name:
<a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h">LogAreaRatio</a> : public <a href="../AlgorithmBase/index.html">AlgorithmBase</a>
</b>

<br><br>

<a name="synopsis">
<b>synopsis:</b>
<br><br>

<blockquote>
<pre>
g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_algo.a

#include &lt;LogAreaRatio.h&gt;

LogAreaRatio(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, long order = DEF_ORDER);
boolean eq(const LogAreaRatio& arg);
boolean setAlgorithm(ALGORITHM algorithm);
boolean compute(VectorFloat& vector_out, const VectorFloat& vector_in, AlgorithmData::COEF_TYPE input_coef_type = DEF_COEF_TYPE, long index = DEF_CHANNEL_INDEX);
</pre>
</blockquote>

<a name="quick_start">
<b>quick start:</b>
<br><br>

<blockquote>
<pre>
LogAreaRatio lar;
VectorFloat input(L"1, 0, -1");
VectorFloat output;
lar.setAlgorithm(LATTICE);
lar.compute(output, input, AlgorithmData::REFLECTION);
</pre>
</blockquote>

<a name="description"> 
<b>description:</b>
<br><br>

The LogAreaRatio class is used to compute the log area ratio coefficients
from a linear predictive model. A more detailed discussion of
this approach can be found in:

<ul>
  J.D. Markel and A.H. Gray,
  <i>Linear Prediction of Speech</i>,
  Springer-Verlag, New York, New York, USA, pp. 229-235, 1980.
</ul>

The input signal can either be the reflection coefficients or the
prediction coefficients. LATTICE algorithm and KELLY_LOCHBAUM
implementation is currently supported.

<br><br>

The mathematical descriptions of these algorithms are provided below
for reference purposes:

<br><br>

<center>
<img src="./index_table_00.jpg">
</center>

<br>

Log area ratios have historically been useful in speech coding
and synthesis applications, since they directly describe (in theory)
the vocal tract area function. They have not been used extensively in
speech recognition applications.

<br><br>

<a name="dependencies">
<b>dependencies:</b>
<br><br>

<ul>
  <li> <a href="../AlgorithmBase/index.html">AlgorithmBase</a>
  <li> <a href="../Reflection/index.html">Reflection.h</a>
</ul>

<a name="constants">
<b>public constants:</b>
<br><br>

<ul>
  <li> define the class name:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_00.cc&constant=CLASS_NAME">static const String CLASS_NAME = L"LogAreaRatio";</a></pre>
       
  <li> define the algorithm choices:

       <pre>enum ALGORITHM { LATTICE = 0, DEF_ALGORITHM = LATTICE };</pre>

  <li> define the implementation choices:

       <pre>enum IMPLEMENTATION { KELLY_LOCHBAUM = 0,  DEF_IMPLEMENTATION = KELLY_LOCHBAUM };</pre>

  <li> define the static NameMap objects

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_00.cc&constant=ALGO_MAP">static const NameMap LogAreaRatio::ALGO_MAP(L"LATTICE");</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_00.cc&constant=IMPL_MAP">static const NameMap LogAreaRatio::IMPL_MAP(L"KELLY_LOCHBAUM");</a></pre>

  <li>define i/o related constants:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_00.cc&constant=DEF_PARAM">static const String LogAreaRatio::DEF_PARAM = L"";</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_00.cc&constant=PARAM_ALGORITHM">static const String LogAreaRatio::PARAM_ALGORITHM = L"algorithm";</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_00.cc&constant=PARAM_IMPLEMENTATION">static const String LogAreaRatio::PARAM_IMPLEMENTATION = L"implementation";</a></pre>       

  <li> define default argument(s):
       
       <pre>static const AlgorithmData::COEF_TYPE DEF_COEF_TYPE = AlgorithmData::REFLECTION;</pre>
</ul>

<a name="error">
<b>error codes:</b>
<br><br>

<ul>
  <li> error code indicating LogAreaRatio class general error:

       <pre><a href="/perl/ifc_document.pl?err=00073000">static const long ERR = 73000;</a></pre>
</ul>

<a name="protected">
<b>protected data:</b>
<br><br>

<ul>
  <li> algorithm name:
       
       <pre>ALGORITHM algorithm_d;</pre>

  <li> implementation name

       <pre>IMPLEMENTATION implementation_d;</pre>
       
  <li> static memory manager:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_00.cc&static=mgr_d">static MemoryManager mgr_d;</a></pre>
</ul>

<a name="public">
<b>required public methods:</b>
<br><br>

<ul>
  <li> static methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=name">static const String& name();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_02.cc&method=diagnose">static boolean diagnose(Integral::DEBUG debug_level);</a></pre>

  <li> debug methods: setDebug method is inherited from base class
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_01.cc&method=debug">boolean debug(const unichar* message) const;</a></pre>
       
  <li> destructor/constructor(s):
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=destructor">~LogAreaRatio();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=default+constructor">LogAreaRatio(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, long order = DEF_ORDER);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=copy+constructor">LogAreaRatio(const LogAreaRatio& arg);</a></pre>

  <li> assign methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_00.cc&method=assign&instance=0">boolean assign(const LogAreaRatio& arg);</a></pre>
       
  <li> operator= methods:
       
      <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=operator%3D&instance=0">LogAreaRatio& operator= (const LogAreaRatio& arg);</a></pre>
              
  <li> i/o methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_04.cc&method=sofSize">long sofSize() const;</a></pre>     
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_03.cc&method=read">boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);</a></pre>     
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_04.cc&method=write">boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;</a></pre>     
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_03.cc&method=readData">boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);</a></pre>     
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_04.cc&method=writeData">boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;</a></pre>     

  <li> equality methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_00.cc&method=eq&instance=0">boolean eq(const LogAreaRatio& arg) const;</a></pre>
       
  <li> memory management methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=new">static void* operator new(size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=new\[\]">static void* operator new[](size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=delete">static void operator delete(void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=delete\[\]">static void operator delete[](void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=setGrowSize">static boolean setGrowSize(long grow_size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_00.cc&method=clear">boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);</a></pre>
</ul>

<a name="specific">
<b>class-specific public methods:</b>
<br><br>

<ul>
  <li> set methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=setAlgorithm">boolean setAlgorithm(ALGORITHM algorithm);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=setImplementation">boolean setImplementation(IMPLEMENTATION implementation);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=setOrder">boolean setOrder(long order);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=set">boolean set(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, long order = DEF_ORDER);</a></pre>

  <li> get methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=getAlgorithm">ALGORITHM getAlgorithm() const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=getImplementation">IMPLEMENTATION getImplementation() const;</a></pre>       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=getOrder">long getOrder() const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=get">boolean get(ALGORITHM& algorithm, IMPLEMENTATION& implementation, long& order);</a></pre>

  <li> computational methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_05.cc&method=compute&instance=0">boolean compute(VectorFloat& output, const VectorFloat& input, AlgorithmData::COEF_TYPE input_coef_type = DEF_COEF_TYPE, long index);</a></pre>
  
  <li> AlgorithmBase interface contract methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_00.cc&method=assign&instance=1">boolean assign(const AlgorithmBase& arg);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_00.cc&method=eq&instance=1">boolean eq(const AlgorithmBase& arg) const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/LogAreaRatio.h&method=className">const String& className() const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_05.cc&method=apply">boolean apply(Vector&lt;CircularBuffer&lt;AlgorithmData&gt;&gt;& output, const Vector&lt;AlgorithmData&gt;& input);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_03.cc&method=setParser">boolean setParser(SofParser* parser);</a></pre>
</ul>

<a name="private">
<b>private methods:</b>
<br><br>

<ul>       
  <li> common i/o methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_03.cc&method=readDataCommon&instance=0">boolean readDataCommon(Sof& sof, const String& pname, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_04.cc&method=writeDataCommon&instance=0">boolean writeDataCommon(Sof& sof, const String& pname = DEF_PARAM) const;</a></pre>

  <li> algorithm and implementation specific computational methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/algo/LogAreaRatio/lar_05.cc&method=computeLatticeKellyLochbaum">boolean computeLatticeKellyLochbaum(VectorFloat& output, const VectorFloat& input);</a></pre>       
</ul>
       
<a name="examples">
<b>examples:</b>
<br><br>

<ul>
  <li> This example shows how to compute the log area ratios from
       the reflection coefficients:

<pre>
// declare an LogAreaRatio object and an output vector
//
LogAreaRatio lar;
VectorFloat output;

// set the input vector
//
VectorFloat input(L"0, 1, 2");

// chooose algorithm
//
lar.setAlgorithm(LogAreaRatio::LATTICE);

// chooose implementation
//
lar.setImplementation(LogAreaRatio::KELLY_LOCHBAUM);

// compute the LogAreaRatio of input data
//
lar.compute(output, input, AlgorithmData::REFLECTION);</pre>
</ul>

<a name="notes">
<b>notes:</b>
<br><br>

<ul>
  <li> none.
</ul>

<!--#include virtual="/hse/ies/templates/documentation/footer/footer.html" -->
