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

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

<refentry version="5.0-subset Scilab" xml:id="mscohere" 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>mscohere</refname>
    <refpurpose>Estimate (mean square) coherence of signals x and y. Use the Welch (1967) periodogram/FFT method.</refpurpose>
  </refnamediv>


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

<refsection>
   <title>Description</title>
   <para>
See "help pwelch" for description of arguments, hints and references
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
// Generate example signals
fs = 1000                   // Sampling frequency in Hz
t = 0:1/fs:1-1/fs;           // Time vector (1 second)
// Signal x: a sine wave + random noise
x = sin(2*%pi*50*t) + 0.5*rand(size(t,1),size(t,2),'normal');
// Signal y: the same sine wave with different noise
y = sin(2*%pi*50*t) + 0.5*rand(size(t,1),size(t,2),'normal');
// Compute coherence
[Pxx, freq] = mscohere(x, y);
// Plot the result
plot(freq, Pxx);
title('Magnitude-Squared Coherence');
xlabel('Frequency (Hz)');
ylabel('Coherence');
xgrid;

   ]]></programlisting>
</refsection>

<refsection role="see also">
   <title>See also</title>
   <simplelist type="inline">
   <member><link linkend="pwelch">pwelch</link></member>
   </simplelist>
</refsection>
</refentry>
