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

◆ nrf_edgeai_obsv_metric_med_create()

void nrf_edgeai_obsv_metric_med_create ( nrf_edgeai_obsv_metric_t * metric,
void * buf,
uint16_t n_features )

#include <include/nrf_edgeai_obsv/nrf_edgeai_obsv_metrics.h>

Initialize a mel energy descriptor metric using caller-provided storage.

Consumes the input-feature stream (NRF_EDGEAI_OBSV_SOURCE_FEATURES). Each feature value is normalized into [0, 1] against the configured percentile range [p01, p99] (CONFIG_NRF_EDGEAI_OBSV_MEL_ENERGY_DESC_SCALE_P01_MILLI / _SCALE_P99_MILLI, in thousandths of a feature unit). The metric then derives four per-frame statistics from the normalized vector — mean energy, max energy, dynamic range (q95 - q05) — plus the floor-bin ratio (fraction of raw bins <= 0) — and accumulates each into its own [0, 1] histogram row.

The caller allocates a buffer of at least NRF_EDGEAI_OBSV_MED_STORAGE_BYTES bytes, passes it here, then registers the metric with nrf_edgeai_obsv_core_register().

Parameters
metricMetric descriptor to fill. Must not be NULL.
bufBuffer of at least NRF_EDGEAI_OBSV_MED_STORAGE_BYTES(n_features) bytes, aligned to at least sizeof(uint32_t). Must not be NULL.
n_featuresMel feature vector length (> 0), used to validate updates.