MATLAB Examples

Parametric Audio Equalizer for ARM Cortex-A Processor

This example shows how to generate and run the code of a parametric audio equalizer on ARM® Cortex-A processor while adjusting equalizer response in the SIMULINK® environment.



Parametric equalizers are often used to adjust the frequency response of an audio system. For example, a parametric equalizer can be used to compensate for physical speakers, which have peaks and dips at different frequencies.

The parametric equalizer algorithm in this example provides three second-order (bi-quadratic) filters whose coefficients can be adjusted to achieve the desired frequency response. A graphical user interface (GUI) is used during simulation to dynamically adjust filter coefficients.

This example uses the BeagleBone Black hardware. This hardware uses a low cost 1GHz ARM Cortex-A8 processor.

Required MathWorks™ Products

DSP System Toolbox™

Simulink Coder™

Embedded Coder™

Embedded Coder Support Package for BeagleBone Black Hardware

Required Hardware

BeagleBone Black hardware

Headphones or speakers

An external USB audio card, HDMI monitor with sound playback capability or an audio cape

Audio Input, Signal Processing and Audio Output

1. The input audio signals are generated using the Signal From Workspace block, which outputs the audioSignal at a rate of 44100 samples per second. The audioSignal is read from a wave file called guitartune.wav in the model InitFcn callback.

2. The audioSignal with int16 data type is pre-processed and cast to single precision. Then, it is processed using a 3-band parametric audio equalizer, which consists of three second-order (bi-quadratic) filters whose coefficients can be adjusted to achieve a desired frequency response. A GUI is provided to assist run-time adjustment of the filter coefficients.

3. The processed audio signal is cast to integer before being sent to the BeagleBone Black ALSA (Advanced Linux Sound Architecture) Audio Playback block, which sends audio to the sound card of the target hardware for payback using ALSA driver framework.

Generate and Execute the Code on ARM Cortex-A Processor

To configure, build, and run the model in external mode for real-time audio processing on ARM Cortex-A Processor, please follow the steps in Parametric Audio Equalizer example of Embedded Coder Support Package for BeagleBone Black Hardware.