Skip to main content
Skip table of contents

SubblockStatistics

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
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

Data type: float

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: Value

Data type: float

MATLAB Usage

File Name: subblock_statistics_module.m

CODE
 M = subblock_statistics_module(NAME, SUBSIZE)
 This module calculates statistics of the input signal, outputting one
 sample per SUBSIZE input samples.  The statisticsType parameter controls
 what function is computed, e.g., min or max.
 Arguments:
    NAME - name of the module.
    SUBSIZE - Optional argument (SUBSIZE=2 by default), defines
        the number of samples per subblock to run statistics on.
 Copyright 2008-2014 DSP Concepts, Inc.  All Rights Reserved.

JavaScript errors detected

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

If this problem persists, please contact our support.