summaryrefslogtreecommitdiff
path: root/modules/cacsd/help/en_US/phasemag.xml
blob: b2b6784dc132d2c36e67573c8bf01f8af8154455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA - 
 * 
 * This file must be used under the terms of the CeCILL.
 * This source file is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
 * are also available at    
 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
 *
 -->
<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" xml:id="phasemag">
    <refnamediv>
        <refname>phasemag</refname>
        <refpurpose>phase and magnitude
            computation
        </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Calling Sequence</title>
        <synopsis>[phi,db]=phasemag(z [,mod])</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>z</term>
                <listitem>
                    <para>matrix or row vector of complex numbers.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>mod</term>
                <listitem>
                    <para>character string</para>
                    <variablelist>
                        <varlistentry>
                            <term>mod='c'</term>
                            <listitem>
                                <para>"continuous" representation between -infinity and +360
                                    degrees (default)
                                </para>
                            </listitem>
                        </varlistentry>
                        <varlistentry>
                            <term>mod='m'</term>
                            <listitem>
                                <para>representation between -360 and 0 degrees</para>
                            </listitem>
                        </varlistentry>
                    </variablelist>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>phi</term>
                <listitem>
                    <para>
                        phases (in degree) of <literal>z</literal>.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>db</term>
                <listitem>
                    <para>magnitude (in Db)</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <literal>phasemag</literal> computes the phases and magnitudes of the entries
            of a complex matrix. For <literal>mod='c'</literal><literal>phasemag</literal>
            computes <literal>phi(:,i+1)</literal> to minimize the distance with
            <literal>phi(:,i)</literal>, i.e. it tries to obtain a "continuous
            representation" of the phase.
        </para>
        <para>To obtain the phase between -%pi and %pi use
            <literal>phi=atan(imag(z),real(z))</literal>
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[ 
s=poly(0,'s');
h=syslin('c',1/((s+5)*(s+10)*(100+6*s+s*s)*(s+.3)));
[frq,rf]=repfreq(h,0.1,20,0.005);
scf();
plot2d(frq',phasemag(rf,'c')');
scf();
plot2d(frq',phasemag(rf,'m')');
 ]]></programlisting>
        <scilab:image>
            s=poly(0,'s');
            h=syslin('c',1/((s+5)*(s+10)*(100+6*s+s*s)*(s+.3)));
            [frq,rf]=repfreq(h,0.1,20,0.005);
            plot2d(frq',phasemag(rf,'c')');
        </scilab:image>
        <scilab:image>
            s=poly(0,'s');
            h=syslin('c',1/((s+5)*(s+10)*(100+6*s+s*s)*(s+.3)));
            [frq,rf]=repfreq(h,0.1,20,0.005);
            plot2d(frq',phasemag(rf,'m')');
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>See Also</title>
        <simplelist type="inline">
            <member>
                <link linkend="repfreq">repfreq</link>
            </member>
            <member>
                <link linkend="gainplot">gainplot</link>
            </member>
            <member>
                <link linkend="atan">atan</link>
            </member>
            <member>
                <link linkend="bode">bode</link>
            </member>
        </simplelist>
    </refsection>
</refentry>