impz
Description
Examples
Compute Impulse Response of HRTF Data
Read in a SOFA file containing HRTF measurements.
s = sofaread("ReferenceHRTF.sofa");
Use impz
to compute the impulse response of the first measurement for the first receiver.
[h,t] = impz(s);
Call impz
with no output arguments to plot the impulse response of the first measurement for the first receiver.
impz(s)
Compute Impulse Responses in Specified Plane
Read in a SOFA file containing HRTF measurements.
s = sofaread("ReferenceHRTF.sofa");
Select the HRTF measurements in the sagittal plane at a lateral angle of 45 degrees. Plot the impulse responses of the second receiver for these measurements.
idx = findMeasurements(s,Plane="sagittal",PlaneOffsetAngle=45);
impz(s,MeasurementIndex=idx,Receiver=2)
Input Arguments
s
— SOFA object
SimpleFreeFieldHRIR
object | SimpleFreeFieldHRSOS
object
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: impz(s, MeasurementIndex=1, Receiver=[1 2])
MeasurementIndex
— Indices of measurements
1 (default) | vector of positive integers
Indices of measurements to use for the impulse response, specified as a vector of
positive integers. The indices must correspond to measurements in the data of the SOFA
object s
.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Receiver
— Indices of receivers
1 (default) | vector of positive integers
Indices of the receivers to use for the impulse response, specified as a vector of positive integers.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Length
— Length of impulse response
positive integer
Length of the impulse response, specified as a positive integer.
For SimpleFreeFieldHRIR
objects, the default value is the length of the
impulse response measurements in the HRTF data. For SimpleFreeFieldHRSOS
objects, the default value is the maximum length
returned by impzlength
over all of the SOS filters in
the HRTF data.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Output Arguments
h
— Impulse response
N-by-M-by-R array
Impulse response, returned as an N-by-M-by-R array, where:
N is the length of the impulse response.
M is the number of selected measurements defined by
MeasurementIndex
.R is the number of selected receivers defined by
Receiver
.
t
— Time vector
vector of length N
Time vector in seconds corresponding to the impulse response, returned as a vector of length N, where N is the length of the impulse response.
Version History
Introduced in R2024a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)