UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FeedbackDelayNetwork.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "DSP/IntegerDelay.h"
8#include "DSP/LongDelayAPF.h"
10
11namespace Audio
12{
13 // Delay settings of 4 channel feedback delay network
15 {
16 // Number of samples for delay line 0
18 // Number of samples for delay line 1
20 // Number of samples for delay line 2
22 // Number of samples for delay line 3
24
25 // Default delay line settings for left channel.
27 // Default delay line settings for right channel.
29 };
30
31 // Filter coefficients of 4 channel feedback delay network.
33 {
34 // Sample multiplier of input samples before they enter the delay line.
36 // All pass filter coefficients. One coefficient for each filter.
37 float APFG[4];
38 // Low pass filter feed back coefficients. One coefficient for each filter.
39 float LPFA[4];
40 // Low pass filter feed forward coefficients. One coefficient for each filter.
41 float LPFB[4];
42 // Feedback multiplier of mixing matrix output to network input.
43 float Feedback;
44 };
45
46 // 4 channel feedback delay network (FDN) for artificial reverberation.
48 {
49 public:
50 // InMaxNumInternalBufferSamples controls the internal buffer size used for vector operations.
51 // InSettings controls the delay line lengths.
53
55
56 // Sets the coefficient values of the all pass filters, low pass filters, input scalers and feedback scalers.
58
59 // Generates artificial reverberation for InSamples and places results in OutSamples.
61
62 // Sets internal audio samples to silence.
64
65 // Returns the actual number of samples in an internal buffer.
67
68
69 private:
70
71 // Process single internal buffer of audio.
72 void ProcessAudioBuffer(const float* InSampleData, const int32 InNum, float* OutSampleData);
73
74 FFDNDelaySettings Settings;
75
76 // Internal buffer size.
77 int32 NumInternalBufferSamples;
78
79 // Coefficients structure for APF, LPF, input scaling and feedback.
80 FFDNCoefficients Coefficients;
81
82 // Previous output of low pass filters.
83 float LPFZ[4];
84
85 // Previous output of mixing matrix.
86 float FMO[4];
87
92
93 FAlignedFloatBuffer WorkBuffer0;
94 FAlignedFloatBuffer WorkBuffer1;
95 FAlignedFloatBuffer WorkBuffer2;
96 FAlignedFloatBuffer WorkBuffer3;
97 };
98}
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition FeedbackDelayNetwork.h:48
SIGNALPROCESSING_API void SetCoefficients(const FFDNCoefficients &InCoefficients)
Definition FeedbackDelayNetwork.cpp:85
SIGNALPROCESSING_API void ProcessAudio(const FAlignedFloatBuffer &InSamples, FAlignedFloatBuffer &OutSamples)
Definition FeedbackDelayNetwork.cpp:90
SIGNALPROCESSING_API void FlushAudio()
Definition FeedbackDelayNetwork.cpp:181
SIGNALPROCESSING_API int32 GetNumInternalBufferSamples() const
Definition FeedbackDelayNetwork.cpp:114
SIGNALPROCESSING_API ~FFeedbackDelayNetwork()
Definition FeedbackDelayNetwork.cpp:82
Definition UniquePtr.h:107
NO_LOGGING.
Definition AudioMixerPlatformAndroid.cpp:53
Definition FeedbackDelayNetwork.h:33
float InputScale
Definition FeedbackDelayNetwork.h:35
float LPFB[4]
Definition FeedbackDelayNetwork.h:41
float APFG[4]
Definition FeedbackDelayNetwork.h:37
float Feedback
Definition FeedbackDelayNetwork.h:43
float LPFA[4]
Definition FeedbackDelayNetwork.h:39
Definition FeedbackDelayNetwork.h:15
int32 APF0DelayNumSamples
Definition FeedbackDelayNetwork.h:17
static SIGNALPROCESSING_API FFDNDelaySettings DefaultLeftDelays(float InSampleRate)
Definition FeedbackDelayNetwork.cpp:15
static SIGNALPROCESSING_API FFDNDelaySettings DefaultRightDelays(float InSampleRate)
Definition FeedbackDelayNetwork.cpp:25
int32 APF2DelayNumSamples
Definition FeedbackDelayNetwork.h:21
int32 APF1DelayNumSamples
Definition FeedbackDelayNetwork.h:19
int32 APF3DelayNumSamples
Definition FeedbackDelayNetwork.h:23