Edge AI Add-on API 2.2.0
Loading...
Searching...
No Matches
nrf_dsp_scale_minmax.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
15#ifndef _NRF_DSP_SUPPORT_SCALE_MINMAX_H_
16#define _NRF_DSP_SUPPORT_SCALE_MINMAX_H_
17
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
34 uint16_t num,
35 const flt32_t min,
36 const flt32_t max,
37 flt32_t* p_output);
38
49void nrf_dsp_scale_minmax_i8(const int8_t* p_input,
50 uint16_t num,
51 const int8_t min,
52 const int8_t max,
53 int8_t* p_output);
54
65void nrf_dsp_scale_minmax_i16(const int16_t* p_input,
66 uint16_t num,
67 const int16_t min,
68 const int16_t max,
69 int16_t* p_output);
70
80#define nrf_dsp_scale_minmax_int_q(var, qfactor, min, max) \
81 (((int32_t)(var - min) * qfactor) / (max - min))
82
91#define nrf_dsp_scale_minmax_float(var, min, max) ((flt32_t)(var - min) / (max - min))
92
102#define nrf_dsp_scale_minmax_float_q(var, qfactor, min, max) (((var - min) * qfactor) / (max - min))
103
104#ifdef __cplusplus
105}
106#endif
107
108#endif /* _NRF_DSP_SUPPORT_SCALE_MINMAX_H_ */
109
void nrf_dsp_scale_minmax_i16(const int16_t *p_input, uint16_t num, const int16_t min, const int16_t max, int16_t *p_output)
Min-Max scaling of the INT16 vector ( y = (x - min) / (max - min) )
void nrf_dsp_scale_minmax_i8(const int8_t *p_input, uint16_t num, const int8_t min, const int8_t max, int8_t *p_output)
Min-Max scaling of the INT8 vector ( y = (x - min) / (max - min) )
void nrf_dsp_scale_minmax_f32(const flt32_t *p_input, uint16_t num, const flt32_t min, const flt32_t max, flt32_t *p_output)
Min-Max scaling of the floating-point vector ( y = (x - min) / (max - min) )
float flt32_t
32-bit floating-point type definition.
Definition nrf_edgeai_ctypes.h:21