Driver for the fixedpoint-fft library (https://github.com/pschatzmann/fixedpoint-fft). CalcT selects the calculation type used by the underlying engine: int8_t/int16_t/int32_t for fixed point Qn math (smallest/fastest, ideal for plain AVR), or float/double on FPU-equipped targets (ESP32, Cortex-M4F/M7, desktop). Defaults to int16_t (Q15), which gives good precision at any FFT size without needing an FPU. The FFTDriver interface itself is always float, so values are rescaled into/out of CalcT's Qn range on the way in/out via fixedpoint_fft::fftConvertSample.
More...
#include <AudioFixedFFT.h>
|
| bool | begin (int len) override |
| |
| void | end () override |
| |
| fixedpoint_fft::FixedFFTEngineCore< CalcT > * | engine () |
| | Provides access to the underlying fixedpoint-fft engine.
|
| |
| void | fft () override |
| | Perform FFT.
|
| |
| bool | getBin (int pos, FFTBin &bin) override |
| | gets the value of a bin
|
| |
| float | getValue (int idx) override |
| | get Real value
|
| |
| 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 |
| | sets the value of a bin
|
| |
| void | setValue (int idx, float value) override |
| | Sets the real value.
|
| |
template<typename CalcT = int16_t>
class audio_tools::FFTDriverFixedFFT< CalcT >
Driver for the fixedpoint-fft library (https://github.com/pschatzmann/fixedpoint-fft). CalcT selects the calculation type used by the underlying engine: int8_t/int16_t/int32_t for fixed point Qn math (smallest/fastest, ideal for plain AVR), or float/double on FPU-equipped targets (ESP32, Cortex-M4F/M7, desktop). Defaults to int16_t (Q15), which gives good precision at any FFT size without needing an FPU. The FFTDriver interface itself is always float, so values are rescaled into/out of CalcT's Qn range on the way in/out via fixedpoint_fft::fftConvertSample.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
◆ begin()
template<typename CalcT = int16_t>
◆ end()
template<typename CalcT = int16_t>
◆ engine()
template<typename CalcT = int16_t>
| fixedpoint_fft::FixedFFTEngineCore< CalcT > * engine |
( |
| ) |
|
|
inline |
Provides access to the underlying fixedpoint-fft engine.
◆ fft()
template<typename CalcT = int16_t>
◆ getBin()
template<typename CalcT = int16_t>
| bool getBin |
( |
int |
pos, |
|
|
FFTBin & |
bin |
|
) |
| |
|
inlineoverridevirtual |
gets the value of a bin
Reimplemented from FFTDriver.
◆ getValue()
template<typename CalcT = int16_t>
| float getValue |
( |
int |
idx | ) |
|
|
inlineoverridevirtual |
◆ imagAsFloat()
template<typename CalcT = int16_t>
| float imagAsFloat |
( |
int |
idx | ) |
|
|
inlineprotected |
◆ isReverseFFT()
template<typename CalcT = int16_t>
Returns true if reverse FFT is supported.
Reimplemented from FFTDriver.
◆ isValid()
template<typename CalcT = int16_t>
◆ magnitude()
template<typename CalcT = int16_t>
| float magnitude |
( |
int |
idx | ) |
|
|
inlineoverridevirtual |
Calculate the magnitude (fft result) at index (sqr(i² + r²))
Implements FFTDriver.
◆ magnitudeFast()
template<typename CalcT = int16_t>
| float magnitudeFast |
( |
int |
idx | ) |
|
|
inlineoverridevirtual |
◆ realAsFloat()
template<typename CalcT = int16_t>
| float realAsFloat |
( |
int |
idx | ) |
|
|
inlineprotected |
◆ rfft()
template<typename CalcT = int16_t>
Inverse fft - convert fft result back to time domain (samples)
Reimplemented from FFTDriver.
◆ setBin() [1/2]
| bool setBin |
( |
int |
pos, |
|
|
FFTBin & |
bin |
|
) |
| |
|
inlineinherited |
◆ setBin() [2/2]
template<typename CalcT = int16_t>
| bool setBin |
( |
int |
idx, |
|
|
float |
real, |
|
|
float |
img |
|
) |
| |
|
inlineoverridevirtual |
sets the value of a bin
Reimplemented from FFTDriver.
◆ setValue()
template<typename CalcT = int16_t>
| void setValue |
( |
int |
pos, |
|
|
float |
value |
|
) |
| |
|
inlineoverridevirtual |
◆ ffp_object
template<typename CalcT = int16_t>
| fixedpoint_fft::FixedFFTEngineCore<CalcT> ffp_object |
|
protected |
◆ len
template<typename CalcT = int16_t>
◆ valid
template<typename CalcT = int16_t>
The documentation for this class was generated from the following file: