au.dsp.FFTMethod
au.dsp.FFTMethod
#Overview
name: au.dsp.FFTMethod
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Determines whether we use an iterative FFT method or the DFT.\n0: Use Iterative FFT, 1:: Use DFT
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.dsp.FFTMethod is to determine the Fast Fourier Transform (FFT) method used in audio signal processing within Unreal Engine 5. It controls whether the engine uses an iterative FFT method or the Discrete Fourier Transform (DFT) for audio processing tasks.
This setting variable is primarily used by the Signal Processing module of Unreal Engine, specifically within the audio processing subsystem. The code references are found in the AudioFFT.cpp file, which is part of the SignalProcessing runtime module.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0, which corresponds to using the iterative FFT method. Developers can change this value at runtime or through configuration files.
The au.dsp.FFTMethod variable interacts directly with its associated variable CVarFFTMethod. They share the same value, with CVarFFTMethod being the actual console variable that controls the behavior.
Developers should be aware that:
- A value of 0 uses the iterative FFT method (default).
- A value of 1 uses the DFT method.
- Changing this value affects the performance and potentially the quality of audio processing in the engine.
Best practices when using this variable include:
- Only modify if you have a specific reason to change the FFT method.
- Test thoroughly after changing, as it may impact audio performance and quality.
- Consider the trade-offs between the iterative FFT (generally faster) and DFT (potentially more accurate for certain use cases) methods.
Regarding the associated variable CVarFFTMethod:
- It’s the actual console variable that controls the FFT method.
- It’s used in the PerformFFT_DEPRECATED and PerformIFFT_DEPRECATED functions to determine which FFT method to use.
- The value is retrieved using GetValueOnAnyThread(), suggesting it can be accessed from multiple threads.
- Developers should use this variable when they need to programmatically check or set the FFT method in C++ code.
When working with CVarFFTMethod, developers should:
- Use thread-safe access methods if modifying the value from different threads.
- Be aware that changes to this variable will immediately affect the audio processing behavior.
- Consider caching the value if it’s accessed frequently, to avoid potential performance overhead from repeated CVar lookups.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/SignalProcessing/Private/AudioFFT.cpp:10
Scope: file
Source code excerpt:
static int32 FFTMethodCVar = 0;
TAutoConsoleVariable<int32> CVarFFTMethod(
TEXT("au.dsp.FFTMethod"),
FFTMethodCVar,
TEXT("Determines whether we use an iterative FFT method or the DFT.\n")
TEXT("0: Use Iterative FFT, 1:: Use DFT"),
ECVF_Default);
namespace Audio
#Associated Variable and Callsites
This variable is associated with another variable named CVarFFTMethod
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/SignalProcessing/Private/AudioFFT.cpp:9
Scope: file
Source code excerpt:
static int32 FFTMethodCVar = 0;
TAutoConsoleVariable<int32> CVarFFTMethod(
TEXT("au.dsp.FFTMethod"),
FFTMethodCVar,
TEXT("Determines whether we use an iterative FFT method or the DFT.\n")
TEXT("0: Use Iterative FFT, 1:: Use DFT"),
ECVF_Default);
#Loc: <Workspace>/Engine/Source/Runtime/SignalProcessing/Private/AudioFFT.cpp:613
Scope (from outer to inner):
file
namespace Audio
namespace AudioFFTDeprecated
function void PerformFFT_DEPRECATED
Source code excerpt:
void PerformFFT_DEPRECATED(const FFTTimeDomainData_DEPRECATED& InputParams, FFTFreqDomainData_DEPRECATED& OutputParams)
{
int32 FFTMethod = CVarFFTMethod.GetValueOnAnyThread();
if (FFTMethod)
{
FFTIntrinsics::PerformDFT(InputParams, OutputParams);
}
else
{
#Loc: <Workspace>/Engine/Source/Runtime/SignalProcessing/Private/AudioFFT.cpp:626
Scope (from outer to inner):
file
namespace Audio
namespace AudioFFTDeprecated
function void PerformIFFT_DEPRECATED
Source code excerpt:
void PerformIFFT_DEPRECATED(FFTFreqDomainData_DEPRECATED& InputParams, FFTTimeDomainData_DEPRECATED& OutputParams)
{
int32 FFTMethod = CVarFFTMethod.GetValueOnAnyThread();
if (FFTMethod)
{
FFTIntrinsics::PerformIDFT(InputParams, OutputParams);
}
else
{