Skip to content

ThreeBandToneControlFract32

Overview

Three band equalizer

Discussion

This module implements a three band tone control fixed point module. Low shelf filter is used for low frequency band with normalised gain with respect to mid band gain. Similarly for high frequency band high shelf filter is used with normalised gain with respect to mid gain. Finally scale smoothely the entire signal with mid band gain.

Module Pack

Standard

ClassID

classID = 210

Type Definition

typedef struct _ModuleThreeBandToneControlFract32
{
ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
FLOAT32 smoothingTime;                        // Time constant of the smoothing process
FLOAT32 lowFreq;                              // Low band center frequency, in Hz
FLOAT32 midFreq;                              // Mid band center frequency, in Hz
FLOAT32 highFreq;                             // High band center frequency, in Hz
FLOAT32 lowGain;                              // Low band gain, in dB
FLOAT32 midGain;                              // Mid band gain, in dB
FLOAT32 highGain;                             // High band gain, in dB
INT32 headRoomBits;                           // Head room bits. This prevents internal clipping in the filter stages
INT32 postShift;                              // postShift controls the headroom within the fixed-point filtering
FLOAT32 twoPowMinusPostShift;                 // Two power -postShift value
INT32 filterUpdateActive;                     // Boolean that is set when updating coefficients
fract32 smoothingCoeff;                       // Smoothing coefficient for the filter coefficients
fract32 midTargetGain;                        // Target gain of the mid frequency gain
fract32 midCurrentGain;                       // Current gain of the mid frequency gain
fract32 midSmoothingCoeff;                    // Sample-by-sample smoothing coefficient of the mid frequency gain
fract32* lowerTargetCoeffs;                   // Target coefficients for the low frequency shelf
fract32* lowerCurrentCoeffs;                  // Current coefficients for the low frequency shelf
fract32* lowerState;                          // State variables for the low frequency shelf
fract32* upperTargetCoeffs;                   // Target coefficients for the high frequency shelf
fract32* upperCurrentCoeffs;                  // Current coefficients for the high frequency shelf
fract32* upperState;                          // State variables for the high frequency shelf
} ModuleThreeBandToneControlFract32Class;

Variables

Properties

Name Type Usage isHidden Default Value Range Units
smoothingTime float parameter 0 20 0:1000 msec
lowFreq float parameter 0 60 30:200 Hz
midFreq float parameter 0 600 200:4000 Hz
highFreq float parameter 0 6000 4000:20000 Hz
lowGain float parameter 0 0 -12:12 dB
midGain float parameter 0 0 -12:12 dB
highGain float parameter 0 0 -12:12 dB
headRoomBits int parameter 1 2 Unrestricted
postShift int parameter 1 5 Unrestricted
twoPowMinusPostShift float parameter 1 0.03125 Unrestricted
filterUpdateActive int parameter 1 1 Unrestricted
smoothingCoeff fract32 parameter 1 0.032784 Unrestricted
midTargetGain fract32 parameter 1 0.03125 Unrestricted
midCurrentGain fract32 parameter 1 0.03125 Unrestricted
midSmoothingCoeff fract32 parameter 1 0.0010412 Unrestricted
lowerTargetCoeffs fract32* parameter 1 [5 x 1] Unrestricted
lowerCurrentCoeffs fract32* parameter 1 [5 x 1] Unrestricted
lowerState fract32* state 1 [4 x 1] Unrestricted
upperTargetCoeffs fract32* parameter 1 [5 x 1] Unrestricted
upperCurrentCoeffs fract32* parameter 1 [5 x 1] Unrestricted
upperState fract32* state 1 [4 x 1] Unrestricted

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 audio output
Data Type fract32

Scratch Pins

Channel Count 1
Block size 32
Sample rate 48000

Matlab Usage

File Name: three_band_tone_control_fract32_module.m 
 M=three_band_tone_control_fract32_module(NAME) 
 Implements a three band tone control module. 
 Arguments: 
    NAME - name of the module. 

Copyright (c) 2026 DSP Concepts, Inc.