 SignalProcessing - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Signal Processing : Conversions : SignalProcessing/Phase

SignalProcessing

 Phase
 compute the element-wise complex phase (angle) of an array of samples

 Calling Sequence Phase(A) Phase(Br, Bi)

Parameters

 A - Array of complex numeric values; the signal Br, Bi - Array of real numeric values corresponding to the real and imaginary parts of the signal

Options

 • container : Array, predefined Array for holding result

Description

 • The Phase(A) command computes the element-wise phase of the Array A and returns the result in an Array of datatype float.
 • The Phase(Br, Bi) command computes the element-wise phase of the complex numbers whose real and imaginary parts are stored separately in the Arrays Br and Bi and returns the result in an Array of datatype float.
 • Before the code performing the computation runs, the input Array(s) are converted to datatype complex (for the calling sequence with A) or float (for the calling sequence with Br and Bi) if they do not have this datatype already. For this reason, it is most efficient if the input Array(s) have this datatype beforehand.
 • If the container=C option is provided, then the results are put into C and C is returned. With this option, no additional memory is allocated to store the result. The container must be an Array having datatype float and the same size as A, Br or Bi.

 • The SignalProcessing[Phase] command is thread-safe as of Maple 17.

Examples

 > with( SignalProcessing ):
 > a := Array( [ 1. + I, 2. - 3. * I, 4., -1.*I ], 'datatype' = 'complex'[ 8 ] );
 ${a}{≔}\left[\begin{array}{cccc}{1.}{+}{I}& {2.}{-}{3.}{}{I}& {4.}{+}{0.}{}{I}& {-I}\end{array}\right]$ (1)
 > Phase( a );
 $\left[\begin{array}{c}{0.785398163397448}\\ {-0.982793723247329}\\ {0.}\\ {-1.57079632679490}\end{array}\right]$ (2)
 > c := Array( 1 .. numelems( a ), 'datatype' = 'float'[ 8 ] ):
 > Phase( a, 'container' = c );
 $\left[\begin{array}{c}{0.785398163397448}\\ {-0.982793723247329}\\ {0.}\\ {-1.57079632679490}\end{array}\right]$ (3)
 > c;
 $\left[\begin{array}{cccc}{0.785398163397448}& {-0.982793723247329}& {0.}& {-1.57079632679490}\end{array}\right]$ (4)
 > r := Array( [ 1., 2., 4., 0. ], 'datatype' = 'float'[ 8 ] );
 ${r}{≔}\left[\begin{array}{cccc}{1.}& {2.}& {4.}& {0.}\end{array}\right]$ (5)
 > i := Array( [ 1., -3., 0., -1. ], 'datatype' = 'float'[ 8 ] );
 ${i}{≔}\left[\begin{array}{cccc}{1.}& {-3.}& {0.}& {-1.}\end{array}\right]$ (6)
 > Phase( r, i );
 $\left[\begin{array}{c}{0.785398163397448}\\ {-0.982793723247329}\\ {0.}\\ {-1.57079632679490}\end{array}\right]$ (7)
 > Phase( r, i, 'container' = c );
 $\left[\begin{array}{c}{0.785398163397448}\\ {-0.982793723247329}\\ {0.}\\ {-1.57079632679490}\end{array}\right]$ (8)
 > c;
 $\left[\begin{array}{cccc}{0.785398163397448}& {-0.982793723247329}& {0.}& {-1.57079632679490}\end{array}\right]$ (9)
 > m := Array(1..2, 1..2, [[1. + I, 2. - I], [-3. + 2., -4. + 2 * I]], 'datatype' = 'complex'[ 8 ]);
 ${m}{≔}\left[\begin{array}{cc}{1.}{+}{I}& {2.}{-}{I}\\ {-1.}{+}{0.}{}{I}& {-4.}{+}{2.}{}{I}\end{array}\right]$ (10)
 > Phase( m );
 $\left[\begin{array}{cc}{0.785398163397448}& {-0.463647609000806}\\ {3.14159265358979}& {2.67794504458899}\end{array}\right]$ (11)
 > n := Array(1..2, 1..2, 'datatype' = 'float'[ 8 ] ):
 > Phase( m, 'container' = n );
 $\left[\begin{array}{cc}{0.785398163397448}& {-0.463647609000806}\\ {3.14159265358979}& {2.67794504458899}\end{array}\right]$ (12)
 > n;
 $\left[\begin{array}{cc}{0.785398163397448}& {-0.463647609000806}\\ {3.14159265358979}& {2.67794504458899}\end{array}\right]$ (13)

Compatibility

 • The SignalProcessing[Phase] command was introduced in Maple 17.