Main Content

SingleRoomMIMOSRIR

SingleRoomMIMOSRIR SOFA convention

Since R2023b

    Description

    The SingleRoomMIMOSRIR object stores SOFA data following the SingleRoomMIMOSRIR convention. This convention defines a setup used for measuring spatial room impulse responses (SRIR) in a single room with a source containing an arbitrary number of omnidirectional emitters (for example, a loudspeaker array) and a listener consisting of an arbitrary number of omnidirectional receivers (for example, a microphone array). The data is represented as FIR filters and the positions of both the source and the listener may vary. SingleRoomMIMOSRIR is an extension of SingleRoomSRIR for multiple emitters and multiple receivers considered individually. SingleRoomMIMOSRIR stores the FIR filters individually for each emitter.

    Use sofaread and sofawrite to read and write SOFA files with this convention.

    Creation

    Create a SingleRoomMIMOSRIR object using sofaconvention.

    s = sofaconvention("SingleRoomMIMOSRIR");

    Properties

    expand all

    Data

    Impulse responses in FIR form, specified as a real-valued M-by-R-by-N-by-E array, where M is the number of measurements, R is the number of receivers, N is the impulse response length, and E is the number of emitters.

    Delay of each impulse response in samples, specified as a 1-by-R matrix, M-by-R matrix, or M-by-R-by-E array, where M is the number of measurements, R is the number of receivers, and E is the number of emitters.

    Sampling rate of the data in hertz, specified as a positive scalar.

    This property is read-only.

    Sampling rate units, returned as a string.

    This property is read-only.

    Type of data in the file, returned as a string.

    Listener

    Listener position in Cartesian or spherical coordinates, specified as an M-by-3 matrix, where M is the number of measurements.

    For more information, see Spatial Data Representations.

    Listener position type, specified as "cartesian" or "spherical".

    This property is read-only.

    Listener position units, returned as "meter" if ListenerPositionType is "cartesian" or "degree, degree, meter" if ListenerPositionType is "spherical".

    Listener view direction, specified as a 1-by-3 or M-by-3 matrix, where M is the number of measurements. This property defines the direction of the positive x-axis of the local listener coordinate system.

    Listener view type, specified as "cartesian" or "spherical".

    This property is read-only.

    Listener view units, returned as "meter" if ListenerViewType is "cartesian" or "degree, degree, meter" if ListenerViewType is "spherical".

    Listener up direction, specified as a 1-by-3 or M-by-3 matrix, where M is the number of measurements. This property defines the direction of the positive z-axis of the local listener coordinate system.

    Listener short name, specified as a string. This property defines the ID of the subject from the database.

    Listener description, specified as a string.

    Receiver

    Receiver positions in Cartesian coordinates, spherical coordinates, or spherical harmonics, specified as a 1-by-3 matrix, R-by-3 matrix, or R-by-3-by-M array, where M is the number of measurements. If ReceiverPositionType is "cartesian" or "spherical", R is the number of receivers. If ReceiverPositionType is "spherical harmonics", R is the number of spherical-harmonic coefficients.

    For more information, see Spatial Data Representations.

    Receiver position type, specified as "cartesian", "spherical", or "spherical harmonics".

    This property is read-only.

    Receiver position units, returned as "meter" if ReceiverPositionType is "cartesian" or "spherical harmonics". If ReceiverPositionType is "spherical", the units are returned as "degree, degree, meter".

    Receiver view direction, specified as an R-by-3 matrix or R-by-3-by-M array, where M is the number of measurements and R is the number of receivers. This property defines the direction of the positive x-axis of the local receiver coordinate system.

    Receiver view type, specified as "cartesian" or "spherical".

    This property is read-only.

    Receiver view units, returned as "meter" if ReceiverViewType is "cartesian" or "degree, degree, meter" if ReceiverViewType is "spherical".

    Receiver up direction, specified as an R-by-3 matrix or R-by-3-by-M array, where M is the number of measurements and R is the number of receivers. This property defines the direction of the positive z-axis of the local receiver coordinate system.

    Receiver short name, specified as a string.

    General receiver description, specified as a string.

    Descriptions for each receiver, specified as an R-by-1 string array or R-by-1 cell array of character strings, where R is the number of receivers.

    Source

    Source position in Cartesian or spherical coordinates, specified as an M-by-3 matrix, where M is the number of measurements.

    For more information, see Spatial Data Representations.

    Source position type, specified as "cartesian" or "spherical".

    This property is read-only.

    Receiver position units, returned as "meter" if SourcePositionType is "cartesian" or "degree, degree, meter" if SourcePositionType is "spherical".

    Source view direction, specified as a 1-by-3 or M-by-3 matrix, where M is the number of measurements. This property defines the direction of the positive x-axis of the local source coordinate system.

    Source view type, specified as "cartesian" or "spherical".

    This property is read-only.

    Source view units, returned as "meter" if SourceViewType is "cartesian" or "degree, degree, meter" if SourceViewType is "spherical".

    Source up direction, specified as a 1-by-3 or M-by-3 matrix, where M is the number of measurements. This property defines the direction of the positive z-axis of the local source coordinate system.

    Source short name, specified as a string.

    Source description, specified as a string.

    Emitter

    Emitter position in Cartesian or spherical coordinates, specified as a E-by-3 matrix or E-by-3-by-M array, where M is the number of measurements and E is the number of emitters.

    For more information, see Spatial Data Representations.

    Emitter position type, specified as "cartesian" or "spherical".

    This property is read-only.

    Emitter position units, returned as "meter" if EmitterPositionType is "cartesian" or "degree, degree, meter" if EmitterPositionType is "spherical".

    Emitter view direction, specified as an E-by-3 matrix or E-by-3-by-M array, where M is the number of measurements and E is the number of emitters. This property defines the direction of the positive x-axis of the local emitter coordinate system.

    Emitter view type, specified as "cartesian" or "spherical".

    This property is read-only.

    Emitter view units, returned as "meter" if EmitterViewType is "cartesian" or "degree, degree, meter" if EmitterViewType is "spherical".

    Emitter up direction, specified as an E-by-3 matrix or E-by-3-by-M array, where M is the number of measurements and E is the number of emitters. This property defines the direction of the positive z-axis of the local emitter coordinate system.

    Emitter short name, specified as a string.

    General emitter description, specified as a string.

    Descriptions for each emitter, specified as an E-by-1 string array or E-by-1 cell array of character strings, where E is the number of emitters.

    Room

    Type of room used to perform the measurements, specified as a "shoebox" for data measured under echoic conditions or "dae" for data measured under echoic conditions with geometry described by a digital asset (DAE) file.

    Informal description of the room used to perform the measurements, specified as a string.

    Room geometry, specified as a string containing the uniform resource identifier (URI) to the file describing the room geometry. This property applies when RoomType is "dae".

    Room location, specified as a string.

    Room short name, specified as a string.

    Coordinates of room corner A in Cartesian or spherical coordinates, specified as a 1-by-3 or M-by-3 matrix, where M is the number of measurements.

    This property applies when RoomType is "shoebox".

    Coordinates of room corner B in Cartesian or spherical coordinates, specified as a 1-by-3 or M-by-3 matrix, where M is the number of measurements.

    This property applies when RoomType is "shoebox".

    Type of room corner coordinates, specified as "cartesian" or "spherical".

    This property is read-only.

    Units of room corner coordinates, returned as "meter" if RoomCornersType is "cartesian" or "degree, degree, meter" if RoomCornersType is "spherical".

    This property applies when RoomType is "shoebox".

    Temperature of the room during the measurements, in kelvins, specified as a scalar or vector of length M, where M is the number of measurements.

    Volume of the room used to perform the measurements, in cubic meters, specified as a scalar or vector of length M, where M is the number of measurements.

    Metadata

    Date and time of each measurement, specified as a vector of length M, where M is the number of measurements. Each element is a date value (for example, datetime("today")).

    This property is read-only.

    Name of the SOFA convention, returned as a string.

    Name of the database that this data belongs to, specified as a string.

    This property is read-only.

    Version of the SOFA AES69 specifications, returned as a string of the format "x.y" where x is the version major and y is the version minor.

    This property is read-only.

    Name of the API that created or edited the SOFA file, returned as a string.

    This property is read-only.

    Version of the API that created or edited the SOFA file, returned as a string of the format "x.y" or "x.y.z" where x is the version major and y and z are the version minors.

    This property is read-only.

    Version of the SOFA AES69 convention set, returned as a string of the format "x.y" where x is the version major and y is the version minor.

    Title containing a succinct description of the file contents, specified as a string.

    Contact information of the author (for example, an email address), specified as a string.

    Name of the organization of the author, specified as a string.

    Legal license under which the data is provided, specified as a string.

    Name of the application that created or edited the file, specified as a string.

    Version of the application that created or edited the file, specified as a string.

    Comment that can contain miscellaneous information about the data or methods used to produce the data, specified as a string.

    History defining the audio trail for modifications to the original data, specified as a string.

    Published or web-based references that describe the data or the methods used to produce the data, specified as a string.

    Origin, specified as a string representing the method used for creating the original data. In the case of model-generated data, the origin should name the model and its version. In the case of observed or measured data, the origin should characterize the data and, where possible, name the measurement method.

    This property is read-only.

    Date and time of the creation of the file, returned as a string in ISO 8601 format "YYYY-MM-DD hh:mm:ss". This property is set when a new file is created.

    This property is read-only.

    Date and time of the last file modification, returned as a string in ISO 8601 format "YYYY-MM-DD hh:mm:ss". This property is updated when a file is saved.

    Object Functions

    writeWrite SOFA file
    validateValidate SOFA data

    Examples

    collapse all

    Create a SOFA template object following the SingleRoomMIMOSRIR convention for storing room impulse responses.

    s = sofaconvention("SingleRoomMIMOSRIR");

    Read in a room impulse response measurement.

    [ir,fs] = audioread("ChurchImpulseResponse-16-44p1-mono-5secs.wav");

    Initialize the Numerator property to store five-second-long impulse responses for five measurements of three emitters and one receiver.

    M = 5;
    R = 1;
    E = 3;
    N = size(ir,1);
    s.Numerator = zeros(M,R,N,E);

    Create mock positional data for the listener and source by generating random Cartesian coordinates for each measurement. Generate random spherical coordinates for each of the emitters.

    s.ListenerPosition = rand(M,3);
    s.SourcePosition = rand(M,3);
    
    azimuth = 360*rand(E,1);
    elevation = -90 + 180*rand(E,1);
    radius = ones(E,1);
    s.EmitterPosition = [azimuth elevation radius];

    Set the SamplingRate of the SOFA object to the sample rate of the measured impulse response. Generate mock measurement data by using the same impulse response for all measurements.

    s.SamplingRate = fs;
    
    for m = 1:M
        for e = 1:E
            s.Numerator(m,1,:,e) = ir;
        end
    end

    Save the data to a SOFA file.

    sofawrite("MIMORoomIR.sofa",s);

    More About

    expand all

    Version History

    Introduced in R2023b