5#ifndef COMPONENT_SOUND_H
6#define COMPONENT_SOUND_H
46 std::array<int16_t, SAMPLE_SIZE>
data;
75 std::array<float, numberOfFFtChanels>
fft_log;
Wrapper of the ArduinoFFT library.
constexpr float desiredoutput
Desired output of the auto gain (0-1)
Definition: sound.h:25
constexpr int16_t gainedSignalTarget
Desired output of the auto gain (0-INT16_MAX)
Definition: sound.h:27
bool enable()
Start the microphone data analysis, if not already started.
Definition: sound.cpp:54
void disable()
Disable the microphone data analysis, if its running.
Definition: sound.cpp:65
constexpr float silenceLevelDb
Decibel level for a silent room.
Definition: sound.h:20
void disable_after_non_use()
disable microphone if last used a target time ago
Definition: sound.cpp:76
SoundStruct & get_sound_characteristics()
Compute and process sound data.
Definition: sound.cpp:169
constexpr float highLevelDb
Microphone is not good enough at after this.
Definition: sound.h:22
Program scope.
Definition: control_fixed_modes.hpp:12
Interface for the platform specific microphone.
Handle the analysis of a sound sample. This structure handled the FastFourrier analysis of a sound sa...
Definition: sound.h:34
bool isFFTValid
validity flag for the FFT results
Definition: sound.h:62
std::array< int16_t, SAMPLE_SIZE > rectifiedData
audio data with auto gain enabled
Definition: sound.h:48
std::array< float, numberOfFFtChanels > fft_log
Results of the FFT process, in scaled logarithmic bins. This is closer to the sound sensitivity of th...
Definition: sound.h:75
float sound_level_Db
Sound level of this sample, in Decibels A.
Definition: sound.h:51
std::array< float, numberOfFFtChanels > fft_log_end_frequencies
Results of the FFT process, in maximum frequency for every bin.
Definition: sound.h:77
std::array< int16_t, SAMPLE_SIZE > data
raw audio data
Definition: sound.h:46
float maxAmplitude
Maximum detected amplitude of this sample.
Definition: sound.h:53
std::array< float, SAMPLE_SIZE/2 > fft_raw
Results of the FFT process, in raw Hertz bins.
Definition: sound.h:73
bool isDataValid
flag that indicate sound data validity
Definition: sound.h:40
static constexpr float get_fft_resolution_Hz()
Return the FFT resolution of a single FFT bin in Hertz.
Definition: sound.h:68
float maxAmplitudeFrequency
Maximum detected amplitude frequency of this sample, in Hertz.
Definition: sound.h:55
static constexpr auto SAMPLE_SIZE
Size fo the audio sample.
Definition: sound.h:43
static constexpr uint8_t numberOfFFtChanels
Define the number of FFt bins to use. You should set this number close to the lamp max X coordinates.
Definition: sound.h:65
static constexpr uint16_t SAMPLE_SIZE
Size of the sound sample.
Definition: pdm_handle.h:26