Expand description
This module contains convenient public transform functions that you can use
as parameters in samples_fft_to_spectrum for scaling the frequency value
(the FFT result).
They act as “idea/inspiration”. Feel free to either compose them or create your own derivation from them.
Structs§
- Spectrum
Data Stats - Helper struct for
SpectrumScalingFunctionthat is passed into the scaling function together with the current frequency value.
Functions§
- combined
- Combines several scaling functions into a new single one.
- divide_
by_ N - Divides each value by N. Several resources recommend that the FFT result should be divided by the length of samples, so that values of different samples lengths are comparable.
- divide_
by_ N_ sqrt - Like
divide_by_Nbut divides each value bysqrt(N). - scale_
20_ times_ log10 - Calculates the base 10 logarithm of each frequency magnitude and multiplies it with 20.
- scale_
to_ zero_ to_ one - Scales each frequency value/amplitude in the spectrum to interval
[0.0; 1.0]. Function is of typeSpectrumScalingFunction. Expects thatSpectrumDataStats::minis not negative.
Type Aliases§
- Spectrum
Scaling Function - Describes the type for a function that scales/normalizes the data inside
FrequencySpectrum.