sfFDN
Loading...
Searching...
No Matches
filter_feedback_matrix.h
1// Copyright (C) 2025 Alexandre St-Onge
2// SPDX-License-Identifier: MIT
3#pragma once
4
5#include "delaybank.h"
6#include "feedback_matrix.h"
7
8#include <cstddef>
9#include <cstdint>
10#include <span>
11#include <vector>
12
13namespace sfFDN
14{
15
29{
30 public:
35
36 ~FilterFeedbackMatrix() override = default;
37
38 FilterFeedbackMatrix(const FilterFeedbackMatrix& other) = delete;
39 FilterFeedbackMatrix& operator=(const FilterFeedbackMatrix& other) = delete;
40
45
51
58 void Process(const AudioBuffer& input, AudioBuffer& output) noexcept override;
59
65 uint32_t InputChannelCount() const override
66 {
67 return channel_count_;
68 }
69
75 uint32_t OutputChannelCount() const override
76 {
77 return channel_count_;
78 }
79
83 void Clear() override;
84
86 void PrintInfo() const;
87
95 bool GetFirstMatrix(std::span<float> matrix) const;
96
100 std::unique_ptr<AudioProcessor> Clone() const override;
101
102 private:
103 uint32_t channel_count_;
104 std::vector<DelayBank> delaybanks_;
105 std::vector<ScalarFeedbackMatrix> matrix_;
106
108};
109
110} // namespace sfFDN
A class representing an audio buffer with multiple channels of non-interleaved audio data.
Definition audio_buffer.h:18
Base class for audio processors.
Definition audio_processor.h:23
A filter feedback matrix processor.
Definition filter_feedback_matrix.h:29
std::unique_ptr< AudioProcessor > Clone() const override
Creates a copy of the filter feedback matrix.
bool GetFirstMatrix(std::span< float > matrix) const
Retrieves the coefficients of the first feedback matrix in the cascade.
void Clear() override
Clears the internal state of the processor.
uint32_t OutputChannelCount() const override
Returns the number of output channels produced by this processor.
Definition filter_feedback_matrix.h:75
FilterFeedbackMatrix(const CascadedFeedbackMatrixOptions &options)
Constructs a filter feedback matrix with a specified number of channels.
void Process(const AudioBuffer &input, AudioBuffer &output) noexcept override
Processes the input audio buffer and produces the output audio buffer.
FilterFeedbackMatrix & operator=(FilterFeedbackMatrix &&other) noexcept
Move assignment operator for the filter feedback matrix.
FilterFeedbackMatrix(FilterFeedbackMatrix &&other) noexcept
Move constructor for the filter feedback matrix.
uint32_t InputChannelCount() const override
Returns the number of input channels supported by this processor.
Definition filter_feedback_matrix.h:65
void PrintInfo() const
Prints information about the filter feedback matrix to the standard output.
Information structure for constructing a cascaded feedback matrix (also known as a filter feedback ma...
Definition types.h:154