Unlock this feature

This feature isn’t part of your plan yet

Contact sales to get upgraded to the full DevStudio experience.

Unlock this feature

This feature isn't part of your plan yet.

Discrete Fourier Transforms

FFT-1D (Fast Fourier Transform, One-Dimensional)

fft1dfunction
File: /src/signal.hppLines 688–809

Performs a 1D N-point FFT on a given signal. Note: N must to be a power of two.

We map N-point FFT using the Cooley–Tukey FFT algorithm. Similar to the explanation found here: https://www.cs.cmu.edu/afs/andrew/scs/cs/15-463/2001/pub/www/notes/fourier/fourier.pdf.

For an inverse FFT, the imaginary part is negated before and after the forward FFT, also before the output, both are divided by numInputPoints.

Reference: https://www.dsprelated.com/showarticle/800.php, method 4

template <bool complexInput = true,
          typename DdrInOutSignalTensorShape,
          typename qvarElemType = typename DdrInOutSignalTensorShape::elemType>
void fft1d(DdrInOutSignalTensorShape& ddrIn,
           DdrInOutSignalTensorShape& ddrOut,
           MemAllocator& ocmMemAlloc)
NameTypeDefaultDescription
complexInputbooltrueSet to `True` if the input is complex, `False` if input is real.
DdrInOutSignalTensorShapetypenameDDR input tensor. Expected to be of the form `<1, complexCount, 1, inputPoints>`. `ComplexCount` = 1 if only real or 2 if complex.
qvarElemTypetypenametypename DdrInOutSignalTensorShape::elemTypeDefault is `DdrInOutSignalTensorShape::elemType` .
NameTypeDescription
ddrInDdrInOutSignalTensorShape&OCM allocator to be used locally in FFT to allocate ocm memory space.
ddrOutDdrInOutSignalTensorShape&OCM allocator to be used locally in FFT to allocate ocm memory space.
ocmMemAllocMemAllocator&OCM allocator to be used locally in FFT to allocate ocm memory space. / // clang-format on

void

rfft1dfunction
File: /src/signal.hppLines 823–941

Computes FFT with pre-computed weights for real-valued, multi-channel input.

template <typename OcmInputShape,
          typename OcmFftShape,
          typename qvarElemType = typename OcmInputShape::elemType>
void rfft1d(MemAllocator& ocmMem, OcmInputShape& ocmIn, OcmFftShape& ocmOut)
NameTypeDefaultDescription
OcmInputShapetypenameExpected to be of the form `<1, 1, numChannels, inputPoints>` .
OcmFftShapetypenameExpected to be of the form `<1, 2, numChannels, numRfftFrequencies>` .
qvarElemTypetypenametypename OcmInputShape::elemTypeDefault is `OcmInputShape::elemType` .
NameTypeDescription
ocmMemMemAllocator&OCM allocator used internally for RAU.
ocmInOcmInputShape&Input 1D signal stored in OCM.
ocmOutOcmFftShape&The real-FFT output for all channels. / // clang-format on

void

FFT-2D (Fast Fourier Transform, Two-Dimensional)

fft2dfunction
File: /src/signal.hppLines 963–1076

Performs a 2D N-point FFT on a given signal.

template <typename DdrInOutSignalTensorShape,
          FftScaling scaling = FftScaling::Unscaled,
          typename qvarElemType = typename DdrInOutSignalTensorShape::elemType>
void fft2d(DdrInOutSignalTensorShape& ddrIn,
           DdrInOutSignalTensorShape& ddrOut,
           MemAllocator& ocmMemAlloc)
NameTypeDefaultDescription
DdrInOutSignalTensorShapetypenameInput/output tensor shape. Expected form `<1, 2, NR, NC>` — complex (2 channels), and `NR`, `NC` independent powers of 2. `NR == NC` is the common square case; non-square shapes (e.g. radar range × Doppler) are also supported.
scalingFftScalingFftScaling::UnscaledOutput scaling policy. `FftScaling::Unscaled` (default) returns the literal forward DFT `out[k] = sum_n x[n] * exp(-j 2 pi k n / N)`; `FftScaling::BlockFp` right-shifts the data path by 1 bit per butterfly stage so the output equals `DFT2(x) / (NR*NC)` exactly, reclaiming the full input Q-format dynamic range. See `FftScaling` for details.
qvarElemTypetypenametypename DdrInOutSignalTensorShape::elemTypeDefault is `DdrInOutSignalTensorShape::elemType` .
NameTypeDescription
ddrInDdrInOutSignalTensorShape&Input 2D signal stored in external memory.
ddrOutDdrInOutSignalTensorShape&Output tensor where calculated 2D FFT will be stored.
ocmMemAllocMemAllocator&OCM allocator to be used locally in FFT to allocate OCM space. / // clang-format on

void

Sign in to your account

Don't have an account? 
By signing in, you are agreeing to our Terms of Use and Privacy Policy.
Quadric // One architecture. Every algorithm.

Develop.

Simulate.

Profile.

Collaborate.