Module scaling

Module scaling 

Source
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§

SpectrumDataStats
Helper struct for SpectrumScalingFunction that 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_N but divides each value by sqrt(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 type SpectrumScalingFunction. Expects that SpectrumDataStats::min is not negative.

Type Aliases§

SpectrumScalingFunction
Describes the type for a function that scales/normalizes the data inside FrequencySpectrum.