Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

Overview

Subband SOF detector

Discussion

This module implements a general purpose second order filter that operates on subband data and that is capable of realizing many different filter types. The function can operate on real or complex data. For complex data, the function filters the real and imaginary components separately.

...

filterType=22, 2nd order Butterworth high pass filter with variable Q. [freq, Q].

Type Definition

Code Block
typedef struct _ModuleSbSOF
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 filterType;                             // Selects the type of filter that is implemented by the module: Bypass=0, Gain=1, Butter1stLPF=2, Butter2ndLPF=3, Butter1stHPF=4, Butter2ndHPF=5, Allpass1st=6, Allpass2nd=7, Shelf2ndLow=8, Shelf2ndLowQ=9, Shelf2ndHigh=10, Shelf2ndHighQ=11, PeakEQ=12, Notch=13, Bandpass=14, Bessel1stLPF=15, Bessel1stHPF=16, AsymShelf1stLow=17, AsymShelf1stHigh=18, SymShelf1stLow=19, SymShelf1stHigh=20, VariableQLPF=21, VariableQHPF=22.
    FLOAT32 freq;                                 // Cutoff frequency of the filter, in Hz.
    FLOAT32 gain;                                 // Amount of boost or cut to apply, in dB if applicable.
    FLOAT32 Q;                                    // Specifies the Q of the filter, if applicable.
    FLOAT32 smoothingTime;                        // Time constant of the smoothing process.
    INT32 updateActive;                           // Specifies whether the filter coefficients are updating (=1) or fixed (=0).
    FLOAT32 b0;                                   // Desired first numerator coefficient.
    FLOAT32 b1;                                   // Desired second numerator coefficient.
    FLOAT32 b2;                                   // Desired third numerator coefficient.
    FLOAT32 a1;                                   // Desired second denominator coefficient.
    FLOAT32 a2;                                   // Desired third denominator coefficient.
    FLOAT32 current_b0;                           // Instantaneous first numerator coefficient.
    FLOAT32 current_b1;                           // Instantaneous second numerator coefficient.
    FLOAT32 current_b2;                           // Instantaneous third numerator coefficient.
    FLOAT32 current_a1;                           // Instantaneous second denominator coefficient.
    FLOAT32 current_a2;                           // Instantaneous third denominator coefficient.
    FLOAT32 smoothingCoeff;                       // Smoothing coefficient. This is computed based on the smoothingTime, sample rate, and block size of the module.
    FLOAT32* state;                               // State variables. 2 per channel.
} ModuleSbSOFClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

filterType

int

parameter

0

0

0:22

freq

float

parameter

0

250

1:20000

Hz

gain

float

parameter

0

6

-24:24

dB

Q

float

parameter

0

1

-20:20

smoothingTime

float

parameter

0

10

0:1000

msec

updateActive

int

parameter

1

1

0:1

b0

float

derived

1

1

Unrestricted

b1

float

derived

1

0

Unrestricted

b2

float

derived

1

0

Unrestricted

a1

float

derived

1

0

Unrestricted

a2

float

derived

1

0

Unrestricted

current_b0

float

state

1

1

Unrestricted

current_b1

float

state

1

0

Unrestricted

current_b2

float

state

1

0

Unrestricted

current_a1

float

state

1

0

Unrestricted

current_a2

float

state

1

0

Unrestricted

smoothingCoeff

float

derived

1

0.06449

Unrestricted

state

float*

state

1

[64 x 1]

Unrestricted

Pins

Input Pins

Name: in

Description: audio input

...

Complex support: Real and Complex

Output Pins

Name: out

Description: audio output

Data type: float

MATLAB Usage

File Name: sb_sof_module.m

...