Document toolboxDocument toolbox

(8.D.2.1) AudioWeighting

Overview

Standard audio weighting filters

Discussion

Implements standard weighting filters used in audio. The module operates on multiple channels and internally uses a BiquadCascade modoule. The .weightingType variable specifies what type of filter is implemented. Allowable values are:

0 = Flat

1 = A weighting

2 = B weighting

3 = C weighting

4 = D weighting

5 = ITU468

6 = LeqM

7 = ITU1770

When changing filter types, the audio output is muted, the filter's state variables are set to zero and then the coefficients are updated. Once the coefficients are changed, the audio is unmuted.

Type Definition

typedef struct _ModuleAudioWeighting { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 weightingType; // Selects weighting type INT32 numStages; // Number of stages in the IIR filter FLOAT32* coeffs; // Array of precomputed filter coefficients for the specified sampling rate awe_modBiquadCascadeInstance *filt; // Cascade of second order Biquad filters awe_modMuteUnmuteInstance *mute; // Mutes and unmutes to hide artifacts } ModuleAudioWeightingClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

weightingType

int

parameter

0

0

0:7

 

numStages

int

parameter

1

4

Unrestricted

 

coeffs

float*

parameter

1

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

Scratch Pins

Channel count: 1

Block size: 32

Sample rate: 48000

 

Channel count: 1

Block size: 32

Sample rate: 48000

MATLAB Usage

File Name: weighting_module.m

SYS = weighting_module(NAME) Creates a module which implements standard audio frequency weightings: A, B, C, D, ITU 468, and Leq M. Arguments: NAME - name of the module. The module stores all of the various filter coefficients in an internal array and you can switch between filter types at run-time. Internally, the module uses a Biquad cascade together with a mute/unmute module to hide switching transients.

Â