sfFDN
Loading...
Searching...
No Matches
partitioned_convolver.h
1// Copyright (C) 2025 Alexandre St-Onge
2// SPDX-License-Identifier: MIT
3#pragma once
4
5#include "audio_processor.h"
6
7#include <cstddef>
8#include <cstdint>
9#include <memory>
10#include <span>
11#include <string>
12
13namespace sfFDN
14{
19{
20 public:
31 PartitionedConvolver(uint32_t block_size, std::span<const float> fir, uint32_t rep_count = 0);
32 ~PartitionedConvolver() override;
33
35 PartitionedConvolver& operator=(const PartitionedConvolver&) = delete;
36
39
44
50 void Process(const AudioBuffer& input, AudioBuffer& output) noexcept SFFDN_NONBLOCKING override;
51
55 uint32_t GetBlockSize() const;
56
59 void DumpInfo() const;
60
64 std::string GetShortInfo() const;
65
70 uint32_t InputChannelCount() const noexcept SFFDN_NONBLOCKING override
71 {
72 return 1; // PartitionedConvolver processes one channel at a time
73 }
74
79 uint32_t OutputChannelCount() const noexcept SFFDN_NONBLOCKING override
80 {
81 return 1; // PartitionedConvolver processes one channel at a time
82 }
83
87 void Clear() override;
88
92 std::unique_ptr<AudioProcessor> Clone() const override;
93
94 private:
95 class PartitionedConvolverImpl;
96 std::unique_ptr<PartitionedConvolverImpl> impl_;
97
98 PartitionedConvolver() = default; // Default constructor used in Clone()
99};
100
101} // 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
A partitioned convolution engine that can filter audio signals with an FIR filter.
Definition partitioned_convolver.h:19
std::string GetShortInfo() const
Gets a short string representation of the internal state of the convolver for debugging purposes.
void Clear() override
Clears the internal state of the processor.
std::unique_ptr< AudioProcessor > Clone() const override
Creates a copy of the PartitionedConvolver.
PartitionedConvolver & operator=(PartitionedConvolver &&other) noexcept
Move assignment operator for the partitioned convolver.
void Process(const AudioBuffer &input, AudioBuffer &output) noexcept SFFDN_NONBLOCKING override
Processes the audio buffer.
PartitionedConvolver(PartitionedConvolver &&other) noexcept
Move constructor for the partitioned convolver.
uint32_t OutputChannelCount() const noexcept SFFDN_NONBLOCKING override
Gets the number of output channels supported.
Definition partitioned_convolver.h:79
void DumpInfo() const
Dumps internal information to the standard output for debugging purposes.
uint32_t GetBlockSize() const
Gets the block size used for processing.
PartitionedConvolver(uint32_t block_size, std::span< const float > fir, uint32_t rep_count=0)
Constructs a PartitionedConvolver.
uint32_t InputChannelCount() const noexcept SFFDN_NONBLOCKING override
Gets the number of input channels supported.
Definition partitioned_convolver.h:70