sfFDN
Loading...
Searching...
No Matches
sfFDN::ScalarFeedbackMatrix Class Reference

A scalar feedback matrix processor. More...

#include <feedback_matrix.h>

Inheritance diagram for sfFDN::ScalarFeedbackMatrix:
[legend]
Collaboration diagram for sfFDN::ScalarFeedbackMatrix:
[legend]

Public Member Functions

 ScalarFeedbackMatrix (const ScalarFeedbackMatrixOptions &config)
 Constructs a scalar feedback matrix.
 
bool SetMatrix (const std::span< const float > matrix)
 Sets the matrix coefficients.
 
bool GetMatrix (std::span< float > matrix) const
 Get the Matrix object.
 
void Process (const AudioBuffer &input, AudioBuffer &output) noexcept override
 Processes the input audio buffer through the feedback matrix.
 
uint32_t GetSize () const
 Returns the size of the square matrix (number of rows/columns).
 
float GetCoefficient (uint32_t row, uint32_t col) const
 Get a specific coefficient from the matrix.
 
uint32_t InputChannelCount () const override
 Returns the number of input channels supported by the processor.
 
uint32_t OutputChannelCount () const override
 Returns the number of output channels produced by the processor.
 
void Clear () override
 Clears the internal state of the processor.
 
std::unique_ptr< AudioProcessorClone () const override
 Creates a copy of the scalar feedback matrix.
 
- Public Member Functions inherited from sfFDN::AudioProcessor

Detailed Description

A scalar feedback matrix processor.

This processor applies a square feedback matrix to the input audio buffer. The matrix is defined as a flat array in column-major order.

Constructor & Destructor Documentation

◆ ScalarFeedbackMatrix()

sfFDN::ScalarFeedbackMatrix::ScalarFeedbackMatrix ( const ScalarFeedbackMatrixOptions & config)

Constructs a scalar feedback matrix.

Parameters
configThe configuration for the scalar feedback matrix.

Member Function Documentation

◆ Clear()

void sfFDN::ScalarFeedbackMatrix::Clear ( )
overridevirtual

Clears the internal state of the processor.

This is a no-op for ScalarFeedbackMatrix as it has no internal state.

Implements sfFDN::AudioProcessor.

◆ Clone()

std::unique_ptr< AudioProcessor > sfFDN::ScalarFeedbackMatrix::Clone ( ) const
overridevirtual

Creates a copy of the scalar feedback matrix.

Returns
A unique pointer to the cloned scalar feedback matrix.

Implements sfFDN::AudioProcessor.

◆ GetCoefficient()

float sfFDN::ScalarFeedbackMatrix::GetCoefficient ( uint32_t row,
uint32_t col ) const

Get a specific coefficient from the matrix.

Parameters
rowThe row index
colThe column index
Returns
the coefficient at the specified row and column

◆ GetMatrix()

bool sfFDN::ScalarFeedbackMatrix::GetMatrix ( std::span< float > matrix) const

Get the Matrix object.

Parameters
matrix
Returns
false if the span is not the correct size.

◆ GetSize()

uint32_t sfFDN::ScalarFeedbackMatrix::GetSize ( ) const

Returns the size of the square matrix (number of rows/columns).

Returns
The size of the matrix.

◆ InputChannelCount()

uint32_t sfFDN::ScalarFeedbackMatrix::InputChannelCount ( ) const
overridevirtual

Returns the number of input channels supported by the processor.

Implements sfFDN::AudioProcessor.

◆ OutputChannelCount()

uint32_t sfFDN::ScalarFeedbackMatrix::OutputChannelCount ( ) const
overridevirtual

Returns the number of output channels produced by the processor.

Implements sfFDN::AudioProcessor.

◆ Process()

void sfFDN::ScalarFeedbackMatrix::Process ( const AudioBuffer & input,
AudioBuffer & output )
overridevirtualnoexcept

Processes the input audio buffer through the feedback matrix.

Parameters
inputAudioBuffer containing the input audio data. The number of channels must match the matrix order returned by GetSize().
outputAudioBuffer to fill with the processed audio data. The number of channels must match the matrix order.

Implements sfFDN::AudioProcessor.

◆ SetMatrix()

bool sfFDN::ScalarFeedbackMatrix::SetMatrix ( const std::span< const float > matrix)

Sets the matrix coefficients.

Parameters
matrixA span representing the matrix coefficients in column-major order. The span must be of size order * order.
Returns
true if the matrix was set successfully, false otherwise (e.g. if the size is incorrect).

The documentation for this class was generated from the following file: