Overview
Computes long term statistics
Discussion
This module keeps track of the statistics of the input data. The state variable value holds the statistic result seen thus far.
...
An optional constructor argument OUTPUTVALUE specifies whether the computed statistic should be output on an output pin. By default, OUTPUTVALUE=0 and the statistic is only stored internally in instantaneousValue. The .reset variable is used to clear history and restart the calculation. The variable .reset is set to 1 when the module is first constructed.
Type Definition
Code Block |
---|
typedef struct _ModuleRunningStatistics { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 statisticsType; // Type of statistics needed. FLOAT32 value; // Instantaneous output value. FLOAT32 mean; // State variable for mean. FLOAT32 avgEnergy; // State variable for average energy. INT32 numBlocksProcessed; // Counter for the number of blocks processed. INT32 reset; // Used to identify the first block which is processed. } ModuleRunningStatisticsClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
statisticsType | int | parameter | 0 | 0 | 0:8 | |
value | float | state | 0 | 0 | Unrestricted | |
mean | float | state | 0 | 0 | Unrestricted | |
avgEnergy | float | state | 0 | 0 | Unrestricted | |
numBlocksProcessed | int | state | 0 | 0 | Unrestricted | |
reset | int | state | 0 | 1 | Unrestricted |
Pins
Input Pins
Name: in
Description: Audio input
...
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: State value output
Data type: float
MATLAB Usage
File Name: running_statistics_module.m
...