Main Content

Audio Plugin Example Gallery

Use these Audio Toolbox™ plugin examples as building blocks in larger systems, as models for design patterns, or as benchmarks for comparison. Search the plugin descriptions to find an example that meets your needs.

Audio Effects

Chorus

Name: audiopluginexample.Chorus

Type: Basic plugin

Description: Adds an audio chorus effect. The chorus effect is implemented by modulating two delay lines.

Design Patterns: dependent properties, wet/dry mix, sample rate

Features Used: dsp.VariableFractionalDelay, audioOscillator

Related Example: Delay-Based Audio Effects

Inspect Code | Run Plugin | Generate Plugin

Echo

Name: audiopluginexample.Echo

Type: Basic plugin

Description: Implements an audio echo effect using two delay lines. The plugin user tunes the delay taps in seconds, the gain of the delay taps, and the output dry/wet mix.

Design Patterns: dependent properties, wet/dry mix, sample rate, MEX function called from a property, delay line with feedback

Related Example: Delay-Based Audio Effects

Inspect Code | Run Plugin | Generate Plugin

Flanger

Name: audiopluginexample.Flanger

Type: Basic plugin

Description: Implements an audio flanging effect using a modulated delay line. The plugin user tunes the delay tap in seconds, the amplitude and frequency of the delay line modulation, and the output dry/wet mix.

Design Patterns: dependent properties, wet/dry mix, MEX function called from a property, delay line with feedback

Features Used: dsp.VariableFractionalDelay

Related Example: Delay-Based Audio Effects

Inspect Code | Run Plugin | Generate Plugin

LFO Filter

Name: audiopluginexample.LFOFilter

Type: Basic plugin

Description: Implements a low frequency oscillator (LFO) controlled lowpass filter. The LFO controls the cutoff frequency of the lowpass filter. The plugin user tunes the type of control signal, and its frequency, amplitude, and DC offset. The plugin user also tunes the Q factor of the lowpass filter.

Design Patterns: enum helper class for enum parameter mapping, log parameter mapping, real-time visualization, waveform design with UI

Features Used: audioOscillator, wavetableSynthesizer, dsp.BiquadFilter

Inspect Code | Run Plugin | Generate Plugin

Phaser

Name: audiopluginexample.Phaser

Type: Basic plugin

Description: Implements an audio phaser effect.

Design Patterns: plugin composition

Features Used: audioOscillator multibandParametricEQ, audiopluginexample.MultiNotchFilter

Related Example: Audio Phaser Using Multiband Parametric Equalizer

Inspect Code | Run Plugin | Generate Plugin

Pitch Shifter

Name: audiopluginexample.PitchShifter

Type: System object™ plugin

Description: Implements a pitch-shifting algorithm using cross-fading between two channels with time-varying delays and gains.

Design Patterns: integer parameter mapping, DiscreteState, multiple outputs for MATLAB® validation and analysis

Features Used: dsp.VariableFractionalDelay

Related Example: Delay-Based Pitch Shifter

Inspect Code | Run Plugin | Generate Plugin

Strobe

Name: audiopluginexample.Strobe

Type: Basic plugin

Description: Implements an audio strobing effect. Tunable parameters of the plugin include the strobe period, the strobe fill, a relative level threshold for implementing the effect, and the ability to synchronize the strobe period with the audio signal dynamics.

Design Patterns: logical parameters, enum helper class for enum parameter mapping

Features Used: audioOscillator

Inspect Code | Run Plugin | Generate Plugin

Filters

Bandpass IIR Filter

Name: audiopluginexample.BandpassIIRFilter

Type: Basic plugin

Description: Implements a bandpass filter using a second-order IIR filter. The plugin parameters are the center frequency and Q-factor.

Design Patterns: log parameter mapping, dependent properties, efficient management of tunable properties (in SecondOrderIIRFilter), visualization while processing (in SecondOrderIIRFilter), inherit from abstract base class

Features Used: filter

Related Example: Tunable Filtering and Visualization Using Audio Plugins

Inspect Code | Run Plugin | Generate Plugin

Fast Convolver

Name: audiopluginexample.FastConvolver

Type: System object plugin

Description: Convolves input with long impulse responses without adding long latency. Time-domain convolution of an input frame with a long impulse response adds latency equal to the length of the impulse response. The algorithm in this plugin uses frequency-domain partitioned convolution to reduce the latency. Being efficient, this algorithm also allows for real-time convolution with larger impulse responses.

Design Patterns: no tunable parameters, latency reporting

