Magnitude - Maple Help

SignalProcessing

 Magnitude
 compute the element-wise complex magnitude of an array of samples

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

Parameters

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

Options

 • container : Array, predefined Array for holding result

Description

 • The Magnitude(A) command computes the element-wise complex magnitude (absolute value) of the Array A and returns the result in an Array of datatype float[8].
 • The Magnitude(Br, Bi) command computes the element-wise complex magnitude 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[8].
 • Before the code performing the computation runs, the input Array(s) are converted to datatype complex[8] (for the calling sequence with A) or float[8] (for the calling sequence with Br and Bi) if they do not have that 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[8] and the same size as A, Br or Bi.

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

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$
 > $a≔\mathrm{Array}\left(\left[1.+I,2.-3.I,4.,-1.I\right],'\mathrm{datatype}'='\mathrm{complex}'\left[8\right]\right)$
 ${a}{≔}\left[\begin{array}{cccc}{1.}{+}{I}& {2.}{-}{3.}{}{I}& {4.}{+}{0.}{}{I}& {0.}{-}{I}\end{array}\right]$ (1)
 > $\mathrm{Magnitude}\left(a\right)$
 $\left[\begin{array}{cccc}{1.41421356237310}& {3.60555127546399}& {4.}& {1.}\end{array}\right]$ (2)
 > $c≔\mathrm{Array}\left(1..\mathrm{numelems}\left(a\right),'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right):$
 > $\mathrm{Magnitude}\left(a,'\mathrm{container}'=c\right)$
 $\left[\begin{array}{cccc}{1.41421356237310}& {3.60555127546399}& {4.}& {1.}\end{array}\right]$ (3)
 > $c$
 $\left[\begin{array}{cccc}{1.41421356237310}& {3.60555127546399}& {4.}& {1.}\end{array}\right]$ (4)
 > $r≔\mathrm{Array}\left(\left[1.,2.,4.,0.\right],'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right)$
 ${r}{≔}\left[\begin{array}{cccc}{1.}& {2.}& {4.}& {0.}\end{array}\right]$ (5)
 > $i≔\mathrm{Array}\left(\left[1.,-3.,0.,-1.\right],'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right)$
 ${i}{≔}\left[\begin{array}{cccc}{1.}& {-3.}& {0.}& {-1.}\end{array}\right]$ (6)
 > $\mathrm{Magnitude}\left(r,i\right)$
 $\left[\begin{array}{cccc}{1.41421356237310}& {3.60555127546399}& {4.}& {1.}\end{array}\right]$ (7)
 > $\mathrm{Magnitude}\left(r,i,'\mathrm{container}'=c\right)$
 $\left[\begin{array}{cccc}{1.41421356237310}& {3.60555127546399}& {4.}& {1.}\end{array}\right]$ (8)
 > $c$
 $\left[\begin{array}{cccc}{1.41421356237310}& {3.60555127546399}& {4.}& {1.}\end{array}\right]$ (9)
 > $m≔\mathrm{Array}\left(1..2,1..2,\left[\left[1.+I,2.-I\right],\left[-3.+2.,-4.+2I\right]\right],'\mathrm{datatype}'='\mathrm{complex}'\left[8\right]\right)$
 ${m}{≔}\left[\begin{array}{cc}{1.}{+}{I}& {2.}{-}{I}\\ {-1.}{+}{0.}{}{I}& {-4.}{+}{2.}{}{I}\end{array}\right]$ (10)
 > $\mathrm{Magnitude}\left(m\right)$
 $\left[\begin{array}{cc}{1.41421356237310}& {2.23606797749979}\\ {1.}& {4.47213595499958}\end{array}\right]$ (11)
 > $n≔\mathrm{Array}\left(1..2,1..2,'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right):$
 > $\mathrm{Magnitude}\left(m,'\mathrm{container}'=n\right)$
 $\left[\begin{array}{cc}{1.41421356237310}& {2.23606797749979}\\ {1.}& {4.47213595499958}\end{array}\right]$ (12)
 > $n$
 $\left[\begin{array}{cc}{1.41421356237310}& {2.23606797749979}\\ {1.}& {4.47213595499958}\end{array}\right]$ (13)

Compatibility

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