Motorola DSP Developer's Kit | ![]() ![]() |
Y = mot###_abs( X )
Description
This function returns the magnitude of the input complex vector/sqrt(2). The input vector X is a complex vector
Input/Output
Input: Complex vector X (includes real part Xr
, and imaginary part Xi
)
Algorithm
for ( i=0; i <size( X ); i++ ) { Intervalue = Xr[i] * Xr[i]; Intervalue += Xi[i] * Xi[i]; y[i] = sqrt-sr(Intervalue >> 1); }
Note
If absolute values are desired, the scaling up factor is sqrt(2). For a description of function sqrt-sr , refer to sqrt-sr.asm .
|
Memory & Register
Memory allocation and register usage:
Status Register
The assembly function abs-c.asm
does not explicitly set any status register bits during the function execution.
Data Size Limit
The length of vector X is limited by the size of available continuous data memory.
Data Range Limit
The input vector X range is [-1.0, +1.0].
Precision
In the case of DSP563, precision is 23 bits.
In the case of DSP566, precision is 15 bits.
Performance Limit
In the case of DSP563, there are 222 cycles for each element of input data.
In the case of DSP566, there are 150 cycles for each element of input data.
![]() | abs-r.asm | angle-c.asm | ![]() |