UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ConstantQ.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "DSP/AlignedBuffer.h"
7
8namespace Audio
9{
12 {
13 EqualAmplitude, //< No energy scaling. All bands weighted so max is 1.
14 EqualEuclideanNorm, //< Scale energy by euclidean norm. Good when using magnitude spectrum.
15 EqualEnergy //< Scale energy by total energy. Good when using power spectrum.
16 };
17
20 {
21 int32 NumBands; //< Total number of resulting constant Q bands.
22 float NumBandsPerOctave; //< Number of bands to space within an octave.
23 float KernelLowestCenterFreq; //< The starting frequency of the first band.
24 float BandWidthStretch; //< Stretching factor to control overlap of adjacent bands.
25 EPseudoConstantQNormalization Normalization; //< Normalization scheme for bands.
26
35 };
36
54
73
75 {
76 // Returns the center frequency of a given CQT band.
78
79 // Returns the bandwidth for a given CQT band.
80 static SIGNALPROCESSING_API float GetConstantQBandWidth(const float InBandCenter, const float InBandsPerOctave, const float InBandWidthStretch);
81
82 // Fills an array with the spectrum weights to apply to an FFT magnitude or power spectrum output.
84 };
85}
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
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition UniquePtr.h:107
NO_LOGGING.
Definition AudioMixerPlatformAndroid.cpp:53
TUniquePtr< FContiguousSparse2DKernelTransform > NewPseudoConstantQKernelTransform(const FPseudoConstantQKernelSettings &InSettings, const int32 InFFTSize, const float InSampleRate)
Definition ConstantQ.cpp:159
EPseudoConstantQNormalization
Definition ConstantQ.h:12
Definition ConstantQ.h:57
float SampleRate
Definition ConstantQ.h:68
int32 FFTSize
Definition ConstantQ.h:65
EPseudoConstantQNormalization Normalization
Definition ConstantQ.h:71
float CenterFreq
Definition ConstantQ.h:59
float BandWidth
Definition ConstantQ.h:62
Definition ConstantQ.h:20
float NumBandsPerOctave
Definition ConstantQ.h:22
int32 NumBands
Definition ConstantQ.h:21
FPseudoConstantQKernelSettings()
Definition ConstantQ.h:28
EPseudoConstantQNormalization Normalization
Definition ConstantQ.h:25
float KernelLowestCenterFreq
Definition ConstantQ.h:23
float BandWidthStretch
Definition ConstantQ.h:24
Definition ConstantQ.h:75
static SIGNALPROCESSING_API float GetConstantQCenterFrequency(const int32 InBandIndex, const float InBaseFrequency, const float InBandsPerOctave)
Definition ConstantQ.cpp:58
static SIGNALPROCESSING_API float GetConstantQBandWidth(const float InBandCenter, const float InBandsPerOctave, const float InBandWidthStretch)
Definition ConstantQ.cpp:64
static SIGNALPROCESSING_API void FillArrayWithConstantQBand(const FPseudoConstantQBandSettings &InSettings, FAlignedFloatBuffer &OutOffsetArray, int32 &OutOffsetIndex)
Definition ConstantQ.cpp:71