main content

measure impulse response of an audio system -凯发k8网页登录

the impulse response (ir) is an important tool for characterizing or representing a linear time-invariant (lti) system. the enables you to measure and capture the impulse response of audio systems, including:

  • audio i/o hardware

  • rooms and halls

  • enclosed spaces like inside of a car or a recording studio

in this example, you use the to measure the impulse response of your room. you then use the acquired impulse response with audiopluginexample.fastconvolver to add reverberation to an audio signal.

this example requires that your machine has an audio device capable of full-duplex mode and an appropriate audio driver. to learn more about how the app records and plays audio data, see .

description of ir measurement techniques

the swept sine measurement technique uses an exponential time-growing frequency sweep as an output signal. the output signal is recorded and deconvolution is used to recover the impulse-response from the swept sine tone. for more details, see [1].

the maximum-length-sequence (mls) technique is based upon the excitation of the acoustical space by a periodic pseudo-random signal. the impulse response is obtained by circular cross-correlation between the measured output and the test tone (mls sequence). for more details, see [2].

in this example, you use the mls measurement technique.

acquire impulse response of room

1. to open the app, at the matlab® command prompt, enter:

impulseresponsemeasurer

impulseresponsemeasurerapp_thumbnail.png

2. use the default settings of the app and click capture. make sure the device name and the channel number match your system's configuration.

3. once you capture the impulse response, click the export button and select to workspace.

measureimpulsereponseofanaudiosystemexample_image.png

use impulse response to add reverb to an audio signal

time-domain convolution of an input frame with a long impulse response adds latency equal to the length of the impulse response. the algorithm used by the audiopluginexample.fastconvolver plugin uses frequency-domain partitioned convolution to reduce the latency to twice the partition size [3]. audiopluginexample.fastconvolver is well-suited to impulse responses acquired using impulseresponsemeasurer.

1. to create an audiopluginexample.fastconvolver object, at the matlab® command prompt, enter:

fastconvolver = audiopluginexample.fastconvolver
fastconvolver = 
  audiopluginexample.fastconvolver with properties:
    impulseresponse: [0 0 -3.0518e-05 3.0518e-05 0 0 0 3.0518e-05 0 0 0 3.0518e-05 0 0 0 0 0 0 0 0 0 0 0 0 3.0518e-05 0 0 0 -3.0518e-05 -3.0518e-05 0 0 -3.0518e-05 0 0 3.0518e-05 0 -3.0518e-05 0 0 0 3.0518e-05 0 0 0 -3.0518e-05 0 0 0 0 3.0518e-05 0 0 … ]
      partitionsize: 1024

2. set the impulse response property to your acquired impulse response measurement. you can clear the impulse response for your workspace once it is saved to the fast convolver.

load measuredimpulseresponse
irestimate = measuredimpulseresponse.impulseresponse.amplitude(:,1);
fastconvolver.impulseresponse = irestimate;

3. open the audio test bench and specify your fast convolver object.

audiotestbench(fastconvolver)

4. by default, the reads from an audio file and writes to your audio device. click run to listen to an audio file convolved with your acquired impulse response.

tips and tricks

the excitation level slider on the impulseresponsemeasurer applies gain to the output test tone. a higher output level is generally recommended to maximize signal-to-noise ratio (snr). however, if the output level is too high, undesired distortion may occur.

export to filter visualizer () through the export button to look at other useful plots like phase response, group delay, etc.

references

[1] farina, angelo. "advancements in impulse response measurements by sine sweeps." presented at the audio engineering society 122nd convention, vienna, austria, 2007.

[2] guy-bart, stan, jean-jacques embrechts, and dominique archambeau. "comparison of different impulse response measurement techniques." journal of audio engineering society. vol. 50, issue 4, pp. 249-262.

[3] armelloni, enrico, christian giottoli, and angelo farina. "implementation of real-time partitioned convolution on a dsp board." applications of signal processing to audio and acoustics, 2003 ieee workshop on., pp. 71-74. ieee, 2003.

网站地图