bug 12449: QUANT_f quantization methods were not behaving properly. Clarified documen...
[scilab.git] / scilab / modules / xcos / help / en_US / palettes / Signalprocessing_pal / QUANT_f.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scicos
4  *
5  * Copyright (C) INRIA - METALAU Project <scicos@inria.fr> (HTML version)
6  * Copyright (C) DIGITEO - Scilab Consortium (XML Docbook version)
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * See the file ./license.txt
23  -->
24 <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:id="QUANT_f">
25     <refnamediv>
26         <refname>QUANT_f</refname>
27         <refpurpose>Quantization</refpurpose>
28     </refnamediv>
29     <refsection>
30         <title>Block Screenshot</title>
31         <para>
32             <inlinemediaobject>
33                 <imageobject>
34                     <imagedata fileref="../../../../images/palettes/QUANT_f.png" align="center" valign="middle"/>
35                 </imageobject>
36             </inlinemediaobject>
37         </para>
38     </refsection>
39     <refsection id="Contents_QUANT_f">
40         <title>Contents</title>
41         <itemizedlist>
42             <listitem>
43                 <para>
44                     <link linkend="QUANT_f">Quantization</link>
45                 </para>
46             </listitem>
47             <listitem>
48                 <itemizedlist>
49                     <listitem>
50                         <para>
51                             <xref linkend="Palette_QUANT_f">Palette</xref>
52                         </para>
53                     </listitem>
54                     <listitem>
55                         <para>
56                             <xref linkend="Description_QUANT_f">Description</xref>
57                         </para>
58                     </listitem>
59                     <listitem>
60                         <para>
61                             <xref linkend="Dialogbox_QUANT_f">Dialog box</xref>
62                         </para>
63                     </listitem>
64                     <listitem>
65                         <para>
66                             <xref linkend="Defaultproperties_QUANT_f">Default properties</xref>
67                         </para>
68                     </listitem>
69                     <listitem>
70                         <para>
71                             <xref linkend="Interfacingfunction_QUANT_f">Interfacing function</xref>
72                         </para>
73                     </listitem>
74                     <listitem>
75                         <para>
76                             <xref linkend="Computationalfunction_QUANT_f">Computational function</xref>
77                         </para>
78                     </listitem>
79                 </itemizedlist>
80             </listitem>
81         </itemizedlist>
82     </refsection>
83     <refsection id="Palette_QUANT_f">
84         <title>Palette</title>
85         <itemizedlist>
86             <listitem>
87                 <para>
88                     <link linkend="Signalprocessing_pal">Signal processing palette</link>
89                 </para>
90             </listitem>
91         </itemizedlist>
92     </refsection>
93     <refsection id="Description_QUANT_f">
94         <title>Description</title>
95         <para>
96             This block outputs the quantization of the input according to a choice
97             of methods (quantization types):
98         </para>
99         <itemizedlist>
100             <listitem>
101                 <para>
102                     <emphasis role="bold">1: Round</emphasis>
103                 </para>
104                 <para>Rounding the number of quantization steps (output signal is the nearest step)</para>
105             </listitem>
106             <listitem>
107                 <para>
108                     <emphasis role="bold">2: Truncation</emphasis>
109                 </para>
110                 <para>Truncating the number of quantization steps (output signal is the nearest step towards 0)</para>
111             </listitem>
112             <listitem>
113                 <para>
114                     <emphasis role="bold">3: Floor</emphasis>
115                 </para>
116                 <para>Rounding down the number of quantization steps (output signal is the nearest step towards <latex>-\infty</latex>)</para>
117             </listitem>
118             <listitem>
119                 <para>
120                     <emphasis role="bold">4: Ceil</emphasis>
121                 </para>
122                 <para>Rounding up the number of quantization steps (output signal is the nearest step towards <latex>+\infty</latex>)</para>
123             </listitem>
124         </itemizedlist>
125     </refsection>
126     <refsection id="Dialogbox_QUANT_f">
127         <title>Dialog box</title>
128         <para>
129             <inlinemediaobject>
130                 <imageobject>
131                     <imagedata fileref="../../../../images/gui/QUANT_f_gui.gif" align="center" valign="middle"/>
132                 </imageobject>
133             </inlinemediaobject>
134         </para>
135         <para>
136             
137         </para>
138         <itemizedlist>
139             <listitem>
140                 <para>
141                     <emphasis role="bold">Step</emphasis>
142                 </para>
143                 <para> scalar, Quantization step</para>
144                 <para> Properties : Type 'vec' of size 1. </para>
145             </listitem>
146             <listitem>
147                 <para>
148                     <emphasis role="bold">Quantization Type</emphasis>
149                 </para>
150                 <para> scalar with possible values 1,2,3 or 4: the method of quantization used (respectively Truncation, Floor or Ceil)</para>
151                 <para>Properties : Type 'vec' of size 1.</para>
152             </listitem>
153         </itemizedlist>
154     </refsection>
155     <refsection id="Defaultproperties_QUANT_f">
156         <title>Default properties</title>
157         <itemizedlist>
158             <listitem>
159                 <para>
160                     <emphasis role="bold">always active:</emphasis> no
161                 </para>
162             </listitem>
163             <listitem>
164                 <para>
165                     <emphasis role="bold">direct-feedthrough:</emphasis> yes
166                 </para>
167             </listitem>
168             <listitem>
169                 <para>
170                     <emphasis role="bold">zero-crossing:</emphasis> no
171                 </para>
172             </listitem>
173             <listitem>
174                 <para>
175                     <emphasis role="bold">mode:</emphasis> no
176                 </para>
177             </listitem>
178             <listitem>
179                 <para>
180                     <emphasis role="bold">regular inputs:</emphasis>
181                 </para>
182                 <para>
183                     <emphasis role="bold">- port 1 : size [-1,1] / type 1</emphasis>
184                 </para>
185             </listitem>
186             <listitem>
187                 <para>
188                     <emphasis role="bold">regular outputs:</emphasis>
189                 </para>
190                 <para>
191                     <emphasis role="bold">- port 1 : size [-1,1] / type 1</emphasis>
192                 </para>
193             </listitem>
194             <listitem>
195                 <para>
196                     <emphasis role="bold">number/sizes of activation inputs:</emphasis> 0
197                 </para>
198             </listitem>
199             <listitem>
200                 <para>
201                     <emphasis role="bold">number/sizes of activation outputs:</emphasis> 0
202                 </para>
203             </listitem>
204             <listitem>
205                 <para>
206                     <emphasis role="bold">continuous-time state:</emphasis> no
207                 </para>
208             </listitem>
209             <listitem>
210                 <para>
211                     <emphasis role="bold">discrete-time state:</emphasis> no
212                 </para>
213             </listitem>
214             <listitem>
215                 <para>
216                     <emphasis role="bold">object discrete-time state:</emphasis> no
217                 </para>
218             </listitem>
219             <listitem>
220                 <para>
221                     <emphasis role="bold">name of computational function:</emphasis>
222                     <emphasis role="italic">qzrnd</emphasis>
223                 </para>
224             </listitem>
225         </itemizedlist>
226     </refsection>
227     <refsection id="Interfacingfunction_QUANT_f">
228         <title>Interfacing function</title>
229         <itemizedlist>
230             <listitem>
231                 <para> SCI/modules/scicos_blocks/macros/NonLinear/QUANT_f.sci</para>
232             </listitem>
233         </itemizedlist>
234     </refsection>
235     <refsection id="Computationalfunction_QUANT_f">
236         <title>Computational function</title>
237         <itemizedlist>
238             <listitem>
239                 <para> SCI/modules/scicos_blocks/src/fortran/qzrnd.f</para>
240             </listitem>
241             <listitem>
242                 <para> SCI/modules/scicos_blocks/src/fortran/qztrn.f</para>
243             </listitem>
244             <listitem>
245                 <para> SCI/modules/scicos_blocks/src/fortran/qzflr.f</para>
246             </listitem>
247             <listitem>
248                 <para> SCI/modules/scicos_blocks/src/fortran/qzcel.f</para>
249             </listitem>
250         </itemizedlist>
251     </refsection>
252     <refsection id="Example_QUANT_f">
253         <title>Example of a sine quantized every 0.2 step with the Ceil method (using the ceil value between two steps):</title>
254         <para>
255                 <link type="scilab" linkend="scilab.xcos/xcos/examples/signalprocessing_pal/QUANT_f_Example.zcos">
256                         <inlinemediaobject>
257                                 <imageobject>
258                                         <imagedata align="center" fileref="../../../../examples/signalprocessing_pal/QUANT_f_Example.zcos" valign="middle"/>
259                                 </imageobject>
260                         </inlinemediaobject>
261                 </link>
262         </para>
263         <para>
264                 <scilab:image><![CDATA[
265                         importXcosDiagram(SCI + "/modules/xcos/examples/signalprocessing_pal/QUANT_f_Example.zcos");
266                         xcos_simulate(scs_m, 4);
267                         title("Quantization of a sine","fontsize",3)
268                         ]]></scilab:image>
269         </para>
270         </refsection><refsection id="Example_QUANT_f_Quantization_mode">
271         <title>Comparison of the different quantization modes:</title>
272         <para>
273                 <link type="scilab" linkend="scilab.xcos/xcos/examples/signalprocessing_pal/QUANT_f_Example_Quantization_Mode.zcos">
274                         <inlinemediaobject>
275                                 <imageobject>
276                                         <imagedata align="center" fileref="../../../../examples/signalprocessing_pal/QUANT_f_Example_Quantization_Mode.zcos" valign="middle"/>
277                                 </imageobject>
278                         </inlinemediaobject>
279                 </link>
280         </para>
281         <para>
282                 <scilab:image><![CDATA[
283                         importXcosDiagram(SCI + "/modules/xcos/examples/signalprocessing_pal/QUANT_f_Example_Quantization_Mode.zcos");
284                         xcos_simulate(scs_m, 4);
285                         title("Rounding strategy for the quantization type","fontsize",3)
286                         ]]></scilab:image>
287         </para>
288     </refsection>
289 </refentry>