Document toolboxDocument toolbox

(8.D.2.6) MuteUnmute

Overview

Mutes and unmutes to hide artifacts

Discussion

This module is used to hide pops and clicks during transitions. The module smoothly mutes, outputs silence, and then smoothly unmutes. You have full control over mute period, silence period, and unmuting period.

The .trigger variable is used to engage the entire process. Normally trigger=0 and the module passes the input unchanged. When you set trigger=1, then the module goes through the overall mute/silence/unmute cycle.

The module uses a raised cosine window for muting and unmuting. For memory efficiency the module uses a complex recursion to compute the gain profile for the raised cosine.

The constructor argument INITIALSTATE allows you to set the initial state of the trigger variable. By default, INITIALSTATE = 0 meaning that the module starts up unmuted. If you set INITIALSTATE = 1, then the module starts out muted.

Type Definition

typedef struct _ModuleMuteUnmute { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 trigger; // Begins the muting and unmuting process FLOAT32 muteTime; // Muting time, in msec FLOAT32 silenceTime; // Duration of the silence period, in msec FLOAT32 unmuteTime; // Unmuting time, in msec INT32 muteTimeSamples; // Muting time, in samples INT32 silenceTimeSamples; // Silence time, in samples INT32 unmuteTimeSamples; // Unmuting time, in samples FLOAT32 muteCoeffR; // One of two coefficients used to compute the muting profile FLOAT32 muteCoeffI; // One of two coefficients used to compute the muting profile FLOAT32 unmuteCoeffR; // One of two coefficients used to compute the unmuting profile FLOAT32 unmuteCoeffI; // One of two coefficients used to compute the unmuting profile FLOAT32 stateR; // One of two state variables which control the ramping profile FLOAT32 stateI; // One of two state variables which control the ramping profile INT32 sampleTime; // Counts the samples elapsed in the entire mute/silence/unmute cycle } ModuleMuteUnmuteClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

trigger

int

state

0

0

0:1

 

muteTime

float

parameter

0

5

1:1000

 

silenceTime

float

parameter

0

100

0:10000

 

unmuteTime

float

parameter

0

50

1:1000

 

muteTimeSamples

int

derived

1

240

Unrestricted

 

silenceTimeSamples

int

derived

1

4800

Unrestricted

 

unmuteTimeSamples

int

derived

1

2400

Unrestricted

 

muteCoeffR

float

derived

1

0.9999

Unrestricted

 

muteCoeffI

float

derived

1

0.01309

Unrestricted

 

unmuteCoeffR

float

derived

1

1

Unrestricted

 

unmuteCoeffI

float

derived

1

0.001309

Unrestricted

 

stateR

float

state

1

0

Unrestricted

 

stateI

float

state

1

0

Unrestricted

 

sampleTime

int

state

1

0

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

MATLAB Usage

File Name: mute_unmute_module.m

M=mute_unmute_module(NAME, INITIALSTATE) Creates a module which mutes, remains silent, and then unmutes after a period of time. This is used to hide artifacts. The module has programmable mute, unmute, and silence periods. The muting and unmuting is performed using raised cosine windows. Arguments: NAME - name of the module. INITIALSTATE - optional argument which specifies the default state of the trigger variable. By default, INITIALSTATE = 0 meaning that the module comes up unmuted.

Â