Document toolboxDocument toolbox

MuteSmoothed

Overview

Smoothly mutes and unmutes

Discussion

Smoothly mutes all input channels. Muting/unmuting is controlled by the isMuted parameter. The isMuted parameter is automatically converted to a value for the internal gain variable: isMuted = 1 --> gain = 0 or isMuted = 0 --> gain = 1. The variable gain serves as a target gain for the module. Changes made to the gain variable are exponentially smoothed (first order IIR) at the sample rate, with the time constant determined by the smoothingTime parameter. The internal variable currentGain represents the instantaneous smoothed gain that is applied to the data stream. currentGain exponentially approaches gain with a time constant equal to smoothingTime.

currentGain also serves as the starting gain of the module. If currentGain = gain, then the module starts up in a converged state. If currentGain != gain, then the module will smoothly vary the gain at startup.

Type Definition

typedef struct _ModuleMuteSmoothed { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 isMuted; // Boolean that controls muting/unmuting. FLOAT32 smoothingTime; // Time constant of the smoothing process FLOAT32 currentGain; // Instantaneous gain applied by the module. This is also the starting gain of the module. FLOAT32 smoothingCoeff; // Smoothing coefficient. FLOAT32 gain; // Target gain. } ModuleMuteSmoothedClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

isMuted

int

parameter

0

0

0:1

 

smoothingTime

float

parameter

0

10

0:1000

msec

currentGain

float

state

1

1

0:1

linear

smoothingCoeff

float

derived

1

0.002081

Unrestricted

 

gain

float

derived

1

1

0:1

linear

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 and Complex

Output Pins

Name: out

Description: audio output

Data type: float

MATLAB Usage

File Name: mute_smoothed_module.m

M=mute_smoothed_module(NAME) Creates a module which smoothly mutes and unmutes. Arguments: NAME - name of the module.

Â