Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Noise Gate

Dynamic range gate

  • Library:
  • Audio System Toolbox / Dynamic Range Control

Description

The Noise Gate block performs dynamic range gating independently across each input channel. Dynamic range gating suppresses signals below a given threshold. The block uses specified attack, release, and hold times to achieve a smooth applied gain curve.

Ports

Input

expand all

  • Matrix input –– Each column of the input is treated as an independent channel.

  • 1-D vector input –– The input is treated as a single channel.

This port is unnamed unless you specify additional input ports.

Data Types: single | double

Dependencies

To enable this port, select Specify from input port for the Threshold (dB) parameter.

Data Types: single | double

Dependencies

To enable this port, select Specify from input port for the Attack time (s) parameter.

Data Types: single | double

Dependencies

To enable this port, select Specify from input port for the Release time (s) parameter.

Data Types: single | double

Dependencies

To enable this port, select Specify from input port for the Hold time (s) parameter.

Data Types: single | double

Output

expand all

The Noise Gate block outputs a signal with the same data type as the input signal. The size of the output depends on the size of the input:

  • Matrix input –– The block outputs a matrix the same size and data type as the input signal.

  • 1-D vector input –– The block outputs an N-by-1 matrix (column vector), where N is the number of elements in the 1-D vector.

This port is unnamed until you select the Output gain (dB) parameter.

Data Types: single | double

Dependencies

To enable this port, select the Output gain (dB) parameter.

Data Types: single | double

Parameters

expand all

If a parameter is listed as tunable, then you can change its value during simulation.

Main Tab

Operation threshold is the level below which gain is applied to the input signal.

To specify Threshold (dB) from an input port, select Specify from input port for the parameter.

Tunable: Yes

The plot is updated automatically when parameters of the Noise Gate block change.

Tunable: Yes

Attack time is the time the applied gain takes to rise from 10% to 90% of its final value when the input goes below the threshold. The Attack time (s) parameter smooths the applied gain curve.

To specify Attack time (s) from an input port, select Specify from input port for the parameter.

Tunable: Yes

Release time is the time the applied gain takes to drop from 90% to 10% of its final value when the input goes above the threshold. The Release time (s) parameter smooths the applied gain curve.

To specify Release time (s) from an input port, select Specify from input port for the parameter.

Tunable: Yes

Hold time is the period in which the applied gain is held constant before it starts moving toward its steady-state value. Hold time begins when the input level crosses the operation threshold.

To specify Hold time (s) from an input port, select Specify from input port for the parameter.

Tunable: Yes

When you select this parameter, the block inherits its sample rate from the input signal. When you clear this parameter, you specify the sample rate in Input sample rate (Hz).

Tunable: No

Tunable: Yes

Dependencies

To enable this parameter, clear the Inherit sample rate from input parameter.

Advanced Tab

When you select this parameter, an additional output port, G, is added to the block. The G port outputs the gain applied on each input channel in dB.

Tunable: No

  • Interpreted execution –– Simulate model using the MATLAB® interpreter. This option shortens startup time and has a simulation speed comparable to Code generation. In this mode, you can debug the source code of the block.

  • Code generation –– Simulate model using generated C code. The first time you run a simulation, Simulink® generates C code for the block. The C code is reused for subsequent simulations, as long as the model does not change. This option requires additional startup time, but the speed of the subsequent simulations is comparable to Interpreted execution.

Tunable: No

Algorithms

The Noise Gate block processes a signal frame by frame and element by element.

  1. The N-point signal, x[n], is converted to magnitude:

    xa[n]=|x[n]|

  2. xa[n] passes through the gain computer. The gain computer uses the static characteristic properties of the dynamic range gate to apply a brickwall gain for signal below the threshold:

    gc(xa)={0xa<Tlin1xaTlin

    Tlin is the threshold property converted to a linear domain:

    Tlin=10(TdB20).

  3. The computed gain, gc[n], is smoothed using specified attack, release, and hold time parameters:

    gs[n]={αAgs[n1]+(1αA)gc[n]gs[n1]αRgs[n1]+(1αR)gc[n]gs[n1]if(CA>TH)&(gc[n]>gs[n1])ifCATHif(CR>TH)&(gc[n]gs[n1])ifCRTH

    CA and CR are hold counters for attack and release, respectively. The limit, TH, is determined by the Hold time (s) parameter.

    The attack time coefficient, αA, is calculated as

    αA=exp(log(9)Fs×TA).

    The release time coefficient, αR, is calculated as

    αR=exp(log(9)Fs×TR).

    TA is the attack time period, specified by the Attack time (s) parameter. T R is the release time period, specified by the Release time (s) parameter. Fs is the input sampling rate, specified by the Inherit sample rate from input or Input sample rate (Hz) parameter.

  4. The output of the dynamic range gate is given as

    y[n]=x[n]×gs[n].

References

[1] Giannoulis, Dimitrios, Michael Massberg, and Joshua D. Reiss. "Digital Dynamic Range Compressor Design –– A Tutorial And Analysis." Journal of Audio Engineering Society. Vol. 60, Issue 6, 2012, pp. 399–408.

See Also

Blocks

System Objects

Introduced in R2016a

Was this topic helpful?