...
statisticsType | Description |
---|---|
0 | maximum |
1 | minimum |
2 | maximum absolute value |
3 | mean |
4 | RMS |
5 | standard deviation |
6 | variance |
7 | average energy |
8 | sum |
9 | sum of squares |
The module also exposes computed signal as state variable; instantaneousValue holds the Block Statistics of the blockstatistic is computed on a block-by-block basis and stored in the instantaneousValue variable. The module is stateless and the statistic is recomputed for each block.
An optional constructor argument OUTPUTVALUE specifies whether the computed statistic should be output on an output pin.
OUTPUTVALUE=0 (default) - the statistic is only stored internally in instantaneousValue.
OUTPUTVALUE=1 then the value of the statistic is output of the first output pin as a floating-point value.
OUTPUTVALUE=2 then the module has two output pins. The first output pin is the statistic value and the second output pin is the index at which the value occurs.
Using OUTPUTVALUE=2 only makes sense when statisticType=0 (max), 1 (min), or 2 (maxAbs).
Type Definition
Code Block |
---|
typedef struct _ModuleBlockStatisticsFract32 { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 statisticsType; // Type of statistics needed fract32 instantaneousValue; // Instantaneous output value } ModuleBlockStatisticsFract32Class; |
...