Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
lampda::utils::fft::FftAnalyzer< samplesFFT, resultSize, T > Class Template Reference

Wrapper class for the FFT implementation. More...

#include <fft.h>

Public Member Functions

void reset ()
 
int to_bin_index (const T frequency) const noexcept
 Map frequency to bin index.
 
medium_bin_frequency (uint16_t index) const noexcept
 center frequency of a linear bin
 
min_bin_frequency (uint16_t index) const noexcept
 min frequency of a linear bin
 
max_bin_frequency (uint16_t index) const noexcept
 max frequency of a linear bin
 
get_log_bin_min_frequency (uint16_t index) const noexcept
 get the minimum frequency represented by the fft bin at index
 
get_log_bin_max_frequency (uint16_t index) const noexcept
 get the minimum frequency represented by the fft bin at index
 
void set_data (const T data, uint16_t index)
 Set the microphone data at the target index.
 
void run_fast_fourrier_transform ()
 Run FFT main code.
 

Public Attributes

std::array< T, samplesFFTRes > fftBin
 output variables
 
std::array< T, resultSize > fftLog
 fft result as a log scale
 
maxMagnitude
 maximum detected frequency magnitude
 
maxFrequency
 maximum detected frequency, in Hertz
 

Detailed Description

template<uint16_t samplesFFT, uint16_t resultSize, typename T = float>
class lampda::utils::fft::FftAnalyzer< samplesFFT, resultSize, T >

Wrapper class for the FFT implementation.

Parameters
[in]samplesFFTIs the input frequency bins before analysis
[in]resultSizeIs the resulting frequency bins after analysis

Member Function Documentation

◆ get_log_bin_max_frequency()

template<uint16_t samplesFFT, uint16_t resultSize, typename T = float>
T lampda::utils::fft::FftAnalyzer< samplesFFT, resultSize, T >::get_log_bin_max_frequency ( uint16_t  index) const
inlinenoexcept

get the minimum frequency represented by the fft bin at index

Parameters
[in]indexindex of the fft bin
Returns
the max frequency of the bin

◆ get_log_bin_min_frequency()

template<uint16_t samplesFFT, uint16_t resultSize, typename T = float>
T lampda::utils::fft::FftAnalyzer< samplesFFT, resultSize, T >::get_log_bin_min_frequency ( uint16_t  index) const
inlinenoexcept

get the minimum frequency represented by the fft bin at index

Parameters
[in]indexindex of the fft bin
Returns
the min frequency of the bin

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