Features Used: dsp.FrequencyDomainFIRFilter, setLatencyInSamples

Related Example: Measure Impulse Response of an Audio System

Inspect Code | Run Plugin | Generate Plugin

Highpass IIR Filter

Name: audiopluginexample.HighpassIIRFilter

Type: Basic plugin

Description: Implements a highpass filter using a second-order IIR filter. The plugin parameters are the cutoff frequency and Q-factor.

Design Patterns: log parameter mapping, Dependent properties, efficient management of tunable properties (in SecondOrderIIRFilter), visualization while processing (in SecondOrderIIRFilter), inherit from abstract base class

Features Used: filter

Related Example: Tunable Filtering and Visualization Using Audio Plugins

Inspect Code | Run Plugin | Generate Plugin

Lowpass IIR Filter

Name: audiopluginexample.LowpassIIRFilter

Type: Basic plugin

Description: Implements a lowpass filter using a second-order IIR filter. The plugin parameters are the cutoff frequency and Q-factor.

Design Patterns: log parameter mapping, Dependent properties, efficient management of tunable properties (in SecondOrderIIRFilter), filter visualization while processing (in SecondOrderIIRFilter), inherit from abstract base class

Features Used: filter

Related Example: Tunable Filtering and Visualization Using Audio Plugins

Inspect Code | Run Plugin | Generate Plugin

Multi-Notch IIR Filter

Name: audiopluginexample.MultiNotchFilter

Type: System object plugin

Description: Implements a notching IIR filter with tunable notch frequencies and quality factor.

Features Used: multibandParametricEQ

Related Example: Audio Phaser Using Multiband Parametric Equalizer

Inspect Code | Run Plugin | Generate Plugin

Shelving Equalizer

Name: audiopluginexample.ShelvingEqualizer

Type: System object plugin

Description: Implements a shelving equalizer with tunable cutoffs, gains, and slopes.

Design Patterns: log parameter mapping, filter visualization

Features Used: designShelvingEQ, dsp.BiquadFilter

Related Example: Tunable Filtering and Visualization Using Audio Plugins

Inspect Code | Run Plugin | Generate Plugin

Variable Slope Bandpass Filter

Name: audiopluginexample.VarSlopeBandpassFilter

Type: System object plugin

Description: Implements a variable slope IIR bandpass filter with tunable cutoff frequencies and slopes.

Design Patterns: string enum parameter mapping, log parameter mapping, filter visualization

Features Used: designVarSlopeFilter, dsp.BiquadFilter

Related Example: Tunable Filtering and Visualization Using Audio Plugins

Inspect Code | Run Plugin | Generate Plugin

Gain Control

Bass Enhancer

Name: audiopluginexample.BassEnhancer

Type: System object plugin

Description: Implements a psychoacoustic bass enhancement algorithm. The plugin parameters are the upper cutoff frequency of the bandpass filter and the gain applied at the output of the bandpass filter.

Design Patterns: plugin composition

Features Used: crossoverFilter, audioexample.FullWaveIntegrator, audiopluginexample.VarSlopeBandpassFilter, dsp.FIRFilter

Related Example: Psychoacoustic Bass Enhancement for Band-Limited Signals

Inspect Code | Run Plugin | Generate Plugin

Volume Controller

Name: audiopluginexample.VolumeController

Type: Basic plugin

Description: Control the volume of an audio signal as well as the left/right balance in stereo signals. Additionally, use the Transition Time parameter to specify the delay to apply the changes to the signal.

Design Patterns: power parameter mapping, multiple outputs for MATLAB validation and analysis

Features Used: audioexample.DampedParameter

Inspect Code | Run Plugin | Generate Plugin

Spatial Audio

Ambisonic Encoder

Name: audiopluginexample.AmbiEncoderPlugin

Type: Basic plugin

Description: Specify the microphone locations by tuning the azimuth and elevation. Encode streaming audio into ambisonics using the process function.

Design Patterns: Multi-channel, variable number of channels, ambisonic encoding

Features Used: audioexample.ambisonics.ambiencodemtrx, audioexample.ambisonics.ambiencode

Related Example: Ambisonic Plugin Generation

Inspect Code | Run Plugin | Generate Plugin

Ambisonic Decoder

Name: audiopluginexample.AmbiDecoderPlugin

Type: Basic plugin

Description: Specify desired virtual speaker locations by tuning the azimuth and elevation. Decode ambisonic-encoded audio using the process function.

Design Patterns: Multi-channel, variable number of channels, ambisonic decoding

Features Used: audioexample.ambisonics.ambidecodemtrx, audioexample.ambisonics.ambidecode

