Texas Instruments TMS320 User Manual page 85

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

3.5.3.1 Statistics About Varying Values
3.5.3.2 Statistics About Time Periods
STS objects can be used to accumulate statistical information about a time
series of 32-bit data values.
For example, let P
be the pitch detected by an algorithm on the i
i
audio data. An STS object can store summary information about the time
series {P
}. The following code fragment includes the current pitch value in the
i
series of values tracked by the STS object:
pitch = `do pitch detection`
STS_add(&stsObj, pitch);
The Statistics Data tool displays the number of values in the series, the
maximum value, the total of all values in the series, and the average value.
In any real-time system, there are important time periods. Since a period is
the difference between successive time values, STS provides explicit support
for these measurements.
For example, let T
be the time taken by an algorithm to process the i
i
of data. An STS object can store summary information about the time series
{T
}. The following code fragment illustrates the use of CLK_gethtime (high-
i
resolution time), STS_set, and STS_delta to track statistical information
about the time required to perform an algorithm:
STS_set(&stsObj, CLK_gethtime());
`do algorithm`
STS_delta(&stsObj, CLK_gethtime());
STS_set saves the value of CLK_gethtime as the contents of the previous
value field (set value) in the STS object. STS_delta subtracts this set value
from the new value it is passed. The result is the difference between the time
recorded before the algorithm started and after it was completed; that is, the
time it took to execute the algorithm (T
and passes this result as the new contents of the previous value field to be
tracked.
The host can display the count of times the algorithm was performed, the
maximum time to perform the algorithm, the total time performing the
algorithm, and the average time.
The set value is the fourth component of an STS object. It is provided to
support statistical analysis of a data series that consist of value differences,
rather than absolute values.
Instrumentation APIs
). STS_delta then invokes STS_add
i
Instrumentation
th
frame of
th
frame
3-23

Advertisement

Table of Contents
loading

Table of Contents