Skip to main content
Skip table of contents

BinToBand

Overview

Groups frequency domain bins into larger bands

Discussion

The Bin to Band Module is a module that combines many frequency bins into fewer bands. This module combines a user defined number of frequency bins into a custom number of output bands. The number of output bands cannot exceed the number of input bins, and only accepts real numbers as inputs. There are three different methods to combine bins - maximum, minimum, and mean. Use the .mapping variable to control the processing mode, and set each band's bins with the .bandSize array. If the total number of bins in .bandSize is smaller than the input number of bins, the module will ignore the missing bins. If the total number of bins in .bandSize is greater than the input number of bins, the module will limit the band that is larger than the last bin to the last bin. Any following bands will then output zeros, since there are no more input bins to combine.

The module supports multichannel inputs and separately combines the bins for each channel. That is, if the input has N channels then the output will also have N channels.

Type Definition

CODE
typedef struct _ModuleBinToBand
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 mapping;                                // Manner in which bins are combined.
    INT32 numBands;                               // Number of output bands.
    INT32* bandSize;                              // Number of input bins to combine per output band.
    INT32* startIndex;                            // Starting bin index for each band.
    INT32* endIndex;                              // Ending bin index for each band.
    FLOAT32* divisor;                             // Divisor per bin when computing the average.
} ModuleBinToBandClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

mapping

int

parameter

0

0

0:2

numBands

int

const

1

10

Unrestricted

bandSize

int*

parameter

0

[10 x 1]

Unrestricted

startIndex

int*

derived

1

[10 x 1]

Unrestricted

endIndex

int*

derived

1

[10 x 1]

Unrestricted

divisor

float*

derived

1

[10 x 1]

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: audio output

Data type: float

MATLAB Usage

File Name: bin_to_band_module.m

CODE
 M = bin_to_band_module(NAME, NUMBANDS)
 Creates a module which groups frequency bins together into
 non-overlapping bands.   Arguments:
    NAME - name of the module.
    NUMBANDS - number of output bands

JavaScript errors detected

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

If this problem persists, please contact our support.