Skip to content

SplitComplex

class SplitComplex

Buffer for split-complex representation of FFT results.

The split-complex representation stores the real and imaginary parts of FFT results in two different memory buffers which is useful e.g. for SIMD optimizations.

Operators

Name Description
operator[] Gets the complex value at the given index.

Functions

Name Description
SplitComplex Creates a new split-complex buffer with the given initial size.
~SplitComplex Destroy the split-complex buffer and release all allocated memory.
Release Releases all allocated memory.
Resize Resizes the split-complex buffer to the given size.
Clear Clears the split-complex buffer.
CopyFrom Copies the given split-complex buffer to this one.
GetSize Gets the current size of the split-complex buffer.
re Gets the real part of the split-complex buffer.
re Gets the real part of the split-complex buffer.
im Gets the imaginary part of the split-complex buffer.
im Gets the imaginary part of the split-complex buffer.

Operator Details

operator[]

[[nodiscard]] std::complex<AmAudioSample> operator const

Gets the complex value at the given index.

Parameter index
The index of the complex value.
Return
The complex value at the given index.

Function Details

Clear

void Clear() const

Clears the split-complex buffer.

CopyFrom

void CopyFrom(const SplitComplex& other) const

Copies the given split-complex buffer to this one.

Parameter other
The split-complex buffer to copy.

GetSize

[[nodiscard]] inline AmSize GetSize() const

Gets the current size of the split-complex buffer.

Return
The size of the split-complex buffer.

Release

void Release()

Releases all allocated memory.

Resize

void Resize(AmSize newSize, bool clear = false)

Resizes the split-complex buffer to the given size.

Parameter newSize
The new size of the split-complex buffer.
Parameter clear
Whether to clear the buffer after resizing.

SplitComplex

explicit SplitComplex(AmSize initialSize = 0)

Creates a new split-complex buffer with the given initial size.

Parameter initialSize
The initial size of the split-complex buffer.

im

AmAudioSample* im()

Gets the imaginary part of the split-complex buffer.

Return
The imaginary part of the split-complex buffer.

[[nodiscard]] const AmAudioSample* im() const

Gets the imaginary part of the split-complex buffer.

Return
The imaginary part of the split-complex buffer.

re

AmAudioSample* re()

Gets the real part of the split-complex buffer.

Return
The real part of the split-complex buffer.

[[nodiscard]] const AmAudioSample* re() const

Gets the real part of the split-complex buffer.

Return
The real part of the split-complex buffer.

~SplitComplex

~SplitComplex()

Destroy the split-complex buffer and release all allocated memory.