Motorola DSP Developer's Kit |
Motorola DSP Developer's Kit | ![]() ![]() |
[y] = mot###_mean( X )
This function returns the mean value of the elements in complex input vector X
Input/Output
Input: Complex vector X, which includes vector Xr (real part of input X) and vector Xi (imaginary part of input X)
Output: scalar y, which includes yr (the mean value of the real elements in X), yi (the mean value of the imaginary elements in X)
Algorithm
yr = yi = 0; for(i=0; i<size; i++) { yr += Xr[i]; yi += Xi[i]; } yr = div (yr, size); yi = div (yi, size);
Memory & Register
IN start address of location of input complex vector X.
X memory IN_REAL start address of real data of X
Y memory IN_IMAG start address of imaginary data of X
Register X0 store number of items in the array
Register X1 store Result of mean value(real)
Register Y1 store Result of mean value(imaginary)
Register R7 store bits/word, used by division (24 for 56300,16 for 56600)
Status Register
The assembly function mean-r.asm does not explicitly set any status registers/bits during the function execution.
Data Size Limit
The length of vector X can't be larger than the continuous available data memory size.
Data Range Limit
Input data vector X range [-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
![]() | mean-r.asm | min-1r.asm | ![]() |