1 <?xml version="1.0" encoding="UTF-8"?>
3 * Add some comments about XML file
5 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
6 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
7 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
8 xml:lang="en_US" xml:id="convol2d">
10 <refname>convol2d</refname>
11 <refpurpose>discrete 2-D convolution, using fft. </refpurpose>
15 <synopsis>C = convol2d(A, B)</synopsis>
18 <title>Parameters</title>
24 a real or complex 2-D array.
32 a real or complex 2-D array.
40 a real or complex 2-D array.
47 <title>Description</title>
49 <literal>convol2d</literal> uses fft to compute the full two-dimensional discrete
50 convolution. The dimensions of the result <varname>C</varname> are given by
51 <literal>size(A)+size(B)-1</literal>. The indices of the center element of
52 <varname>B</varname> are defined as <literal>floor((size(B)+1)/2)</literal>.
56 <title>Examples</title>
57 <programlisting role="example"><![CDATA[
58 s = [1 2 1; 0 0 0; -1 -2 -1] // Sobel horizontal edge kernel
59 A = zeros(10,10); A(3:7,3:7) = 1
64 --> s = [1 2 1; 0 0 0; -1 -2 -1] // Sobel horizontal edge kernel
70 --> A = zeros(10,10); A(3:7,3:7) = 1
72 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
73 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
74 0. 0. 1. 1. 1. 1. 1. 0. 0. 0.
75 0. 0. 1. 1. 1. 1. 1. 0. 0. 0.
76 0. 0. 1. 1. 1. 1. 1. 0. 0. 0.
77 0. 0. 1. 1. 1. 1. 1. 0. 0. 0.
78 0. 0. 1. 1. 1. 1. 1. 0. 0. 0.
79 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
80 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
81 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
83 --> C = convol2d(s, A);
86 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
87 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
88 0. 0. 1. 3. 4. 4. 4. 3. 1. 0. 0. 0.
89 0. 0. 1. 3. 4. 4. 4. 3. 1. 0. 0. 0.
90 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
91 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
92 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
93 0. 0. -1. -3. -4. -4. -4. -3. -1. 0. 0. 0.
94 0. 0. -1. -3. -4. -4. -4. -3. -1. 0. 0. 0.
95 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
96 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
97 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
100 <refsection role="see also">
101 <title>See also</title>
102 <simplelist type="inline">
104 <link linkend="conv2">conv2</link>
107 <link linkend="conv">conv</link>
110 <link linkend="convol">convol</link>
113 <link linkend="real">real</link>
116 <link linkend="clean">clean</link>
121 <title>History</title>
124 <revnumber>5.4.0</revnumber>
125 <revremark>Function convol2d introduced.</revremark>