主要内容

reverberator

Add reverberation to audio signal

描述

Thereverberator系统对象™ adds reverberation to mono or stereo audio signals.

To add reverberation to your input:

  1. 创建reverberatorobject and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, seeWhat Are System Objects?

Creation

描述

混响= Reverberatorcreates a System object,reverb,这将人工混响添加到音频信号中。

Reverb = Reverberator(Name,Value)sets each propertyNameto the specifiedValue。Unspecified properties have default values.

例子:Reverb = Reverberator('PreDelay',0.5,'WetDryMix',1)creates a System object,reverb, with a 0.5 second pre-delay and a wet-to-dry mix ratio of one.

Properties

展开全部

Unless otherwise indicated, properties are不可否认,这意味着您在调用对象后不能更改其值。呼叫时锁定对象,然后releasefunction unlocks them.

If a property istunable, you can change its value at any time.

For more information on changing property values, seeSystem Design in MATLAB Using System Objects

Pre-delay for reverberation in seconds, specified as a real scalar in the range [0, 1].

Pre-delay for reverberationis the time between hearing direct sound and the first early reflection. The value ofPreDelayis proportional to the size of the room being modeled.

Tunable:Yes

Data Types:single|双倍的

Lowpass filter cutoff in Hz, specified as a real positive scalar in the range 0 to ( S a m p l e R a t e 2 )

Lowpass filter cutoffis the –3 dB cutoff frequency for the single-pole lowpass filter at the front of the reverberator structure. It prevents the application of reverberation to high-frequency components of the input.

Tunable:Yes

Data Types:single|双倍的

混响尾部的密度,在[0,1]中指定为真实的正标量。

Diffusion与混响尾部密度建立的速率成正比。增加Diffusionpushes the reflections closer together, thickening the sound. ReducingDiffusion创建更多离散的回声。

Tunable:Yes

Data Types:single|双倍的

混响尾部的衰减因子,在[0,1]中指定为真实的正标量。

decayFactor与反射耗尽能量所需的时间成正比。要建模一个大房间,请使用长长的尾巴(低衰减因子)。要建模一个小房间,请使用短尾巴(高衰减因子)。

Tunable:Yes

Data Types:single|双倍的

High-frequency damping, specified as a real positive scalar in the range [0, 1].

HighFrequencyDamping与混响输出中高频的衰减成正比。环境HighFrequencyDampingto a large value makes high-frequency reflections decay faster than low-frequency reflections.

Tunable:Yes

Data Types:single|双倍的

湿干的混合物,在[0,1]中指定为真实的正标量。

Wet-dry mixis the ratio of wet (reverberated) to dry (original) signal that yourreverberator系统对象outputs.

Tunable:Yes

Data Types:single|双倍的

Input sample rate in Hz, specified as a positive scalar.

Tunable:Yes

Data Types:single|双倍的

Usage

描述

example

audioOut= reverb(Audioin)adds reverberation to the input signal,Audioin, and returns the mixed signal,audioOut。The type of reverberation is specified by the algorithm and properties of the reverberator System object,reverb

Input Arguments

展开全部

Audio input to the reverberator, specified as a column vector or two-column matrix. The columns of the matrix are treated as independent audio channels.

Data Types:single|双倍的

Output Arguments

展开全部

Audio output from the reverberator, returned as a two-column matrix.

Data Types:single|双倍的

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object namedobj,使用此语法:

release(obj)

展开全部

CreateAudiopluginClass Create audio plugin class that implements functionality of系统对象
parametertuner Tune object parameters while streaming
configureMIDI Configure MIDI connections between audio object and MIDI controller
disconnectMIDI Disconnect MIDI controls from audio object
getMIDIConnections 获取音频对象的MIDI连接
clone 创建重复系统对象
isLocked 确定是否系统对象正在使用
release Release resources and allow changes to系统对象property values and input characteristics
重置 重置内部状态系统对象
Run系统对象algorithm

例子

collapse all

