SofaMyRoom - Parameters

Parameters

Complete list of the parameters accepted in the setup file, in the MATLAB structure and in the Python Setup (same names and defaults). Each parameter is one name = value; assignment and a line starting with % is a comment.

Name

Type

Description

room.dimension

[1, 3] double

Room dimension [m]

room.humidity

double

Relative humidity

room.temperature

double

Room temperature [°C]

Surface Absorption and Diffusion Coefficients

room.surface.frequency

[1, F] double

Frequency bands [Hz]

room.surface.absorption

[6, F] double [7]

Energy absorption coefficients, in [0, 1]

room.surface.diffusion

[6, F] double [7]

Scattering coefficients, in [0, 1]

Simulation Options

options.fs

integer

Sampling frequency [Hz]

options.responseduration

double

Maximum duration [s]

options.bandsperoctave

integer

Simulation frequency accuracy

options.referencefrequency

double

Reference frequency [Hz]

options.airabsorption

boolean

Apply air absorption

options.distanceattenuation

boolean

Apply distance attenuation

options.verbose

boolean

Print status messages

Specular Reflections

options.simulatespecular

boolean

Simulate specular reflections

options.reflectionorder

[1, 3] integer

Maximum specular reflection order [x,y,z]

Diffuse reflections

options.simulatediffuse

boolean

Simulate diffuse reflections

options.numberofrays

integer

Number of rays 20*K^2

options.diffusetimestep

double

Time resolution in diffuse energy histogram [s]

options.rayenergyfloordB

double

Ray energy threshold with respect to initial energy [dB]

options.uncorrelatednoise

boolean

Uncorrelated poisson arrivals

options.seed

integer

Seed of the random number generator (optional, 0 = built-in default)

Output Options

options.outputname

string

Name of the output file

options.mex_saveaswav

boolean [1]

Write WAVE files instead of returning the responses

Source Definitions

source(<n> [2]).location

[1, 3] double [3]

Location of source [m]

source(<n>).orientation

[1, 3] double [4]

Orientation of source [deg]

source(<n>).description

see [5]

Source type

Receiver Definitions

receiver(<n>).location

[1, 3] double [3]

Location of receiver [m]

receiver(<n>).orientation

[1, 3] double [4]

Orientation of receiver [deg]

receiver(<n>).description

see [5], [6]

Receiver type

Notes

The options options.subsampleaccuracy and options.highpasscutoff of earlier versions are still accepted but have no effect.

Example

data/sampleroomsetup.txt in the repository:

% SAMPLEROOMSETUP - Sample setup parameter structure for sofamyroom

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Author: Steven Schimmel, stevenmschimmel@gmail.com
% adapted by: Roberto Barumerli, roberto.baru@gmail.com
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%    room settings
%
room.dimension              = [ 10 7 4 ];   % room dimension (x,y,z)
room.humidity               = 0.42;         % relative humidity (0,...,1)
room.temperature            = 20;           % room temperature (celsius)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%    surface absorption/diffusion coefficients
%
room.surface.frequency      = [  125       250       500       1000      2000      4000];
room.surface.absorption     = [  0.1000    0.0500    0.0600    0.0700    0.1000    0.1000;
                                 0.1400    0.3500    0.5300    0.7500    0.7000    0.6000;
                                 0.1000    0.0500    0.0600    0.0700    0.1000    0.1000;
                                 0.1000    0.0500    0.0600    0.0700    0.1000    0.1000;
                                 0.0100    0.0200    0.0600    0.1500    0.2500    0.4500;
                                 0.2400    0.1900    0.1400    0.0800    0.1300    0.1000 ];
room.surface.diffusion      = [  0.5       0.5       0.5       0.5       0.5       0.5   ; 
                                 0.5       0.5       0.5       0.5       0.5       0.5   ; 
                                 0.5       0.5       0.5       0.5       0.5       0.5   ; 
                                 0.5       0.5       0.5       0.5       0.5       0.5   ; 
                                 0.5       0.5       0.5       0.5       0.5       0.5   ; 
                                 0.5       0.5       0.5       0.5       0.5       0.5    ];


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%    simulation options
%
options.fs                  = 44100;                % sampling frequency in Hz
options.responseduration    = 1.25;                 % duration of impulse response
options.bandsperoctave      = 1;                    % simulation frequency accuracy (1, 2, 3, or 4 bands/octave)
options.referencefrequency  = 125;                  % reference frequency for frequency octaves
options.airabsorption       = true;                 % apply air absorption?
options.distanceattenuation = true;                 % apply distance attenuation?
options.verbose             = true;                 % print status messages?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%    specular reflections simulation options
%
options.simulatespecular    = true;                 % simulate specular reflections?
options.reflectionorder     = [ 10 10 10 ];         % maximum specular reflection order (x,y,z)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%    diffuse reflections simulation options
%
options.simulatediffuse     = false;                 % simulate diffuse reflections?
options.numberofrays        = 2000;                 % number of rays in simulation (20*K^2)
options.diffusetimestep     = 0.010;                % time resolution in diffuse energy histogram (seconds)
options.rayenergyfloordB    = -80;                  % ray energy threshold (dB, with respect to initial energy)
options.uncorrelatednoise   = true;                 % use uncorrelated poisson arrivals for binaural impulse responses?
options.seed                = 0;                    % seed of the random number generator (0 = built-in default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%    output options
%
options.outputname			= 'output';           	% name of the output file
options.mex_saveaswav       = false;                % enable or disable saving the results of sofamyroom on disk
                                                    % when using MATLAB

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%    source definitions
%
source(1).location           = [ 8 2.5 1.6 ];       % location of source (x,y,z; meters)
source(1).orientation        = [ 180 0 0 ];         % orientation of source (yaw,pitch,roll; degrees)
source(1).description        = 'subcardioid';       % source type

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%    receiver definitions
%
receiver(1).location         = [ 3 5 1.2 ];         % location of receiver (x,y,z; meters)
receiver(1).orientation      = [ 0 0 0 ];           % orientation of receiver (yaw,pitch,roll; degrees)
receiver(1).description      = 'SOFA data/MIT_KEMAR_normal_pinna.sofa';  % receiver type