File Exchange

image thumbnail

Swept-Sine Analysis

version (3.89 KB) by

Acquire the linear impulse response of a device under test



View License

This method, known as swept-sine, log-chirp, swept-tone, or sine sweep uses an increasing frequency sinusoid to stimulate an acoustic device under test. The response is processed to compress the response to an impulse response. This method is robust against noise, time variance, and weak nonlinearities.

% SYNTHSWEEP Synthesize a logarithmic sine sweep.
% [sweep invsweepfft sweepRate] = synthSweep(T,FS,f1,f2)
% generates a logarithmic sine sweep that starts at frequency f1 (Hz),
% stops at frequency f2 (Hz) and duration T (sec) at sample rate FS (Hz).

% EXTRACTIR Extract impulse response from swept-sine response.
% [irLin, irNonLin] = extractIR(sweep_response, invsweepfft)
% Extracts the impulse response from the swept-sine response. Use
% synthSweep.m first to create the stimulus; then pass it through the
% device under test; finally, take the response and process it with the
% inverse swept-sine to produce the linear impulse response and
% non-linear simplified Volterra diagonals. The location of each
% non-linear order can be calculated with the sweepRate - this will be
% implemented as a future revision.

Comments and Ratings (7)



Hooman (view profile)

Rafael Borges

Can anyone explain me how it works? I have both input (sweep) and output audio files from measurements. Thank you!


Oygo (view profile)

Ben, checked. This follows 10 dB/decade which is equivalent to 3 dB/octave.


Ben (view profile)

You may want to check this. The frequency spectrum of a logarithmic swept sine should decrease with frequency at a rate of 3 dB/oct. The sweep generated by this code do not follow that trend.


This tool is very usefull and is what I was looking for.
One thing that might be hopefully added is to compute and provide a fft plot of the swept sine analysis, albeit the impulse response might be enough.




Added grpdelay2phase.m to the submission

Added function call and help file information.

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video