Skip to content

Bilateral SOS Filter Model

Available from BRT v2.5.0 Last update: 9 Jan 2026

Overview

The Bilateral SOS Filter Model (class BRTBilateralFilter::CSOSBilateralFilterModel, defined in SOSBilateralFilterModel.hpp) is a binaural filtering model that applies an independent chain of second-order sections (SOS / biquads, IIR) to each ear.

This approach is well suited for simulating devices or effects that are naturally modeled using IIR filters, such as hearing protection devices or other ear-dependent equalization systems.

The SOS coefficients are provided through the dedicated service module SOSCoefficients, typically loaded from a SOFA file.

Architecture

The internal block diagram of this class is as follows:

Bilateral SOS Filter Model Internal Block diagram

Bilateral SOS Filter Model Internal Block diagram.

Inheritance

  • CSOSBilateralFilterModel derives from CBilateralFilterModelBase, which itself inherits from BRTBase::CModelBase.
  • The model is integrated into the processing graph through the BRTBase::CBRTManager.

Internal components

The main internal elements of the model are:

  • BRTServices::CSOSCoefficients: Service that stores and provides SOS coefficient sets.
  • BRTFilters::CSOSFilter: IIR filter implementation that processes the SOS chain for each ear.
  • Common::CAudioMixer: (base class) Used to mix multiple incoming audio streams per ear before filtering.

Configuration Options

The model allows confcan be enabled and disabled dynamically:

  • Enable/Disable Model : If disabled, audio samples pass through unchanged.
  • Gain (float): Extra gain to be applied to the model output
  • SOS Filter Coefficients to be used : The SOS coefficients service module to be used for rendering. The system supports dynamic, hot-swapping of the service module being used.

Connections

Modules to which it supports connections:

- Listener models

Modules to which it connects:

- Listener

For C++ developers

For C++ developer
  • File: /include/BilateralFilterModels/SOSBilateralFilterModel.hpp
  • Class name: CSOSBilateralFilterModel
  • Inheritance: CBilateralFilterModelBase
  • Namespace: BRTBilateralFilter
  • Classes that instance:
    • BRTFilters::CSOSFilter

Class inheritance diagram

SOS Bilateral Filter Model Internal diagram

SOS Bilateral Filter Model Internal diagram.


How to instantiate

brtManager.BeginSetup();
std::shared_ptr<BRTBilateralFilter::CSOSBilateralFilterModel> binauralFilter = brtManager.CreateBinauralFilter<BRTBilateralFilter::CSOSBilateralFilterModel>(_binauralFilterID);
brtManager.EndSetup();
if (binauralFilter == nullptr) {
    // ERROR
}

How to connect

Connect it to a listener.
std::shared_ptr<BRTBase::CListener> listener = brtManager.GetListener(_listenerID);
if (listener != nullptr) {
    brtManager.BeginSetup();
    bool control = listener->ConnectBinauralFilter(_binauralFilterID);
    brtManager.EndSetup();
}
Connect an listener model to it.
std::shared_ptr<BRTBilateralFilter::CBilateralFilterModelBase> binauralFilter = brtManager.GetBinauralFilter<BRTBilateralFilter::CBilateralFilterModelBase>(_binauralFilterD);
if (binauralFilter != nullptr) {
    brtManager.BeginSetup();
    bool control = binauralFilter->ConnectListenerModel(_listenerModelID);
    brtManager.EndSetup();
}

Public methods

void EnableModel() 
void DisableModel() 
bool IsModelEnabled() 

void SetGain(float _gain)
float GetGain()

bool SetSOSFilterCoefficients(std::shared_ptr<BRTServices::CSOSCoefficients> _listenerILD)
std::shared_ptr<BRTServices::CSOSCoefficients> GetSOSFilter() const
void RemoveSOSFilter()

bool ConnectListenerModel(const std::string & _listenerModelID, Common::T_ear _ear = Common::T_ear::BOTH)
bool ConnectListenerModel(std::shared_ptr<BRTListenerModel::CListenerModelBase> _listenerModel, Common::T_ear _ear = Common::T_ear::BOTH)

bool DisconnectListenerModel(const std::string & _listenerModelID, Common::T_ear _ear = Common::T_ear::BOTH)
bool DisconnectListenerModel(std::shared_ptr<BRTListenerModel::CListenerModelBase> _listenerModel, Common::T_ear _ear = Common::T_ear::BOTH)

T_BilateralFilterType GeBilateralFilterType() const 

bool IsConnectedToListener()
bool IsConnectedToListenerModel()
void ConnectionToListenerEstablished(const std::string & _listenerID) 

std::vector<std::string> GetInputs() { return inputConnections; }
std::vector<std::string> GetOutputs() { return outputConnections; }