Versions Compared

Key

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

Overview

Computes long term statistics per channel

Discussion

This module is a multichannel version of the RunningStatisics module. The module keeps track of the statistics of the input data. The state variable value holds the statistic result seen thus far since the module start processing. A separate statistic is computed for each input channel.

...

By default, the sample rate of the output pin equals SRin / blocksize. There are some times when this computes the wrong sample rate and you can overwrite the output sample rate using the SAMPLERATE argument.

Type Definition

Code Block
typedef struct _ModuleRunningStatisticsN
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 statisticsType;                         // Type of statistics needed.
    INT32 numBlocksProcessed;                     // Counter for the number of blocks processed.
    INT32 reset;                                  // Used to identify the first block which is processed.
    FLOAT32* value;                               // Instantaneous output value.
    FLOAT32* mean;                                // State variable for mean.
    FLOAT32* avgEnergy;                           // State variable for average energy.
} ModuleRunningStatisticsNClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

statisticsType

int

parameter

0

0

0:8

numBlocksProcessed

int

state

0

0

Unrestricted

reset

int

state

0

1

Unrestricted

value

float*

state

0

[1 x 1]

Unrestricted

mean

float*

state

0

[1 x 1]

Unrestricted

avgEnergy

float*

state

0

[1 x 1]

Unrestricted

Pins

Input Pins

Name: in

Description: Audio input

...

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: Audio input

Data type: float

Scratch Pins

Channel count: 1

Block size: 32

Sample rate: 48000

MATLAB Usage

File Name: running_statisticsn_module.m

...