Main Content

findMeasurements

Find measurements in specified plane

Since R2024a

    Description

    idx = findMeasurements(s) returns an array of indices corresponding to measurements in the SOFA object that belong to the horizontal plane at zero elevation.

    example

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

    example

    [idx,ang] = findMeasurements(___) also returns the angles corresponding to the measurements.

    Examples

    collapse all

    Read in a SOFA file containing HRTF measurements.

    s = sofaread("ReferenceHRTF.sofa");

    Use findMeasurements to get the indices of measurements in the horizontal plane at zero elevation.

    idx = findMeasurements(s);

    Plot the 3-D geometry of the specified measurements.

    plotGeometry(s,MeasurementIndex=idx);

    Figure contains an axes object. The axes object with xlabel X (meters), ylabel Y (meters) contains 2 objects of type line. One or more of the lines displays its values using only markers These objects represent Source position, Receiver position.

    Read in a SOFA file containing HRTF measurements.

    s = sofaread("ReferenceHRTF.sofa");

    Use findMeasurements to get the indices of measurements in the sagittal plane at a lateral angle of 10 degrees.

    idx = findMeasurements(s,Plane="sagittal",PlaneOffsetAngle=10);

    Plot the 3-D geometry of the specified measurements.

    plotGeometry(s,MeasurementIndex=idx);

    Figure contains an axes object. The axes object with xlabel X (meters), ylabel Y (meters) contains 2 objects of type line. One or more of the lines displays its values using only markers These objects represent Source position, Receiver position.

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

    Plane to get the measurements from, 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 returns 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

    Output Arguments

    collapse all

    Indices of measurements, returned as a vector of positive integers.

    Angles in degrees corresponding to the measurements, 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.

    Version History

    Introduced in R2024a