SOFA specifications

From Sofaconventions
Jump to: navigation, search

Specifications

  • SOFA 1.0 is reflected by the AES69-2015 standard. It mostly corresponds to SOFA 0.6, which specs can be downloaded here. A document with SOFA 1.0 specs is under preparation.

Older specs:


Coordinate system

Coordinate system.png


Data Types

FIR (SOFA 1.0)

For storing impulse responses.

Note: Delay is mandatory (set to 0 if not used).

Name Default Flags Dimensions Type Comment
GLOBAL:DataType FIR rm attribute
Data.IR 0 m mRn double Impulse responses
Data.SamplingRate 48000 m I double Sampling rate of the samples in Data.IR
Data.SamplingRate:Units hertz m attribute Unit of the sampling rate
Data.Delay 0 m IR, MR double Additional delay of each IR (always in samples, i.e. units of N)


TF (SOFA 1.0)

Useful to describe a transfer function by a sparse number of frequencies. The guys from BEM simulations like it.

Note: the dimensional variable N is mandatory, it must be of dimension N, and must provide the frequency values.

Name Default Flags Dimensions Type Comment
GLOBAL:DataType TF rm attribute
Data.Real 0 m mRn double The real part of the complex spectrum
Data.Imag 0 m MRN double The imaginary part of the complex spectrum
N 0 m N double Frequency values
N_LongName frequency attribute
N_Units hertz m attribute Unit of the values given in N


FIRE (proposed)

FIRE is based on FIR and is intended for storing impulse responses which depend on the emitter (E).

Note: Delay is mandatory (set to 0 if not used).

Name Default Flags Dimensions Type Comment
GLOBAL:DataType FIRE rm attribute
Data.IR 0 m mREn double Impulse responses
Data.SamplingRate 48000 m I double Sampling rate of the samples in Data.IR
Data.SamplingRate:Units hertz m attribute Unit of the sampling rate
Data.Delay 0 m IRE, MRE double Additional delay of each IR (always in samples, i.e. units of N)


SOS (proposed)

This DataType stores a filter as a broadband delay and an arbitrary number of second order sections (SOSs).

The transfer function H(z) of a filter can be described as:

[math]H(z) = \frac{B_1(z)}{A_1(z)} \cdot \frac{B_2(z)}{A_2(z)} \cdot ... \cdot \frac{B_p(z)}{A_p(z)}[/math]

where [math]p[/math] is the number of second order sections, [math]A(z)[/math] is denominator representing the poles of a filter, and [math]B(z)[/math] is numerator representing the zeros of a filter. Then, each SOS can be described as:

[math]B_i(z) = b_{i,0} + b_{i,1} z^{-1} + b_{i,2} z^{-2}[/math]

[math]A_i(z) = a_{i,0} + a_{i,1} z^{-1} + a_{i,2} z^{-2}[/math]

Note that usually, [math]A_i(z)[/math] is normalized such that [math]a_{i,0} = 1[/math].

Thus, in the DataType SOS, a filter is represented by three mandatory variables:

  • Data.SamplingRate: sampling rate used to describe the filter.
  • Data.Delay: broadband delay (in samples resulting from SamplingRate). Note: Use Delay of zero when not used.used).
  • Data.SOS: list of coefficients of all SOSs.
    • Size: Data.SOS has the size of [ M R N ] with N as the total number of coefficients, thus an integer multiple of 6 corresponding to [math]6p[/math].
    • Format of the list: Along the dimension N, the list goes like: [math][ b_{1,0}\ b_{1,1}\ b_{1,2}\ a_{1,0}\ a_{1,1}\ a_{1,2}\ b_{2,0}\ b_{2,1}\ b_{2,2}\ a_{2,0}\ a_{2,1}\ a_{2,2}\ ... b_{p,0}\ b_{p,1}\ b_{p,2}\ a_{p,0}\ a{p,1}\ a_{p,2} ][/math] which corresponds to [math][ B_1(z)\ A_1(z)\ B_2(z)\ A_2(z)\ ... B_p(z)\ A_p(z) ][/math]


Name Default Flags Dimensions Type Comment
Data.SOS permute([0 0 0 1 0 0],[3 1 2]) m mRn double Filter coefficients as SOS coefficients.
Data.SamplingRate 48000 m I double Sampling rate of the coefficients in Data.SOS and the delay in Data.Delay
Data.SamplingRate:Units hertz m attribute Unit of the sampling rate
Data.Delay 0 m MR double Broadband delay (in samples resulting from SamplingRate)