Use thereverberator系统对象™ to add artificial reverberation to an audio signal read from a file.

创建dsp。AudioFileReaderandaudioDeviceWriter系统对象s. Use the sample rate of the reader as the sample rate of the writer.

fileReader = dsp.AudioFileReader('Funkydrums-44p1-stereo-25secs.mp3','SamplesPerFrame',1024);DeviceWriter = AudioDeviceWriter('SampleRate',fileReader.mamplater);

Play 10 seconds of the audio signal through your device.

ticwhiletoc <10 audio = filereader();DeviceWriter(音频);endrelease(fileReader)

Construct areverberator系统对象with default settings.

混响= Reverberator
混响= Reverberatorwith properties: PreDelay: 0 HighCutFrequency: 20000 Diffusion: 0.5000 DecayFactor: 0.5000 HighFrequencyDamping: 5.0000e-04 WetDryMix: 0.3000 SampleRate: 44100

Construct a time scope to visualize the original audio signal and the audio signal with added artificial reverberation.

scope = timescope(。。。'SampleRate',fileReader.SampleRate,。。。'TimeSpanOverrunAction','Scroll',。。。'TimeSpanSource','property',。。。'TimeSpan',3,。。。“ BufferLength”,3*fileReader.SampleRate*2,。。。'YLimits',[-1,1],。。。“ showgrid',true,。。。'ShowLegend',true,。。。'标题','Audio with Reverberation vs. Original');

Play the audio signal with artificial reverberation. Visualize the audio with reverberation and the original audio.

while~isDone(fileReader) audio = fileReader(); audioWithReverb = reverb(audio); deviceWriter(audioWithReverb); scope([audioWithReverb(:,1),audio(:,1)])end释放(filereader)版本(设备沃特)版本(范围)

Create adsp。AudioFileReaderto read in audio frame-by-frame. Create anaudioDeviceWriterto write audio to your sound card. Create areverberator处理音频数据。

frameLength = 1024; fileReader = dsp.AudioFileReader('Rockdrums-44p1-stereo-11secs.mp3',。。。'SamplesPerFrame',frameLength,'PlayCount',2); deviceWriter = audioDeviceWriter('SampleRate',fileReader.mamplater);Reverb = Reverberator('SampleRate',fileReader.mamplater);

Callparametertunerto open a UI to tune parameters of theoctaveFilterwhile streaming.

parametertuner(reverb)

在音频流循环中:

  1. 在文件中阅读音频框架。

  2. Apply reverberation.

  3. Write the frame of audio to your audio device for listening.

While streaming, tune parameters of the reverberator and listen to the effect.

while~isDone(fileReader) audioIn = fileReader(); audioOut = reverb(audioIn); deviceWriter(audioOut); drawnow限制% required to update parameterend

作为最佳实践,请释放一旦完成的对象。

release(deviceWriter) release(fileReader) release(reverb)

提示

TheCreateAudiopluginClassandconfigureMIDI功能映射可调属性compressorto user-facing parameters:

Property Range Mapping Unit
PreDelay [0, 1] linear s
HighCutFrequency [20, 20000] 日志 Hz
Diffusion [0, 1] linear 没有任何
decayFactor [0, 1] linear 没有任何
HighFrequencyDamping [0, 1] linear 没有任何
WetDryMix [0, 1] linear 没有任何

Algorithms

展开全部

添加混响的算法遵循板级混响拓扑[1]and is based on a 29,761 Hz sample rate.

The algorithm has five stages.

以下算法的描述是用于立体声输入的。单声道输入是简化的情况。

参考

[1]Dattorro, Jon. "Effect Design, Part 1: Reverberator and Other Filters."Journal of the Audio Engineering Society。卷。45,第9期,1997年,第660-684页。

[2] Dattorro, Jon. "Effect Design, Part 2: Delay-Line Modulation and Chorus."Journal of the Audio Engineering Society。卷。45, Issue 10, 1997, pp. 764–788.

Extended Capabilities

See Also

Introduced in R2016a