![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Base class for FFT-based microphone signal processing. More...
#include <MicrophoneFourierBase.h>
Static Public Member Functions | |
static float | AverageMagnitude (uint16_t binL, uint16_t binH) |
Calculates the average magnitude of the specified FFT bins. | |
static bool | IsInitialized () |
Checks if the microphone system is initialized. | |
static float | GetSampleRate () |
Retrieves the current sampling rate. | |
static float * | GetSamples () |
Retrieves the raw input samples. | |
static float * | GetFourier () |
Retrieves the FFT output data. | |
static float * | GetFourierFiltered () |
Retrieves the filtered FFT output data. | |
static float | GetCurrentMagnitude () |
Retrieves the current signal magnitude. | |
Static Protected Attributes | |
static const uint16_t | FFTSize = 256 |
Size of the FFT (number of samples). | |
static const uint16_t | OutputBins = 128 |
Number of output bins from FFT processing. | |
static uint16_t | sampleRate = 8000 |
Sampling rate in Hz. | |
static uint8_t | pin = 0 |
Pin number for microphone input. | |
static float | minDB = 50.0f |
Minimum decibel value for normalization. | |
static float | maxDB = 120.0f |
Maximum decibel value for normalization. | |
static float | threshold = 400.0f |
Threshold value for processing. | |
static float | currentValue = 0.0f |
Current magnitude of the microphone signal. | |
static bool | isInitialized = false |
Flag indicating if the system is initialized. | |
static DerivativeFilter | peakFilterRate |
Filter for peak rate detection. | |
static float | inputSamp [FFTSize *2] |
Raw input samples for FFT. | |
static float | inputStorage [FFTSize] |
Storage for processed input samples. | |
static float | outputMagn [FFTSize] |
Magnitude output from FFT. | |
static float | outputData [OutputBins] |
Processed FFT data for output bins. | |
static float | outputDataFilt [OutputBins] |
Filtered FFT data for output bins. | |
static FFTFilter | fftFilters [OutputBins] |
Array of FFT filters for post-processing. | |
static FFT< FFTSize > | fft |
FFT processor instance. | |
Base class for FFT-based microphone signal processing.
The MicrophoneFourierBase class provides foundational support for microphone signal processing, including FFT transformations, signal normalization, and filtering. Derived classes can extend its functionality for specific applications.
Definition at line 29 of file MicrophoneFourierBase.h.
Calculates the average magnitude of the specified FFT bins.
binL | The lower bound of the bin range (inclusive). |
binH | The upper bound of the bin range (inclusive). |
Definition at line 23 of file MicrophoneFourierBase.cpp.
References FFTSize, and outputMagn.
Referenced by MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
|
static |
Retrieves the current signal magnitude.
Definition at line 54 of file MicrophoneFourierBase.cpp.
References threshold.
Referenced by AlphaAnimation::Update(), ArtleckAnimationV2::UpdateFFTVisemes(), ElGatoAnimation::UpdateFFTVisemes(), LeonHuskyAnimation::UpdateFFTVisemes(), MyntAnimation::UpdateFFTVisemes(), ProtobottAnimation::UpdateFFTVisemes(), SergaliciousAnimation::UpdateFFTVisemes(), TechSaneAnimation::UpdateFFTVisemes(), VesperAnimation::UpdateFFTVisemes(), WaffleDaProtoAnimation::UpdateFFTVisemes(), WarzoneAnimation::UpdateFFTVisemes(), AlphaAnimation::UpdateFFTVisemes(), and ProtogenProject::UpdateFFTVisemes().
|
static |
Retrieves the FFT output data.
Definition at line 46 of file MicrophoneFourierBase.cpp.
References outputData.
|
static |
Retrieves the filtered FFT output data.
Definition at line 50 of file MicrophoneFourierBase.cpp.
References outputDataFilt.
Referenced by ProtogenProject::AudioReactiveGradientFace(), ProtogenProject::SpectrumAnalyzerFace(), ArtleckAnimationV2::Update(), ElGatoAnimation::Update(), LeonHuskyAnimation::Update(), MyntAnimation::Update(), ProtobottAnimation::Update(), SergaliciousAnimation::Update(), TechSaneAnimation::Update(), VesperAnimation::Update(), WaffleDaProtoAnimation::Update(), WarzoneAnimation::Update(), AlphaAnimation::Update(), ArtleckAnimationV2::UpdateFFTVisemes(), ElGatoAnimation::UpdateFFTVisemes(), LeonHuskyAnimation::UpdateFFTVisemes(), MyntAnimation::UpdateFFTVisemes(), ProtobottAnimation::UpdateFFTVisemes(), SergaliciousAnimation::UpdateFFTVisemes(), TechSaneAnimation::UpdateFFTVisemes(), VesperAnimation::UpdateFFTVisemes(), WaffleDaProtoAnimation::UpdateFFTVisemes(), WarzoneAnimation::UpdateFFTVisemes(), AlphaAnimation::UpdateFFTVisemes(), and ProtogenProject::UpdateFFTVisemes().
|
static |
Retrieves the current sampling rate.
Definition at line 38 of file MicrophoneFourierBase.cpp.
References sampleRate.
Referenced by ArtleckAnimationV2::UpdateFFTVisemes(), ElGatoAnimation::UpdateFFTVisemes(), LeonHuskyAnimation::UpdateFFTVisemes(), MyntAnimation::UpdateFFTVisemes(), ProtobottAnimation::UpdateFFTVisemes(), SergaliciousAnimation::UpdateFFTVisemes(), TechSaneAnimation::UpdateFFTVisemes(), VesperAnimation::UpdateFFTVisemes(), WaffleDaProtoAnimation::UpdateFFTVisemes(), WarzoneAnimation::UpdateFFTVisemes(), AlphaAnimation::UpdateFFTVisemes(), and ProtogenProject::UpdateFFTVisemes().
|
static |
Retrieves the raw input samples.
Definition at line 42 of file MicrophoneFourierBase.cpp.
References inputStorage.
Referenced by ProtogenProject::OscilloscopeFace(), SergaliciousAnimation::Update(), and TechSaneAnimation::Update().
|
static |
Checks if the microphone system is initialized.
Definition at line 34 of file MicrophoneFourierBase.cpp.
References isInitialized.
|
staticprotected |
Current magnitude of the microphone signal.
Definition at line 38 of file MicrophoneFourierBase.h.
|
staticprotected |
FFT processor instance.
Definition at line 50 of file MicrophoneFourierBase.h.
Referenced by MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
|
staticprotected |
Array of FFT filters for post-processing.
Definition at line 48 of file MicrophoneFourierBase.h.
Referenced by MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
Size of the FFT (number of samples).
Definition at line 31 of file MicrophoneFourierBase.h.
Referenced by AverageMagnitude(), MicrophoneFourier::Initialize(), MicrophoneFourier::Reset(), and MicrophoneFourier::SamplerCallback().
|
staticprotected |
Raw input samples for FFT.
Definition at line 43 of file MicrophoneFourierBase.h.
Referenced by MicrophoneFourier::Reset(), MicrophoneFourier::SamplerCallback(), MicrophoneFourier::SamplerCallback(), MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
|
staticprotected |
Storage for processed input samples.
Definition at line 44 of file MicrophoneFourierBase.h.
Referenced by GetSamples(), MicrophoneFourier::SamplerCallback(), MicrophoneFourier::SamplerCallback(), MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
Flag indicating if the system is initialized.
Definition at line 39 of file MicrophoneFourierBase.h.
Referenced by MicrophoneFourier::Initialize(), MicrophoneFourier::Initialize(), MicrophoneFourier::Initialize(), and IsInitialized().
|
staticprotected |
Maximum decibel value for normalization.
Definition at line 36 of file MicrophoneFourierBase.h.
Referenced by MicrophoneFourier::Initialize(), MicrophoneFourier::Initialize(), MicrophoneFourier::Initialize(), MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
|
staticprotected |
Minimum decibel value for normalization.
Definition at line 35 of file MicrophoneFourierBase.h.
Referenced by MicrophoneFourier::Initialize(), MicrophoneFourier::Initialize(), MicrophoneFourier::Initialize(), MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
Number of output bins from FFT processing.
Definition at line 32 of file MicrophoneFourierBase.h.
Referenced by MicrophoneFourier::Initialize(), MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
|
staticprotected |
Processed FFT data for output bins.
Definition at line 46 of file MicrophoneFourierBase.h.
Referenced by GetFourier(), MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
|
staticprotected |
Filtered FFT data for output bins.
Definition at line 47 of file MicrophoneFourierBase.h.
Referenced by GetFourierFiltered(), MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
|
staticprotected |
Magnitude output from FFT.
Definition at line 45 of file MicrophoneFourierBase.h.
Referenced by AverageMagnitude(), MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
|
staticprotected |
Filter for peak rate detection.
Definition at line 41 of file MicrophoneFourierBase.h.
Referenced by MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().
|
staticprotected |
Pin number for microphone input.
Definition at line 34 of file MicrophoneFourierBase.h.
Referenced by MicrophoneFourier::Initialize(), MicrophoneFourier::Initialize(), MicrophoneFourier::Initialize(), and MicrophoneFourier::SamplerCallback().
|
staticprotected |
Sampling rate in Hz.
Definition at line 33 of file MicrophoneFourierBase.h.
Referenced by GetSampleRate(), MicrophoneFourier::Initialize(), MicrophoneFourier::Initialize(), MicrophoneFourier::Initialize(), MicrophoneFourier::setSamplingRate(), and MicrophoneFourier::StartSampler().
|
staticprotected |
Threshold value for processing.
Definition at line 37 of file MicrophoneFourierBase.h.
Referenced by GetCurrentMagnitude(), MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().