| 1 | <refentry id="phs"> |
| 2 | <indexterm id="IndexPhs"><primary>phs</primary></indexterm> |
| 3 | |
| 4 | <refentryinfo><title>Array Operations: complex numbers</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>phs</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>phs</refname> |
| 11 | <refpurpose> |
| 12 | Obtains the phases of a complex-number array |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | This opcode returns the phases of a complex-number array, as a real-valued array with half the size of its input plus one. The reason for the extra point is to keep the array size equivalent to the output of the mags opcode (which is often used alongside this one). |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis>kout[] <command>phs</command> kin[]</synopsis> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Performance</title> |
| 30 | <para> |
| 31 | <emphasis>kout[]</emphasis> -- output array containing the phases. It will be created if it does not exist. |
| 32 | </para> |
| 33 | <para> |
| 34 | <emphasis>kin[]</emphasis> -- input array containing the complex-valued real-imaginary input. |
| 35 | </para> |
| 36 | </refsect1> |
| 37 | |
| 38 | <refsect1> |
| 39 | <title>Examples</title> |
| 40 | <para> |
| 41 | Here is an example of the phs opcode. It uses the file <ulink |
| 42 | url="examples/phs.csd"><citetitle>phs.csd</citetitle></ulink>.</para> |
| 43 | |
| 44 | <example> |
| 45 | <title>Example of the phs opcode.</title> |
| 46 | |
| 47 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 48 | <xi:include href="examples-xml/phs.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 49 | </example> |
| 50 | </refsect1> |
| 51 | |
| 52 | <refsect1> |
| 53 | <title>See Also</title> |
| 54 | <para><link linkend="vectorial"><citetitle></citetitle>Vectorial opcodes</link></para> |
| 55 | <para><link linkend="arrayOpcodes"><citetitle></citetitle>array opcodes</link></para> |
| 56 | <para><link linkend="arraysfft"><citetitle></citetitle>Array-based spectral opcodes</link></para> |
| 57 | </refsect1> |
| 58 | |
| 59 | <refsect1> |
| 60 | <title>Credits</title> |
| 61 | <para> |
| 62 | <simplelist> |
| 63 | <member>Author: &namevictor;</member> |
| 64 | <member>NUI Maynooth</member> |
| 65 | <member>2014</member> |
| 66 | </simplelist> |
| 67 | </para> |
| 68 | <para>New in version 6.04</para> |
| 69 | </refsect1> |
| 70 | </refentry> |