SofaMyRoom - Parameters

Paramaters

Here a complete list of the paramaters that SofaMyRoom can accept. Notice that SofaMyRoom can also handle the parameters through its standard input.

A line starting with % is considered a comment and all the parameters must end with a semicolon.

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

Absorption coefficients

room.surface.diffusion

[6, F] double

Diffusion coefficients

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.subsampleaccuracy

boolean

Apply subsample accuracy

options.highpasscutoff

boolean

3dB high-pass filter

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

Output Options

options.outputname

string

Name of the output file

options.max_saveaswav

boolean 1

Format of the ouput file

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

Source Definitions

receiver(<n>).location

[1, 3] double

Location of receiver [m]

receiver(<n>).orientation

[1, 3] double 4

Orientation of receiver

receiver(<n>).description

see 5, 6

Receiver type

Notes

1

Required only in MATLAB MEX.

2

SofaMyRoom can handle more than one receiver or source per run. Substitute <n> with a progressive integer to use this feature. Each BRIR is going to be saved into a separate WAVE file.

3

SofaMyRoom does not check if the source or receiver position is within the room. Handle with care.

4(1,2)

Defined as (yaw, pitch, roll) in degrees. Run the script matlab_helpers/plotroom.m if you need to visualize your configuration.

5(1,2)

Possible values: omnidirectional, cardioid, subcardioid, hypercardiod, supercardioid, unidirectional, bidirectional, dipole, hemisphere

6

Check the README.md to understand how to handle a SOFA receiver.

Example

Here follows a sample for the parameter file.

% room settings
room.dimension = [10 7 4]; % [m]
room.humidity = 0.42; % relative humidity 
room.temperature = 20; % [deg C]

% diffuse reflections simulation options
options.simulatediffuse = true;
options.numberofrays        = 2000; 
options.diffusetimestep     = 0.010; %[s]
options.rayenergyfloordB    = -80;  %[dB]
options.uncorrelatednoise   = true;    

% specular reflections simulation options
options.simulatespecular = true; 
options.reflectionorder = [10 10 10]; 

% surface coefficients
room.surface.frequency = [125 250 500 1000 2000 4000 8000]; % [Hz]
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.1000 0.0500 0.0600 0.0700 0.1000 0.1000 0.1000;
0.1000 0.0500 0.0600 0.0700 0.1000 0.1000 0.1000;
0.0100 0.0200 0.0600 0.1500 0.2500 0.4500 0.1000;
0.2400 0.1900 0.1400 0.0800 0.1300 0.1000 0.1000];

% simulation options
options.fs = 44100; % [Hz] 
options.responseduration = 1.25; % [s]
options.bandsperoctave = 1; %  [bands/octave]
options.referencefrequency = 125; %  [Hz]
options.airabsorption = true;
options.distanceattenuation = true; 
options.subsampleaccuracy = false;
options.highpasscutoff = 0; 
options.verbose = true; 

% output options
options.outputname = 'test'; 	
% if working with MATLAB and you need the WAV file, set true the next field
options.mex_saveaswav = false;

% source definitions
source(1).location = [ 8 2.5 1.6 ]; % [m]
source(1).orientation = [ 180 0 0 ]; % [deg]
source(1).description = 'subcardioid'; 

% receiver definitions
receiver(1).location = [ 3 5 1.2 ]; % [m]
receiver(1).orientation = [ 0 0 0 ]; % [deg]
receiver(1).description = 'SOFA cipic_subject_003.sofa';