sfFDN
Loading...
Searching...
No Matches
delay_matrix.h
1// Copyright (C) 2025 Alexandre St-Onge
2// SPDX-License-Identifier: MIT
3#pragma once
4
5#include "sffdn/audio_processor.h"
6
7#include <cstdint>
8#include <span>
9
10namespace sfFDN
11{
12// Forward declaration
13class ScalarFeedbackMatrix;
14
24{
25 public:
35 DelayMatrix(uint32_t order, std::span<const uint32_t> delays, const ScalarFeedbackMatrix& mixing_matrix);
36
37 ~DelayMatrix() override;
38
40 DelayMatrix(const DelayMatrix& other);
43
45 DelayMatrix(DelayMatrix&& other) noexcept;
47 DelayMatrix& operator=(DelayMatrix&& other) noexcept;
48
53 void Process(const AudioBuffer& input, AudioBuffer& output) noexcept SFFDN_NONBLOCKING override;
54
56 uint32_t InputChannelCount() const noexcept SFFDN_NONBLOCKING override;
57
59 uint32_t OutputChannelCount() const noexcept SFFDN_NONBLOCKING override;
60
64 void Clear() override;
65
67 void PrintInfo() const;
68
72 std::unique_ptr<AudioProcessor> Clone() const override;
73
74 private:
75 class DelayMatrixImpl;
76 std::unique_ptr<DelayMatrixImpl> impl_;
77
78 DelayMatrix() = default; // Default constructor used internally by Clone()
79};
80} // namespace sfFDN
A class representing an audio buffer with multiple channels of non-interleaved audio data.
Definition audio_buffer.h:20
Base class for audio processors.
Definition audio_processor.h:24
DelayMatrix implementation as presented in [1].
Definition delay_matrix.h:24
uint32_t OutputChannelCount() const noexcept SFFDN_NONBLOCKING override
Returns the number of output channels this processor produces.
DelayMatrix(DelayMatrix &&other) noexcept
Move constructor.
DelayMatrix & operator=(const DelayMatrix &other)
Copy assignment operator.
std::unique_ptr< AudioProcessor > Clone() const override
Creates a copy of the delay matrix.
DelayMatrix(const DelayMatrix &other)
Copy constructor.
void PrintInfo() const
Prints information about the delay matrix.
DelayMatrix & operator=(DelayMatrix &&other) noexcept
Move assignment operator.
uint32_t InputChannelCount() const noexcept SFFDN_NONBLOCKING override
Returns the number of input channels this processor expects.
void Clear() override
Clears the internal delay buffers.
DelayMatrix(uint32_t order, std::span< const uint32_t > delays, const ScalarFeedbackMatrix &mixing_matrix)
Constructs a DelayMatrix with the specified size and delay values.
void Process(const AudioBuffer &input, AudioBuffer &output) noexcept SFFDN_NONBLOCKING override
Processes the input audio buffer through the delay matrix.
A scalar feedback matrix processor.
Definition feedback_matrix.h:22