No Matches
Public Member Functions | List of all members
audio_tools::AudioESP32FFT Class Reference

AudioFFT using RealFFT. More...

#include <AudioESP32FFT.h>

Inheritance diagram for audio_tools::AudioESP32FFT:
audio_tools::AudioFFTBase audio_tools::AudioPrint audio_tools::Print audio_tools::AudioBaseInfoDependent audio_tools::AudioBaseInfoSource

Public Member Functions

float * array ()
 Provides the result array returned by the FFT: The real part of a magnitude at a frequency is followed by the corresponding imaginary part in the output*‍/.
FFTDriverESP32FFTdriverEx ()
- Public Member Functions inherited from audio_tools::AudioFFTBase
 AudioFFTBase (FFTDriver *driver)
 Default Constructor. The len needs to be of the power of 2 (e.g. 512, 1024, 2048, 4096, 8192)
int availableForWrite ()
 We try to fill the buffer at once. More...
bool begin (AudioFFTConfig info)
 starts the processing
AudioFFTConfig config ()
 Provides the actual configuration.
AudioFFTConfig defaultConfig ()
 Provides the default configuration.
FFTDriverdriver ()
 provides access to the FFTDriver which implements the basic FFT functionality
void end ()
 Release the allocated memory.
float frequency (int bin)
 Determines the frequency of the indicated bin.
int length ()
 The number of samples.
float magnitude (int bin)
 Calculates the magnitude of the fft result to determine the max value (bin is 0 to size())
float * magnitudes ()
 Provides the magnitudes as array of size size(). Please note that this method is allocating additinal memory!
AudioFFTResult result ()
 Determines the result values in the max magnitude bin.
template<int N>
void resultArray (AudioFFTResult(&result)[N])
 Determines the N biggest result values.
unsigned long resultTime ()
 time after the fft: time when the last result was provided - you can poll this to check if we have a new result
unsigned long resultTimeBegin ()
 time before the fft
void setAudioInfo (AudioBaseInfo info) override
 Notify change of audio information. More...
int size ()
 The number of bins used by the FFT which are relevant for the result.
size_t write (const uint8_t *data, size_t len) override
 Provide the audio data as FFT input. More...
- Public Member Functions inherited from audio_tools::AudioPrint
virtual AudioBaseInfo audioInfo () override
virtual int availableForWrite () override
virtual bool doRelease ()
 If true we need to release the related memory. More...
virtual void flush ()
virtual void setAudioInfo (AudioBaseInfo info) override
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi) override
virtual size_t write (const uint8_t *buffer, size_t size) override=0
virtual size_t write (uint8_t ch) override
- Public Member Functions inherited from audio_tools::Print
virtual int availableForWrite ()
virtual void flush ()
virtual int print (char c, PrintCharFmt spec)
virtual int print (const char *msg)
virtual int print (int number)
virtual int println (const char *msg="")
virtual size_t write (const char *buffer, size_t size)
virtual size_t write (const char *str)
virtual size_t write (const uint8_t *buffer, size_t size)
virtual size_t write (uint8_t ch)
- Public Member Functions inherited from audio_tools::AudioBaseInfoDependent
virtual AudioBaseInfo audioInfo ()=0
virtual void setAudioInfo (AudioBaseInfo info)=0
virtual bool validate (AudioBaseInfo &info)
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi)=0

Additional Inherited Members

- Protected Member Functions inherited from audio_tools::AudioFFTBase
int bytesPerSample ()
bool createStrideBuffer ()
 Allocates the stride buffer if necessary.
void fft ()
template<int N>
bool InsertSorted (AudioFFTResult(&result)[N], AudioFFTResult tmp)
 make sure that we do not reuse already found results
bool isPowerOfTwo (uint16_t x)
template<typename T >
void processSamples (const void *data, size_t byteCount)
void writeStrideBuffer (uint8_t *buffer, size_t len)
- Protected Attributes inherited from audio_tools::AudioFFTBase
AudioFFTConfig cfg
int current_pos = 0
FFTDriverp_driver =nullptr
float * p_magnitudes = nullptr
RingBuffer< uint8_t > * p_stridebuffer = nullptr
unsigned long timestamp =0l
unsigned long timestamp_begin =0l
- Protected Attributes inherited from audio_tools::AudioPrint
AudioBaseInfo cfg
AudioBaseInfoDependentp_notify =nullptr
uint8_t tmp [MAX_SINGLE_CHARS]
int tmpPos =0

Detailed Description

AudioFFT using RealFFT.

Phil Schatzmann Warning: This does not work as expected yet: I did not get the expected results...

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