Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

Overview

Computes statistics at several points in a block of samples

Discussion

This module calculates statistics of the input signal at several points for each block. Output blocks have samples, where each output sample is the statistics value for a subblock The input pin can have an arbitrary number of interleaved channels and the calculation occurs over all channels. The output pin has a single channel and a blockSize equal to floor(inputBlocksize / subblockSize)

For each subblock, one of the following values is calculated: maximum, minimum, maximum absolute value, mean, RMS, standard deviation, variance, or average energy. The parameter statisticsType specifies which statistic is computed: 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 is stateless and the statistic is recomputed for each block.

Type Definition

Code Block
typedef struct _ModuleSubblockStatistics
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 subblockSize;                           // Number of samples per subblock to run statistics on.
    INT32 statisticsType;                         // Type of statistics calculated.
    INT32 nSubblocks;                             // Number of subblocks per input block.
} ModuleSubblockStatisticsClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

subblockSize

int

const

0

2

Unrestricted

statisticsType

int

parameter

0

0

0:9

nSubblocks

int

state

0

16

Unrestricted

Pins

Input Pins

Name: in

Description: Audio input

...

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: Value

Data type: float

MATLAB Usage

File Name: subblock_statistics_module.m

...