Giter Club home page Giter Club logo

sofa's Introduction

SOFA - Spatially Oriented Format for Acoustics

SOFA is a file format for reading, saving, and describing spatially oriented data of acoustic systems.

Examples of data we consider are head-related transfer functions (HRTFs), binaural room impulse responses (BRIRs), multichannel measurements such as done with microphone arrays, or directionality data of loudspeakers.

The format specifications are the major issue, but we also aim in providing APIs for reading and writing the data in SOFA.

For more information on the format specifications and available data have a look at http://www.sofaconventions.org/

Downloads

Current versions of SOFA can be found on its old home.

At the moment we are working on a new release which will be shortly available on this site.

Usage

Matlab/Octave API

In order to use SOFA with Matlab or Octave you have to add its API_MO folder to your paths. After that you can play around with your acoustic measurements as shown by the following example which uses a head-related transfer function measurement.

% Start SOFA
SOFAstart;
% Load your impulse response into a struct
hrtf = SOFAload('path/to_your/HRTF.sofa'));
% Display some information about the impulse response
SOFAinfo(hrtf);
% Plot a figure with the measurement setup
SOFAplotGeometry(hrtf);
% Have a look at the size of the data
size(hrtf.Data.IR)
% Get information about the measurement setup
hrtf.ListenerPosition       % position of dummy head
hrtf.SourcePosition         % position of loudspeaker
% Head orientation of the dummy head + coordinate system and units
hrtf.ListenerView
hrtf.ListenerView_Type
hrtf.ListenerView_Units
% Calculate the source position from a listener point of view
apparentSourceVector = SOFAcalculateAPV(hrtf);
% Listen to the HRTF with azimuth of -90°
apparentSourceVector(91, 1)
SOFAplotGeometry(hrtf, 91);
soundInput = audioread('fancy_audio_file.wav');
soundOutput = [conv(squeeze(hrtf.Data.IR(91, 1, :)), soundInput) ...
               conv(squeeze(hrtf.Data.IR(91, 2, :)), soundInput)];
sound(soundOutput, hrtf.Data.SamplingRate);

sofa's People

Contributors

petibub avatar hagenw avatar whra avatar isfmiho avatar ivo--t avatar

Watchers

Jean Ibarz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.