Crate spectrum_analyzer[][src]

Simple no_std spectrum analysis library that follows the KISS (keep it simple, stupid) principle. The main goal of this crate is to be educational to the world and myself. This is not a bullet-proof or ideal solution! Feel free to contribute and point out possible errors/bugs/wrong assumptions or improvements!

Functions

hamming_window

Applies a Hamming window (https://en.wikipedia.org/wiki/Window_function#Hann_and_Hamming_windows) to an array of samples.

hann_window

Applies a Hann window (https://en.wikipedia.org/wiki/Window_function#Hann_and_Hamming_windows) to an array of samples.

samples_fft_to_spectrum

Takes an array of samples (length must be a power of 2), e.g. 2048, applies an FFT (using library rustfft) on it and returns all frequencies with their volume/magnitude.

Type Definitions

FrequencySpectrumMap

A map from frequency (in Hertz) to the magnitude. The magnitude is dependent on whether you scaled the values, e.g to logarithmic scale.