summaryrefslogtreecommitdiff
path: root/help/en_US/peak2rms.xml
blob: 2dfe34c655fc58e1e82522d74d1543685167fb72 (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
<?xml version="1.0" encoding="UTF-8"?>

<!--
 *
 * This help file was generated from peak2rms.sci using help_from_sci().
 *
 -->

<refentry version="5.0-subset Scilab" xml:id="peak2rms" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:scilab="http://www.scilab.org"
          xmlns:db="http://docbook.org/ns/docbook">

  <refnamediv>
    <refname>peak2rms</refname>
    <refpurpose>This function calculates the ratio of peak magnitude to the Root Mean Square(RMS) value.</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Calling Sequence</title>
   <synopsis>
   OUT=peak2rms(IN)
   OUT=peak2rms(IN,orientation)
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
   <varlistentry><term>in:</term>
      <listitem><para>Vector or Matrix of real or complex elements.</para></listitem></varlistentry>
   <varlistentry><term>orientation:</term>
      <listitem><para> A string with possible values "r", "c" or "m" giving the dimension along which the peak2rms value is to be calculated.</para></listitem></varlistentry>
   <varlistentry><term>out:</term>
      <listitem><para>A scalar with real value when input is a vector.When input is a matrix, out is the peak magnitude to RMS  value along the orientation specified or the default one when not specified.</para></listitem></varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para>
For vector as input, the output is the ratio of peak value to the RMS value. The RMS value can be calculated by taking the square root of mean value of the squared sum of the elements.
   </para>
   <para>
When a matrix is given as input the output is peak to RMS ratio in the orientation specified.
The orientation can be given as  string with values "r","c" or "m".
   </para>
   <para>
peak2rms(in, 1) calculates the values of ratio of peak to RMS  of columns of matrix. The output in this case is a row vector with peak2rms value of each column of in.
   </para>
   <para>
peak2rms(in, 2) calculates the  values of ratio of peak to RMS of rows of   matrix, where the output would be a column vector having peak2rms value of each row of in.
   </para>
   <para>
The default orientation is chosen to be the index of first dimension of input greater than 1.Hence peak2rms(in) is equivalent to peak2rms(in, "m").
   </para>
   <para>
For an N dimensional array the orientation is the index of first non singleton dimension of the array.
   </para>
   <para>
If the elements of matrix are complex the absolute values are considered in the calculation of RMS value.
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
To calculate peak2rms of a vector:
IN=[6 19 10 25]
OUT=peak2rms(IN)
The output is OUT=
1.4927036

   ]]></programlisting>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
//To calculate peak2rms of rows of matrix:
IN=[1 3 5;2 4 6;7 8 9]
OUT=peak2rms(IN,2)
The output is
OUT= 1.4638501
1.3887301
1.119186
   ]]></programlisting>
</refsection>
</refentry>