SofaMyRoom - Parameters¶
Table of contents
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 |
|
Room dimension [m] |
room.humidity |
|
Relative humidity |
room.temperature |
|
Room temperature [°C] |
Surface Absorption and Diffusion Coefficients |
||
room.surface.frequency |
|
Frequency bands [Hz] |
room.surface.absorption |
|
Absorption coefficients |
room.surface.diffusion |
|
Diffusion coefficients |
Simulation Options |
||
options.fs |
|
Sampling frequency [Hz] |
options.responseduration |
|
Maximum duration [s] |
options.bandsperoctave |
|
Simulation frequency accuracy |
options.referencefrequency |
|
Reference frequency [Hz] |
options.airabsorption |
|
Apply air absorption |
options.distanceattenuation |
|
Apply distance attenuation |
options.subsampleaccuracy |
|
Apply subsample accuracy |
options.highpasscutoff |
|
3dB high-pass filter |
options.verbose |
|
Print status messages |
Specular Reflections |
||
options.simulatespecular |
|
Simulate specular reflections |
options.reflectionorder |
|
Maximum specular reflection order [x,y,z] |
Diffuse reflections |
||
options.simulatediffuse |
|
Simulate diffuse reflections |
options.numberofrays |
|
Number of rays 20*K^2 |
options.diffusetimestep |
|
Time resolution in diffuse energy histogram [s] |
options.rayenergyfloordB |
|
Ray energy threshold with respect to initial energy [dB] |
options.uncorrelatednoise |
|
Uncorrelated poisson arrivals |
Output Options |
||
options.outputname |
|
Name of the output file |
options.max_saveaswav |
|
Format of the ouput file |
Source Definitions |
||
source(<n> 2).location |
|
Location of source [m] |
source(<n>).orientation |
|
Orientation of source [deg] |
source(<n>).description |
see 5 |
Source type |
Source Definitions |
||
receiver(<n>).location |
|
Location of receiver [m] |
receiver(<n>).orientation |
|
Orientation of receiver |
receiver(<n>).description |
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';