THE AUDITORY MODELING TOOLBOX

Applies to version: 1.6.0

View the code

Go to function

sig_barumerli2024
Spatialization of sound sources as FrAMBI examples

Usage:

[environment, options] = sig_barumerli2024(flags, options)

Input parameters:

flag

String describing the type of the environment:

  • 'horizontal': Spatializes a sound source in the horizontal plane. It is used by the agent barumerli2024_itdlateral.
  • 'mockup': A mockup of spatialization in the vertical plane. It is used by the agent barumerli2024_mockup.
options Optional structure representing the FrAMBI options.

Output parameters:

environment

Structure representing the FrAMBI environment. See the general description of FrAMBI for more details. In addition, the following environment-specific fields are created:

  • name: String describing the environment. Default: The string from flag.
  • model: Structure defining the functionality of the environment by storing functions handles in fields initialize, execute, and conclude.
  • state.parameters: Parameter structure as in frambi_parameters storing the states of the evironment:
    • angle: The sound source angle (in degrees). Default: 0 degrees.
    • duration: The duration (in s) of the sound. Used in the 'horizontal' environment only. Default: 150 ms.
    • angular_speed: The angular speed (in degrees/s) of the sound source. Used in the 'horizontal' environment only. Default: 0 degrees/s, i.e., stationary source.
    • time_increment: The duration between the looks updating the source movement. Used in the 'horizontal' environment only. Default: 150 ms, i.e., a single look.
  • hrtf: SOFA structure storing the HRTF set used for the spatialization. Used in the 'horizontal' environment only.
  • sound.fs: Sampling rate (in Hz) of the HRTF set. It is used as the sampling rate of the sound. Used in the 'horizontal' environment only.
options Structure representing the FrAMBI options. No agent-specific fields are added.

Description:

sig_barumerli2024('horizontal',..) generates a FrAMBI environment simulating a sound source rotating in the horizontal plane. The sound is spatialized using a preloaded HRTF set. The environment updates the source position over time according to the specified angular speed and sound duration. Note that to reduce computational time, the spatialization is done at the initialization of the environment for all source angles. It defines the following functionality linked with local functions:

  • model.initialize is linked with local_initialize, in which the sound for the whole trial is generated (as a white-noise burst) and spatialized. The sound is stored as sound.signal. Further, the simulation time is reset and stored as time.
  • model.execute is linked with local_execute, in which the chunk of the sound to be observed by the agent is returned as output.signal together with the sampling rate as output.fs. Further, the hidden environmental states such as the source angle and time are updated.
  • model.conclude is linked with local_conclude, in which the environment concludes whether the trial has reached its end. It returns true if the time passes the sound duration.

sig_barumerli2024('mockup',..) generates a FrAMBI environment as a mockup for the vertical-plane sound-source localization. In this mockup, the source angle is directly accessible by the agent, which then does not need to infer it at all. The mockup uses the model.execute functionality only which is linked with local_execute_mockup. It returns the angle of the source directly as the output to the agent. This results in fast simulation useful for educational purposes only.

References:

R. Barumerli and P. Majdak. FrAMBI: A Software Framework for Auditory Modeling Based on Bayesian Inference. under review at Neuroinformatics, 2024.