Quantcast

Data Acquisition Toolbox

Performing Spectral Analysis on Live Audio Data

The Data Acquisition Toolbox provides Simulink blocks for acquiring live analog or digital data directly into your Simulink models.

This example uses the Analog Input block to acquire live signals from a data acquisition device into Simulink. In this example, the sound card is selected as the input device in the Analog Input block. The Simulink model implements a spectral analysis method known as the periodogram. A periodogram computes the spectral content of a signal over time.

Watch the spectrogram on a live audio input (0:18)

The input signal is a real-time audio signal through a microphone. The signal is buffered into frames, with 128 samples per frame. Each frame is then windowed using a Hamming window function, and the blockset computes the FFT for the windowed frame. The system collects the FFTs for successive frames and plots them to produce a spectrogram.

Even though a Windows sound card was used for this example, this model can be easily updated to connect your models to other supported data acquisition devices. This provides you the flexibility to use the same Simulink model with different data acquisition device.