kaldi-native-fbank C++ API
Kaldi-compatible feature extraction C++ API
Loading...
Searching...
No Matches
knf::Rfft Class Reference

n-point real discrete Fourier transform, where n is even, n >= 2. More...

#include <rfft.h>

Public Member Functions

 Rfft (int32_t n, bool inverse=false)
 Construct an Rfft object.
 ~Rfft ()
 Destructor.
void Compute (float *in_out)
 Transform in place.
void Compute (double *in_out)
 Same as above, but for double precision.

Detailed Description

n-point real discrete Fourier transform, where n is even, n >= 2.

Forward transform:

\[ R[k] = \sum_{j=0}^{n-1} \mathrm{in}[j] \cos(2\pi j k / n), \qquad 0 \le k \le n/2 \]

\[ I[k] = \sum_{j=0}^{n-1} \mathrm{in}[j] \sin(2\pi j k / n), \qquad 0 < k < n/2 \]

Used by:
FbankComputer, MfccComputer, Stft and IStft.
See also
ComputePowerSpectrum, Stft

Constructor & Destructor Documentation

◆ Rfft()

knf::Rfft::Rfft ( int32_t n,
bool inverse = false )
explicit

Construct an Rfft object.

Parameters
nNumber of fft bins. It should be even.
inverseIf true, Compute() performs the inverse transform.

◆ ~Rfft()

knf::Rfft::~Rfft ( )

Destructor.

Member Function Documentation

◆ Compute() [1/2]

void knf::Rfft::Compute ( double * in_out)

Same as above, but for double precision.

◆ Compute() [2/2]

void knf::Rfft::Compute ( float * in_out)

Transform in place.

Parameters
in_outA 1-D array of size n. On return of the forward transform: in_out[0] = R[0] in_out[1] = R[n/2] for 1 < k < n/2, in_out[2*k] = R[k] in_out[2*k+1] = I[k]

The documentation for this class was generated from the following file:
  • /home/runner/work/kaldi-native-fbank/kaldi-native-fbank/kaldi-native-fbank/csrc/rfft.h