r8brain-free-src
High-quality pro audio sample rate converter library
 
Loading...
Searching...
No Matches
r8b::CDSPRealFFT Class Reference

Real-valued FFT transform class. More...

#include <CDSPRealFFT.h>

Inheritance diagram for r8b::CDSPRealFFT:

Public Member Functions

void convertToZP (double *const ap) const
 Converts the specified forward-transformed block into "zero-phase" form, suitable for use with the multiplyBlocksZP() function.
 
void forward (double *const p) const
 Performs in-place forward FFT.
 
double getInvMulConst () const
 Return a multiplication constant that should be used after inverse transform to obtain a correct value scale.
 
int getLen () const
 Returns the length (the number of real values in a transform) of this FFT object.
 
int getLenBits () const
 Returns the length (the number of real values in a transform) of this FFT object, expressed as Nth power of 2.
 
void inverse (double *const p) const
 Performs in-place inverse FFT.
 
void multiplyBlocks (const double *const aip, double *const aop) const
 Nultiplies two complex-valued data blocks in-place.
 
void multiplyBlocks (const double *const aip1, const double *const aip2, double *const aop) const
 Multiplies two complex-valued data blocks and places result in a new data block.
 
void multiplyBlocksZP (const double *const aip, double *const aop) const
 Multiplies two complex-valued data blocks in-place, considering that the aip block contains "zero-phase" response.
 

Friends

class CDSPRealFFTKeeper
 
class CPtrKeeper< CDSPRealFFT >
 

Detailed Description

Real-valued FFT transform class.

Class implements a wrapper for real-valued discrete fast Fourier transform functions. The object of this class can only be obtained via the CDSPRealFFTKeeper class.

Uses functions from the FFT package by: Copyright(C) 1996-2001 Takuya OOURA http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html

Also uses Intel IPP library functions if available (if the R8B_IPP=1 macro was defined). Note that IPP library's FFT functions are 2-3 times more efficient on the modern Intel Core i7-3770K processor than Ooura's functions. It may be worthwhile investing in IPP. Note, that FFT functions take less than 20% of the overall sample rate conversion time. However, when the "power of 2" resampling is used the performance of FFT functions becomes "everything".

Member Function Documentation

◆ convertToZP()

void r8b::CDSPRealFFT::convertToZP ( double *const ap) const

Converts the specified forward-transformed block into "zero-phase" form, suitable for use with the multiplyBlocksZP() function.

Parameters
[in,out]apBlock to transform.

◆ forward()

void r8b::CDSPRealFFT::forward ( double *const p) const

Performs in-place forward FFT.

Parameters
[in,out]pPointer to data block to transform, length should be equal to this object's getLen().

◆ inverse()

void r8b::CDSPRealFFT::inverse ( double *const p) const

Performs in-place inverse FFT.

Parameters
[in,out]pPointer to data block to transform, length should be equal to this object's getLen().

◆ multiplyBlocks() [1/2]

void r8b::CDSPRealFFT::multiplyBlocks ( const double *const aip,
double *const aop ) const

Nultiplies two complex-valued data blocks in-place.

Length of both data blocks should be equal to this object's block length. Blocks should have been produced with the forward() function of this object.

Parameters
aipInput data block 1.
[in,out]aopOutput/input data block 2.

◆ multiplyBlocks() [2/2]

void r8b::CDSPRealFFT::multiplyBlocks ( const double *const aip1,
const double *const aip2,
double *const aop ) const

Multiplies two complex-valued data blocks and places result in a new data block.

Length of all data blocks should be equal to this object's block length. Input blocks should have been produced with the forward() function of this object.

Parameters
aip1Input data block 1.
aip2Input data block 2.
[out]aopOutput data block, should not be equal to aip1 nor aip2.

◆ multiplyBlocksZP()

void r8b::CDSPRealFFT::multiplyBlocksZP ( const double *const aip,
double *const aop ) const

Multiplies two complex-valued data blocks in-place, considering that the aip block contains "zero-phase" response.

Length of both data blocks should be equal to this object's block length. Blocks should have been produced with the forward() function of this object.

Parameters
aipInput data block 1, "zero-phase" response. This block should be first transformed via the convertToZP() function.
[in,out]aopOutput/input data block 2.