1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry 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:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="convol" xml:lang="en">
4 <refname>convol</refname>
5 <refpurpose>convolution</refpurpose>
15 <title>Arguments</title>
20 <para>a vector, first input sequence ("short" one) </para>
26 <para>a vector, second input sequence ( "long" one)</para>
32 <para>a vector,old tail to overlap add (not used in first
40 <para>a vector, the convolution. </para>
46 <para>new tail to overlap add (not used in last call)</para>
52 <title>Description</title>
54 Calculates the convolution <literal>y= h*x</literal> of two discrete
55 sequences by using the fft. The convolution is defined as follows:
68 <mml:mo mml:stretchy="false">=</mml:mo>
72 <mml:mo mml:stretchy="false">∑</mml:mo>
80 <mml:mo mml:stretchy="false">∗</mml:mo>
86 <mml:mo mml:stretchy="false">+</mml:mo>
89 <mml:mo mml:stretchy="false">−</mml:mo>
95 <mml:annotation mml:encoding="StarMath 5.0">y_k=sum_j h_j*x_{k+1-j}
103 <para>Overlap add method can be used.</para>
104 <para>USE OF OVERLAP ADD METHOD: For
105 <literal>x=[x1,x2,...,xNm1,xN]</literal> First call is
106 <literal>[y1,e1]=convol(h,x1);</literal> Subsequent calls :
107 <literal>[yk,ek]=convol(h,xk,ekm1)</literal>; Final call :
108 <literal>[yN]=convol(h,xN,eNm1);</literal> Finally
109 <literal>y=[y1,y2,...,yNm1,yN]</literal>.
111 <para>The algorithm based on the convolution definition is
112 implemented for polynomial
113 product: <literal>y=convol(h,x)</literal> is equivalent
114 to <literal>y=coeff(poly(h,'z','c')*poly(x,'z','c')</literal> but
115 much more efficient if <literal>x</literal> is a "long" array.
119 <title>Examples</title>
120 <programlisting role="example"><![CDATA[
122 h1=[1,0,0,0,0];h2=[0,1,0,0,0];h3=[0,0,1,0,0];
123 x1=convol(h1,x),x2=convol(h2,x),x3=convol(h3,x),
125 p1=poly(x,'x','coeff')
126 p2=poly(h1+h2+h3,'x','coeff')
130 <refsection role="see also">
131 <title>See also</title>
132 <simplelist type="inline">
134 <link linkend="corr">corr</link>
137 <link linkend="fft">fft</link>
140 <link linkend="pspect">pspect</link>