measure and manage impulse responses
in this tutorial, explore key functionality of the . the impulse response measurer app enables you to
configure your audio i/o system.
acquire impulse response (ir) measurements using either the exponential swept sine (ess) or maximum length sequences (mls) methods.
view and manage captured ir data.
export the data to a file, workspace, or other app for further study.
generate a script that performs ir measurements according to the current settings.
to begin, open the impulse response measurer app by selecting the icon from the app gallery.
configure audio i/o system
the impulse response measurer app enables you to specify an audio device, sample rate, samples per frame, player channel, and recorder channel. the audio device must be a real or virtual device enabled for simultaneous playback and recording (full-duplex mode) and must use a supported driver. supported drivers are platform-specific:
windows® –– asio™: click the button to open the settings panel for the asio driver.
mac –– coreaudio
linux® –– alsa
valid values for sample rate and number of samples per frame depend on your specified audio device.
you can use the level monitor to .
loopback cable for latency measurement
to measure the audio device latency and remove it from captured measurements, you must use a loopback cable to connect one of the device player channels directly to one of the recorder channels.
to enable latency measurement and removal, click the latency
compensation drop-down list, select loopback
measurement
, and then set the loopback
channels to the player and recorder channels that are connected
by the loopback cable.
this example sets latency compensation to
none
, so it does not measure the audio device
latency.
configure ir acquisition method
to configure your ir acquisition method, use the method and method settings sections of the toolstrip.
you can select the method to acquire ir measurements as either:
maximum length sequences
(mls)exponential swept sine
(swept sine)
both methods for ir acquisition have the same basic settings, including:
number of runs –– number of times the excitation signal is sent within a single capture. multiple runs are used to average individual impulse response captures to reduce measurement noise.
duration per run (s) –– total time of each run in seconds.
excitation level (dbfs) –– the level of the excitation signal in dbfs.
both methods for ir acquisition also have the same advanced run settings, including:
wait before first run –– delay before starting first run. the delay allows time for any last-minute tasks, such as exiting a room before testing its acoustics.
pause between runs –– duration of the pause between runs. during a pause, the excitation signal is not sent, and audio is not recorded. when using the swept sine method, include a pause between runs to avoid buildup of reverberations. pause between runs is always zero for the mls method.
number of warmup runs –– number of times to output the excitation signal before acquisition. the mls method assumes the signal it acquires is a combination of the excitation signal and its impulse response.
the total capture time is a sum of run durations, pauses, and the initial wait.
the swept sine method has additional advanced settings to control the excitation signal, including:
sweep start frequency
sweep stop frequency
sweep duration
end silence duration
when using the swept sine method, the run duration is divided into sweep duration and end silence duration. during the end silence, the app continues to record audio, enabling acquisition of the response over the entire range of the frequency sweep.
starting in r2022a, you can automatically save device, method, and advanced settings and use them in future measurement sessions.
acquire ir measurements
for this example, use the swept sine method with default settings. once you have your audio device set up, click capture. a dialog box opens that displays the progress of your capture. capture ir measurements twice.
analyze and manage ir measurements
after the capture, the impulse response measurer app stores the
captured data locally. the captured data panel displays the
title of the captured data, the colors used for plotting, and information about the
settings used to acquire the data. you can double-click the color to choose which
color you want associated with each impulse response. you can also double-click the
title to rename your captured data. rename your captures as
firstcapture
and secondcapture
, and change
the colors to pink and green. to make one impulse response plot appear on top of the
other, select the title under captured data. select the capture
you relabeled firstcapture
.
by default, the impulse response and magnitude response are plotted. you can view any combination of the impulse, magnitude, and phase response using the display button. here you can also remove the measured audio device latency from the plotted impulse response and phase response.
minimize captured data and captured data information, then select the phase response.
you can toggle the relative size of the plot by moving the dividers. you can zoom
in and out or toggle between linear and logarithmic frequency axes by selecting the
icons that appear when your pointer is over the plot. updating either the magnitude
response or the phase response updates the other. zoom in on the impulse response
plot and in the range 0–20 hz of your frequency response plots. zooming in, you can
see the small delay between firstcapture
and
secondcapture
. when the zoom level is high enough, line
markers automatically appear.
export ir measurements
to view export options for further analysis or use, click export.
export the data to your workspace. the data is saved as a table. to inspect how the data is saved, display the table you exported.
irdata_160957
irdata_160957 = 2×17 table timeofcapture impulseresponse device samplerate samplesperframe playerchannels recorderchannel method numruns durationperrun excitationlevel rawaudiodata samplesdropped devicelatencyinsamples othermetadata magnituderesponse phaseresponse ______________________________ _______________ ____________________ __________ _______________ ______________ _______________ ____________ _______ ______________ _______________ ____________ ______________ ______________________ _____________ _________________ _____________ firstcapture 30-jun-2022 15:59:42 utc-04:00 1×1 struct "focusrite usb asio" 44100 1024 {[1]} 1 "swept sine" 1 4 -6 1×1 struct 0 nan 1×1 struct 1×1 struct 1×1 struct secondcapture 30-jun-2022 15:59:54 utc-04:00 1×1 struct "focusrite usb asio" 44100 1024 {[1]} 1 "swept sine" 1 4 -6 1×1 struct 0 nan 1×1 struct 1×1 struct 1×1 struct
when you export the data as a mat-file, the same table is saved as when you export
to the workspace. when you select to export the data as a wav file, each impulse
response is saved as a separate wav file. the title of the capture is the name of
the wav file. in this example, selecting to export data to audio wav file places two
wav files in the specified folder, firstcapture.wav
and
secondcapture.wav
.
to analyze your captured data further, view the data in or signal analyzer.
generate matlab code
you can generate matlab® code that measures impulse responses using the current settings of the app. to open an untitled script in the matlab editor containing the code, click generate script in the export section of the toolstrip.
run the script to measure the impulse response and store the captured data in the
capture
structure.
capture
capture = struct with fields: impulseresponse: [1×1 struct] magnituderesponse: [1×1 struct] phaseresponse: [1×1 struct]
the script optionally plots the impulse, magnitude, and phase response according to the display settings in the app.
you can examine the generated code to understand how the app performs the measurement, and you can edit the script for customization.
see also
| | |