arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
FFTDriverRealFFT Class Reference

Driver for RealFFT. More...

#include <AudioRealFFT.h>

Inheritance diagram for FFTDriverRealFFT:
FFTDriver

Public Member Functions

bool begin (int len) override
 
void end () override
 
void fft () override
 Perform FFT.
 
bool getBin (int pos, FFTBin &bin) override
 Gets bin real/imag from the result of the last forward fft().
 
float getValue (int idx) override
 
bool isReverseFFT () override
 Returns true if reverse FFT is supported.
 
bool isValid () override
 
float magnitude (int idx) override
 Calculate the magnitude (fft result) at index (sqr(i² + r²))
 
float magnitudeFast (int idx) override
 magnitude w/o sqrt
 
void rfft () override
 Inverse fft - convert fft result back to time domain (samples)
 
bool setBin (int pos, FFTBin &bin)
 sets the value of a bin
 
bool setBin (int pos, float real, float img) override
 
void setValue (int idx, float value) override
 Sets the real value.
 

Public Attributes

int len
 
ffft::FFTReal< float > * p_fft_object =nullptr
 
Vector< float > v_f {0}
 
Vector< float > v_x {0}
 

Detailed Description

Driver for RealFFT.

Author
Phil Schatzmann

Member Function Documentation

◆ begin()

bool begin ( int  len)
inlineoverridevirtual

Implements FFTDriver.

◆ end()

void end ( )
inlineoverridevirtual

Implements FFTDriver.

◆ fft()

void fft ( )
inlineoverridevirtual

Perform FFT.

Implements FFTDriver.

◆ getBin()

bool getBin ( int  pos,
FFTBin bin 
)
inlineoverridevirtual

Gets bin real/imag from the result of the last forward fft().

Reimplemented from FFTDriver.

◆ getValue()

float getValue ( int  idx)
inlineoverridevirtual

Get the reconstructed time-domain sample. Only meaningful after rfft() (inverse FFT) writes its result into v_x; right after a forward fft() this still holds the original input samples, so use getBin() for frequency-domain results instead.

Implements FFTDriver.

◆ isReverseFFT()

bool isReverseFFT ( )
inlineoverridevirtual

Returns true if reverse FFT is supported.

Reimplemented from FFTDriver.

◆ isValid()

bool isValid ( )
inlineoverridevirtual

Implements FFTDriver.

◆ magnitude()

float magnitude ( int  idx)
inlineoverridevirtual

Calculate the magnitude (fft result) at index (sqr(i² + r²))

Implements FFTDriver.

◆ magnitudeFast()

float magnitudeFast ( int  idx)
inlineoverridevirtual

magnitude w/o sqrt

Implements FFTDriver.

◆ rfft()

void rfft ( )
inlineoverridevirtual

Inverse fft - convert fft result back to time domain (samples)

Reimplemented from FFTDriver.

◆ setBin() [1/2]

bool setBin ( int  pos,
FFTBin bin 
)
inlineinherited

sets the value of a bin

◆ setBin() [2/2]

bool setBin ( int  pos,
float  real,
float  img 
)
inlineoverridevirtual

Sets bin real/imag as input for the next rfft() (inverse FFT). Only bins 0..len/2 are meaningful for a real-valued signal; the negative-imaginary companion for bins 1..len/2-1 is written automatically in the same packed layout do_fft() produces.

Reimplemented from FFTDriver.

◆ setValue()

void setValue ( int  pos,
float  value 
)
inlineoverridevirtual

Sets the real value.

Implements FFTDriver.

Member Data Documentation

◆ len

int len

◆ p_fft_object

ffft::FFTReal<float>* p_fft_object =nullptr

◆ v_f

Vector<float> v_f {0}

◆ v_x

Vector<float> v_x {0}

The documentation for this class was generated from the following file: