Bug #6009 fixed - conv2, convol2d and conv function added
[scilab.git] / scilab / modules / signal_processing / help / en_US / conv.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Add some comments about XML file
4 -->
5 <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" version="5.0-subset Scilab" xml:lang="en_US" xml:id="conv">
6   <info>
7     <pubdate>$LastChangedDate: 30-12-2011 $</pubdate>
8   </info>
9   <refnamediv>
10     <refname>conv</refname>
11     <refpurpose>discrete 1-D convolution. </refpurpose>
12   </refnamediv>
13   <refsynopsisdiv>
14     <title>Calling Sequence</title>
15     <synopsis>C = conv(A,B [,shape])</synopsis>
16   </refsynopsisdiv>
17   <refsection>
18     <title>Parameters</title>
19     <variablelist>
20       <varlistentry>
21         <term>A</term>
22         <listitem>
23           <para>
24             a real or complex vector.
25           </para>
26         </listitem>
27       </varlistentry>
28       <varlistentry>
29         <term>B</term>
30         <listitem>
31           <para>
32             a real or complex vector.
33           </para>
34         </listitem>
35       </varlistentry>
36       <varlistentry>
37         <term>shape</term>
38         <listitem>
39           <para>
40             an optional character string with possible values:
41           </para>
42           <itemizedlist>
43             <listitem><literal>"full"</literal>, <literal>conv</literal>
44               computes the full convolution. It is the
45               default value.
46             </listitem>
47             <listitem><literal>"same"</literal>, <literal>conv</literal>
48               computes the central part of the convolution of the same
49               size as <literal>A</literal>.
50             </listitem>
51             <listitem><literal>"valid"</literal>, <literal>conv</literal>
52               computes the convolution parts without the zero-padding
53               of <literal>A</literal>.
54             </listitem>
55           </itemizedlist>
56         </listitem>
57       </varlistentry>
58       <varlistentry>
59         <term>C</term>
60         <listitem>
61           <para>
62             a real or complex vector.
63           </para>
64         </listitem>
65       </varlistentry>
66     </variablelist>
67   </refsection>
68   <refsection>
69     <title>Description</title>
70     <para><literal>conv</literal> uses a straightforward formal
71        implementation of the one-dimensional convolution equation in
72        spatial form.
73     </para>
74     <para><literal>C=conv(A,B [,shape])</literal> computes the
75       one-dimensional convolution of the vectors <literal>A</literal>
76     and <literal>B</literal>:</para>
77     <itemizedlist>
78       <listitem> With <literal>shape=="full"</literal> the
79       dimensions of the result<literal>C</literal> are given by
80       <literal>size(A,'*')+size(B,'*')+1</literal>. The indices of the
81       center element of <literal>B</literal> are defined as
82       <literal>floor((size(B,'*')+1)/2)</literal>.
83       </listitem>
84       <listitem> With <literal>shape=="same"</literal> the
85       dimensions of the result<literal>C</literal> are given by
86       <literal>size(A)</literal>. The indices of the
87       center element of <literal>B</literal> are defined as
88       <literal>floor((size(B,'*')+1)/2)</literal>.
89       </listitem>
90       <listitem> With <literal>shape=="valid"</literal> the dimensions
91       of the result <literal>C</literal> are given by
92       <literal>size(A,'*')-size(B,'*')+1)</literal> if
93       <literal>and(size(A,'*')-size(B,'*'))&gt;=0</literal> else
94       <literal>C</literal> is empty . The indices of the center
95       element of <literal>B</literal> are defined as
96       <literal>1</literal>.
97       </listitem>
98     </itemizedlist>
99   </refsection>
100   <refsection>
101     <title>Examples</title>
102     <programlisting role="example"><![CDATA[
103         A=1:10;
104         B=[1 -1];
105         conv(A,B)
106     ]]></programlisting>
107   </refsection>
108   <refsection>
109     <title>See Also</title>
110     <simplelist type="inline">
111       <member>
112         <link linkend="convol">convol</link>
113       </member>
114       <member>
115         <link linkend="conv2">conv2</link>
116       </member>
117     </simplelist>
118   </refsection>
119   <refsection>
120     <title>Authors</title>
121     <simplelist type="vert">
122       <member>Serge Steer, INRIA</member>
123     </simplelist>
124   </refsection>
125   <refsection>
126     <title>Used Functions</title>
127     <para>
128          The conv function is based on the  <link linkend="conv2">conv2</link> builtin.
129        </para>
130   </refsection>
131   <refsection>
132     <title>History</title>
133     <revhistory>
134       <revision>
135         <revnumber>5.4.0</revnumber>
136         <revremark>Function conv introduced.</revremark>
137       </revision>
138     </revhistory>
139   </refsection>
140 </refentry>