Edge AI Add-on API 2.2.0
Loading...
Searching...
No Matches

◆ nrf_dsp_spectral_centroid_i16()

int16_t nrf_dsp_spectral_centroid_i16 ( int16_t p_spectrum[],
uint16_t num,
nrf_dsp_spectral_ctx_i16_t * p_ctx )

#include <include/nrf_edgeai/dsp/spectral/nrf_dsp_spectral_centroid.h>

Calculate Spectral Centroid in INT16 fixed-point spectrum.

Parameters
[in]p_spectrumPointer to amplitude spectrum vector
[in]numNumber of bins/samples in amplitude spectrum
[in,out]p_ctxPointer to optional spectral context, the calculated value of magnitude_sum and cetroid will be written to context for further use
Returns
int16_t Spectral Centroid