Add reverberation to audio signal
Audio Toolbox / Effects
The Reverberator block adds reverberation to mono or stereo audio signals. You can tune parameters of the Reverberator block to mimic different acoustic environments.
Port_1
— Input signalMatrix input –– Each column of the input is treated as an independent channel.
1D vector input –– The input is treated as a single channel.
Data Types: single
 double
Port_1
— Output signalThe Reverberator 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.
1D vector input –– The block outputs an Nby1 matrix (column vector), where N is the number of elements in the 1D vector.
Data Types: single
 double
If a parameter is listed as tunable, then you can change its value during simulation.
Predelay (s)
— Predelay for reverberation0
(default)  scalar in the range 0 to 1Predelay for reverberation is the time between hearing direct sound and the first early reflection. The value of Predelay (s) is proportional to the size of the room being modeled.
Tunable: Yes
Highcut frequency (Hz)
— Lowpass filter cutoff in the range 0 to (Sample Rate)/220000
(default)  real positive scalarLowpass filter cutoff is the –3 dB cutoff frequency for the singlepole lowpass filter at the front of the reverberator structure. It prevents the application of reverberation to highfrequency components of the input.
Tunable: Yes
Diffusion
— Density of reverb tail0.50
(default)  scalar in the range 0 to 1Diffusion is proportional to the rate at which the reverb tail builds in density. Increasing Diffusion pushes the reflections closer together, thickening the sound. Reducing Diffusion creates more discrete echoes.
Tunable: Yes
Decay factor
— Decay factor of reverb tail0.50
(default)  scalar in the range 0 to 1Decay factor is proportional to the time it takes for reflections to run out of energy. To model a large room, use a long reverb tail (low decay factor). To model a small room, use a short reverb tail (high decay factor).
Tunable: Yes
High frequency damping
— Highfrequency damping0.0005
(default)  scalar in the range 0 to 1High frequency damping is proportional to the attenuation of high frequencies in the reverberation output. Setting High frequency damping to a large value makes highfrequency reflections decay faster than lowfrequency reflections.
Tunable: Yes
Wet/dry mix
— Ratio of wet (reverberated) signal to dry (original) signal0.3
(default)  scalar in the range 0 to 1Wet/dry mix is the ratio of wet (reverberated) signal to dry (original) signal that your Reverberator block outputs.
Tunable: Yes
Inherit sample rate from input
— Specify source of input sample rateWhen 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
Input sample rate (Hz)
— Sample rate of input44100
(default)  positive scalarTunable: Yes
To enable this parameter, clear the Inherit sample rate from input parameter.
Simulate using
— Specify type of simulation to runInterpreted execution
(default)  Code generation
Interpreted execution
–– Simulate model
using the MATLAB^{®} interpreter. This option shortens startup time and has
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
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

The algorithm to add reverberation follows the plateclass reverberation topology described in [1] and is based on a 29,761 Hz sample rate.
The algorithm has five stages.
The description for the algorithm that follows is for a stereo input. A mono input is a simplified case.
A stereo signal is converted to a mono signal: $$x[n]=0.5\times \left({x}_{R}[n]+{x}_{L}[n]\right)$$.
A delay followed by a lowpass filter preconditions the mono signal.
The predelay output is determined as $${x}_{p}[n]=x[nk]$$, where the Predelay (s) parameter determines the value of k.
The signal is fed through a singlepole lowpass filter with transfer function
$$LP(z)=\frac{1\alpha}{1\alpha {z}^{1}}\text{\hspace{0.17em}},$$
where
$$\alpha =\mathrm{exp}\left(2\pi \times \frac{{f}_{c}}{{f}_{s}}\right)\text{\hspace{0.17em}}.$$
f_{c} is the cutoff frequency specified by the Predelay (s) parameter.
f_{s} is the sampling frequency specified by the Inherit sample rate from input parameter or the Input sample rate (Hz) parameter.
The signal is decorrelated by passing through a series of four allpass filters.
The allpass filters are of the form
$$AP(z)=\frac{\beta +{z}^{k}}{1+\beta {z}^{k}}\text{\hspace{0.17em}},$$
where β is the coefficient specified
by the Diffusion
property and k is
the delay as follows:
For AP_{1}, k =
142
.
For AP_{2}, k =
107
.
For AP_{3}, k =
379
.
For AP_{4}, k =
277
.
The signal is fed into the tank, where it circulates to simulate the decay of a reverberation tail.
The following description tracks the signal as it progresses through the top of the tank. The signal progression through the bottom of the tank follows the same pattern, with different delay specifications.
The new signal enters the top of the tank and is added to the circulated signal from the bottom of the tank.
The signal passes through a modulated allpass filter:
$$Modulated\text{\hspace{0.17em}}A{P}_{1}(z)=\frac{\beta +{z}^{k}}{1\beta {z}^{k}}\text{\hspace{0.17em}}$$
β is the coefficient specified by the Diffusion parameter.
k is the variable delay specified by a 1 Hz sinusoid with amplitude = (8/29761) × (sample rate). To account for fractional delay resulting from the modulating k, allpass interpolation is used [2].
The signal is delayed again, and then passes through a lowpass filter:
$$L{P}_{2}(z)=\frac{1\phi}{1\phi {z}^{1}}$$
φ is the coefficient specified by the High frequency damping parameter.
The signal is multiplied by a gain specified by the Decay factor parameter. The signal then passes through an allpass filter:
$$A{P}_{5}(z)=\frac{\beta +{z}^{k}}{1+\beta {z}^{k}}\text{\hspace{0.17em}}.$$
β is the coefficient specified by the Diffusion parameter.
k is set to 1800
for
the top of the tank and 2656
for the bottom of
the tank.
The signal is delayed again and then circulated to the bottom half of the tank for the next iteration.
A similar pattern is executed in parallel for the bottom half
of the tank. The output of the tank is calculated as the signed sum
of delay lines picked off at various points from the tank. The summed
output is multiplied by 0.6
.
The wet (processed) signal is then added to the dry (original) signal:
$${y}_{R}[n]=\left(1\kappa \right){x}_{R}[n]+\kappa {x}_{3R}[n]\text{\hspace{0.17em}},$$
$${y}_{L}[n]=\left(1\kappa \right){x}_{L}[n]+\kappa {x}_{3L}[n]\text{\hspace{0.17em}},$$
where the Wet/dry mix parameter determines κ.
[1] Dattorro, Jon. "Effect Design, Part 1: Reverberator and Other Filters." Journal of the Audio Engineering Society. Vol. 45, Issue 9, 1997, pp. 660–684.
[2] Dattorro, Jon. "Effect Design, Part 2: DelayLine Modulation and Chorus." Journal of the Audio Engineering Society. Vol. 45, Issue 10, 1997, pp. 764–788.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.