<?xml version="1.0" encoding="UTF-8"?>

<!--
This file is part of the Scilab time frequency toolbox.
This file must be used under the terms of the  terms of the GNU General Public License 
as published by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Copyright (c) 1995 Rice University - CNRS (France) 1996.
-->

<refentry xml:id="correlmx" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:scilab="http://www.scilab.org"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook">


  <refnamediv>
    <refname>correlmx</refname><refpurpose>correlation matrix of a signal</refpurpose>
  </refnamediv>



  <refsynopsisdiv>
    <title>Calling Sequence</title>
    <synopsis>
      Rx=correlmx(x,p)
      Rx=correlmx(x,p,Rxtype)
    </synopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Parameters</title>
    <variablelist>
    
      <varlistentry>
        <term>x :</term>
        <listitem>
          <para>a real or complex vector of size Nx: the analyzed signal.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>p :</term>
        <listitem>
          <para>an integer in [1 Nx]: the last autocorrelation lag</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>Rxtype :</term>
        <listitem>
          <para> computation algorithm (default : 'fbhermitian')
          possible values : 'hermitian', 'fbhermitian', 'burg' or
          'fbburg'. The default value is 'hermitian'</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>Rx :</term>
        <listitem>
          <para>a real or complex matrix of size p+1 by p+1: the correlation matrix.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>

  <refsection>
    <title>Examples</title>
    <programlisting role="example"><![CDATA[
    N=1000; f=0.1;
    sig=real(fmconst(N,f))+0.2*rand(N,1,"normal");

    Rx=correlmx(sig,2,'burg'); 
    [v,d] = spec(Rx);
    acos(-0.5*v(2,1)/v(1,1))/(2*%pi) //should be near f

    Rx=correlmx(sig,2,'hermitian'); 
    [v,d] = spec(Rx);
    acos(-0.5*v(2,1)/v(1,1))/(2*%pi) //should be near f
    ]]></programlisting>
  </refsection>

  <refsection>
    <title>Authors</title>
    <simplelist type="vert">
      <member>H. Nahrstaedt - Aug 2010</member>
      <member>F. Auger, july 1998.</member>
    </simplelist>
  </refsection>
</refentry>
