Skip to main content
Skip table of contents

BlockStatisticsFract32

Overview

Block statistics of a block of samples

Discussion

This module calculates the Block Statistics of the input signal on a block-by-block basis. The input pin can have an arbitray number of interleaved channels and the Block Statistics calculation occurs over all channels. The output pin has a single channel and a blockSize of 1.

The following algorithm is used internally. For each block, caluclates the maximum minimum, maximum absolute value, mean, RMS, standard deviation, variance, average energy is computed depending on the variable statisticsType selection. This includes all channels and the entire block.

The module also exposes computed signal as state variable; instantaneousValue holds the Block Statistics of the block.

Type Definition

CODE
typedef struct _ModuleBlockStatisticsFract32
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 statisticsType;                         // Type of statistics needed
    fract32 instantaneousValue;                   // Instantaneous output value
} ModuleBlockStatisticsFract32Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

statisticsType

int

parameter

0

0

0:7

instantaneousValue

fract32

state

0

0

-60:10

Pins

Input Pins

Name: in

Description: Audio input

Data type: fract32

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: Block statistics output

Data type: fract32

MATLAB Usage

File Name: block_statistics_fract32_module.m

CODE
 M=block_statistics_fract32_module(NAME, OUTPUTVALUE)
 This modules calculates statistics of the input signal on a block-by-
 block basis.  A number of different statistics can be calculated based
 on the statisticsType parameter.  The computed value is stored in the
 internal state variable instantaneousValue.  Arguments:
    NAME - name of the module.
    OUTPUTVALUE - Boolean  value which specifies whether the module has
                  an output pin.  If OUTPUTVALUE=0, then the module has no
                  output pin.  If OUTPUTVALUE=1 (the default), then
                  the instantaneousValue variable is output as a single
                  sample on the output pin.
 The argument statisticsType determines what statistics computed:
   0 = maximum
   1 = minimum
   2 = maximum absolute value
   3 = mean
   4 = RMS
   5 = standard deviation
   6 = variance
   7 = average energy

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.