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:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en_US" xml:id="conv">
4 <refname>conv</refname>
5 <refpurpose>discrete 1-D convolution. </refpurpose>
9 <synopsis>C = conv(A,B [,shape])</synopsis>
12 <title>Parameters</title>
18 a real or complex vector.
26 a real or complex vector.
34 an optional character string with possible values:
38 <literal>"full"</literal>, <literal>conv</literal>
39 computes the full convolution. It is the
43 <literal>"same"</literal>, <literal>conv</literal>
44 computes the central part of the convolution of the same
45 size as <literal>A</literal>.
48 <literal>"valid"</literal>, <literal>conv</literal>
49 computes the convolution parts without the zero-padding
50 of <literal>A</literal>.
59 a real or complex vector.
66 <title>Description</title>
68 <literal>conv</literal> uses a straightforward formal
69 implementation of the one-dimensional convolution equation in
73 <literal>C=conv(A,B [,shape])</literal> computes the
74 one-dimensional convolution of the vectors <literal>A</literal>
75 and <literal>B</literal>:
79 With <literal>shape=="full"</literal> the
80 dimensions of the result<literal>C</literal> are given by
81 <literal>size(A,'*')+size(B,'*')+1</literal>. The indices of the
82 center element of <literal>B</literal> are defined as
83 <literal>floor((size(B,'*')+1)/2)</literal>.
86 With <literal>shape=="same"</literal> the
87 dimensions of the result<literal>C</literal> are given by
88 <literal>size(A)</literal>. The indices of the
89 center element of <literal>B</literal> are defined as
90 <literal>floor((size(B,'*')+1)/2)</literal>.
93 With <literal>shape=="valid"</literal> the dimensions
94 of the result <literal>C</literal> are given by
95 <literal>size(A,'*')-size(B,'*')+1)</literal> if
96 <literal>and(size(A,'*')-size(B,'*'))>=0</literal> else
97 <literal>C</literal> is empty . The indices of the center
98 element of <literal>B</literal> are defined as
103 Note that <link linkend="convol">convol</link> can be more efficient for large arrays.
107 <title>Examples</title>
108 <programlisting role="example"><![CDATA[
114 <refsection role="see also">
115 <title>See also</title>
116 <simplelist type="inline">
118 <link linkend="convol">convol</link>
121 <link linkend="conv2">conv2</link>
126 <title>Used Functions</title>
128 The conv function is based on the <link linkend="conv2">conv2</link> builtin.
132 <title>History</title>
135 <revnumber>5.4.0</revnumber>
136 <revremark>Function conv introduced.</revremark>