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

<!--
 *
 * This help file was generated from cohere.sci using help_from_sci().
 *
 -->

<refentry version="5.0-subset Scilab" xml:id="cohere" 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:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:scilab="http://www.scilab.org"
          xmlns:db="http://docbook.org/ns/docbook">

  <refnamediv>
    <refname>cohere</refname>
    <refpurpose>Estimate the coherence of signals using the Welch method.</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Syntax</title>
   <synopsis>
   [Pxx, freq] = cohere(x, y, Nfft, Fs, window, overlap, range, plot_type, detrend)
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
        <varlistentry>
            <term>x, y:</term>
            <listitem><para> Vectors. Input signals for coherence estimation.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>Nfft:</term>
            <listitem><para> Integer. Number of FFT points.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>Fs:</term>
            <listitem><para> Real scalar. Sampling frequency.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>window:</term>
            <listitem><para> Vector. Windowing function applied to each segment.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>overlap:</term>
            <listitem><para> Integer. Number of overlapping samples between segments.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>range:</term>
            <listitem><para> String. Frequency range for the analysis.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>plot_type:</term>
            <listitem><para> String. Type of plot to generate.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>detrend:</term>
            <listitem><para> String. Method for removing trends from the data.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>Pxx:</term>
            <listitem><para> Vector. Coherence estimate.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>freq:</term>
            <listitem><para> Vector. Frequency values corresponding to the coherence estimate.</para></listitem>
        </varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para>
This function estimates the coherence (mean square) of signals `x` and `y` using the Welch periodogram/FFT method. It is compatible with Matlab R11 `cohere` and earlier versions.
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
t = linspace(1,10,1000);
x =filter(0.3245,cos(t),t); y = filter(0.0034,x,sin(t));
cohere(x,y,700,1000,4,0.67,"half")
   ]]></programlisting>
</refsection>
</refentry>