Related Example: Ambisonic Plugin Generation

Inspect Code | Run Plugin | Generate Plugin

Communicate Between MATLAB and DAW

Parametric Equalizer with UDP

Name: audiopluginexample.ParametricEqualizerWithUDP

Type: System object plugin

Description: Implements a three-band parametric equalizer with tunable center frequencies, Q-factors, and gains. A UDP sender enables the generated VST plugin to communicate with MATLAB. The digital audio workstation and MATLAB can then exchange information in real time. This plugin uses UDP to send the equalizer filter coefficients back to MATLAB for visualization purposes. You can alter this plugin to send the input or output audio instead of, or in addition to, the filter coefficients.

Design Patterns: log parameter mapping, filter visualization

Features Used: designParamEQ, dsp.UDPSender

Related Example: Communicate Between a DAW and MATLAB Using UDP

Inspect Code | Run Plugin | Generate Plugin

UDP Sender

Name: audiopluginexample.UDPSender

Type: Basic plugin

Description: Sends live stereo audio from a digital audio workstation (DAW) to MATLAB using UDP.

Design Patterns: no tunable parameters

Features Used: dsp.UDPSender

Related Example: Communicate Between a DAW and MATLAB Using UDP

Inspect Code | Generate Plugin

Music Information Retrieval

Beat Detector

Name: audiopluginexample.BeatDetector

Type: Basic plugin

Description: Estimates and displays a beat per minute (BPM) decision using the specified onset detection method. If you interact with the plugin at the command line, you can get a click track corresponding to the onsets detected using the getClickTrack method.

Design Patterns: plugin composition, visualization, MATLAB-only features

Features Used: dsp.AsyncBuffer, audiopluginexample.private.OnsetDetector, audiopluginexample.private.MeterUI

Inspect Code | Run Plugin | Generate Plugin

Speech Processing

Spectral Subtractor

Name: audiopluginexample.SpectralSubtractor

Type: Basic plugin

Description: Implements basic spectral subtraction. This plugin performs frequency-domain processing. Tunable parameters of the plugin include analysis window type, noise level estimation, analysis window time, and analysis frame overlap.

Design Patterns: overlap and add (OLA) reconstruction, analysis and synthesis, enum helper class for parameter mapping, windowing

Features Used: fft, ifft, dsp.AsyncBuffer, audiopluginexample.private.AnalysisAndSynthesisBuffer

Inspect Code | Run Plugin | Generate Plugin

Speech Pitch Detector

Name: audiopluginexample.SpeechPitchDetector

Type: Basic plugin

Description: Calculates pitch using a basic autocorrelation algorithm, spectral periodicity algorithm, or both. This plugin is for analysis purposes: It provides a direct feedthrough of the signal. To visualize the pitch decision, use the visualize method while processing speech data.

Design Patterns: plugin composition, visualization, MATLAB-only features

Features Used: multibandParametricEQ, dsp.AsyncBuffer, dsp.FIRInterpolator, timescope, designMultirateFIR, fft, ifft, xcorr, audiopluginexample.private.VarSlopeBandpassFilter, audiopluginexample.private.AnalysisAndSynthesisBuffer, audiopluginexample.private.MeterUI

Inspect Code | Run Plugin | Generate Plugin

Deep Learning

Denoiser

Name: audiopluginexample.Denoiser

Type: Deep learning plugin

Description: Denoises speech using a deep neural network. This plugin includes an optional configurable noise gate at the output of the network. To generate and use the plugin, download the pretrained deep neural network and save it to a MAT-file using this code:

% Download pretrained network to current folder
unzip('https://ssd.mathworks.com/supportfiles/audio/SpeechDenoising.zip',pwd)

% Save relevant network in MAT-file
s = load('SpeechDenoising/denoisenet.mat');
denoiseNetFullyConnected = s.denoiseNetFullyConnected;
save('denoisePluginNet.mat','denoiseNetFullyConnected')

Design Patterns: pretrained deep learning neural network, sample rate conversion, audio plugin coder configuration

Features Used: audioPluginConfig, coder.loadDeepLearningNetwork (MATLAB Coder), dsp.AsyncBuffer, dsp.FIRDecimator, dsp.FIRInterpolator, dsp.FIRRateConverter, dsp.ISTFT, dsp.STFT, noiseGate, predict (Deep Learning Toolbox)

Related Example: Denoise Speech Using Deep Learning Networks

Inspect Code | Run Plugin | Generate Plugin

See Also

| | | |

Related Topics