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

◆ nrf_dsp_freq_thd_i16()

int16_t nrf_dsp_freq_thd_i16 ( int16_t p_amplitude_spectrum[],
uint16_t num,
uint16_t base_freq_index,
uint16_t n_harmonics )

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

Compute Total Harmonic Distortion for provided frequency in fixed-point spectrum.

Parameters
[in]p_amplitude_spectrumPointer to amplitude spectrum vector
[in]numNumber of bins/samples in amplitude spectrum
[in]base_freq_indexFrequency index(bin) in amplitude spectrum for which THD will be computed
[in]n_harmonicsNumber of harmonics to compute THD, starting from second one, e.g. n_harmonics = 3 then for THD will be used H_2x, H_3x, H_4x
Returns
int16_t Relative Total Harmonic Distortion