Main Content

interauralLevelDifference

Interaural level difference

Since R2024a

    Description

    example

    ild = interauralLevelDifference(s) computes the interaural level difference of the HRTF measurements in the horizontal plane at zero elevation. The interaural level difference is a binaural localization cue.

    ild = interauralLevelDifference(s,Name=Value) specifies options using one or more name-value arguments.

    example

    [ild,f] = interauralLevelDifference(___) also returns the frequencies corresponding to the interaural level differences.

    example

    [ild,f,ang] = interauralLevelDifference(___) also returns the angles corresponding to the measurements.

    example

    interauralLevelDifference(___) with no output arguments plots the interaural level difference.

    Examples

    collapse all

    Read in a SOFA file containing HRTF measurements.

    s = sofaread("ReferenceHRTF.sofa");

    Compute the interaural level difference of the HRTF data in the horizontal plane.

    [ild,f,azi] = interauralLevelDifference(s);

    Call interauralLevelDifference with no output arguments to plot the interaural level difference of the HRTF data in the horizontal plane.

    interauralLevelDifference(s)

    Input Arguments

    collapse all

    SOFA object, specified as one of the following objects.

    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: interauralLevelDifference(s, Plane="horizontal")

    Number of points in the frequency response, specified as a positive integer. For SimpleFreeFieldHRIR objects, the default value is max(2048,L), where L is the length of the HRTF impulse responses. For SimpleFreeFieldHRSOS objects, the default value is 2048.

    This argument does not apply to SimpleFreeFieldHRTF objects.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Plane to compute the interaural level difference, specified as "horizontal", "median", or "sagittal".

    Data Types: char | string

    Plane offset angle in degrees, specified as a value in the range [-90,90]. This angle specifies the offset by which the Plane is shifted.

    This argument only applies to the horizontal and sagittal planes. For the horizontal plane, the offset corresponds to the elevation angle. For the sagittal plane, the offset corresponds to the lateral angle.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Angle tolerance in degrees, specified as a positive scalar. The function computes the interaural level difference of the measurements within the tolerance of the plane specified by Plane and PlaneOffsetAngle.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Use interpolated HRTF measurements, corresponding to 100 uniformly-spaced points in the specified plane, to compute the interaural level difference. Set this argument to true if the plane specified by Plane, PlaneOffsetAngle, and AngleTolerance does not contain a sufficient number of HRTF measurements. The function uses the bilinear interpolation method.

    Data Types: logical

    Output Arguments

    collapse all

    Interaural level difference in dB, returned as an N-by-M matrix, where N is the number of points in the frequency response, and M is the number of specified measurements.

    Frequencies in Hz corresponding to the interaural level differences, returned as a vector of length N, where N is the number of points in the frequency response.

    Angles in degrees corresponding to the measurements used to compute the interaural level difference, returned as a vector. The interpretation of the angles depends on the specified Plane.

    • For the horizontal plane, the angles correspond to the azimuth.

    • For the median plane, the angles correspond to the elevation.

    • For the sagittal plane, the angles correspond to the polar angles.

    More About

    collapse all

    Interaural Level Difference

    The interaural level difference is the difference in the power spectrum of the received sounds at the left and right ears. This provides a binaural localization cue at frequencies above approximately 1000 Hz because the head casts an acoustic shadow at higher frequencies.

    At frequencies below 1500 Hz, the interauralTimeDifference provides a better binaural localization cue.

    References

    [1] Lee, Gyeong-Tae, Sang-Min Choi, Byeong-Yun Ko, and Yong-Hwa Park. "HRTF measurement for accurate sound localization cues." arXiv preprint arXiv:2203.03166 (2022).

    Version History

    Introduced in R2024a