Skip to content

SampleStatisticsFract32

Overview

Computes sample statistics over multichannel fract32 signals

Discussion

This module calculates the sample statistics of the input fract32 signal on a sample-by-sample basis. The input pin can have an arbitray number of interleaved channels and the sample statistics calculation occurs over all channels. The output pin has only a single channel and a blockSize equal to that of input.

For each channel, the module calculates the type of statistics depending on the variable statisticsType selection. The available options are: 0=maximum, 1=minimum, 2=maximum absolute value, and 3=minimum absolute value. This includes all channels and the entire block.

If the argument OUTPUTINDEX is checked, then a 2nd output pin will be created. The 2nd output is the corresponding index value of the output operation. The index starts at 0. So an output value of 0 corresponds to the 1st channel. The optional 2nd output pin is single channel, int, with the same block size as the input.

The module also exposes the computed signal as a state variable. The variable instantaneousValue holds the block statistics of the block.

Module Pack

Advanced

ClassID

classID = 1319

Type Definition

typedef struct _ModuleSampleStatisticsFract32
{
ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
INT32 statisticsType;                         // Type of statistics calculated: 0=maximum, 1=minimum, 2=maximum absolute value, 3=minimum absolute value.
fract32 instantaneousValue;                   // Instantaneous output value.
} ModuleSampleStatisticsFract32Class;

Variables

Properties

Name Type Usage isHidden Default Value Range Units
statisticsType int parameter 0 0 0:3
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 Sample statistics output
Data Type fract32
Name index
Description Index value
Data Type int

Matlab Usage

File Name: sample_statistics_fract32_module.m 
 M=sample_statistics_fract32_module(NAME, OUTPUTINDEX) 
 Fixed point sample statistics module calculates the maximum, minimum, 
 maximum absolute value and minimum absolute value on sample-by-sample  
 basis of an arbitrary number of interleaved channels. 

 Arguments: 
    NAME - name of the module. 
    OUTPUTINDEX - boolean value which specifies whether the module will 
    have an optional 2nd output which outputs the channel index value of  
    the sample value is outputed. By default, OUTPUTINDEX = 0, which means 
    no 2nd output channel will be created. The 2nd output will be of the  
    data type int. The index starts at 0. So an output value of 0 means 
    channel 1 of the input. 

Copyright (c) 2026 DSP Concepts, Inc.