Skip to content

File syn_vector.h

FileList > src > syntropic > util > syn_vector.h

Go to the source code of this file

Fixed-point Q16.16 Vector operations and signal statistics — zero heap allocation.

  • #include "../common/syn_defs.h"
  • #include "syn_qmath.h"
  • #include <stdbool.h>
  • #include <stdint.h>

Public Functions

Type Name
void syn_vec_add (const q16_t * a, const q16_t * b, q16_t * out, uint16_t n)
Elementwise vector addition out = a + b.
void syn_vec_clamp (const q16_t * v, q16_t min_val, q16_t max_val, q16_t * out, uint16_t n)
Elementwise vector clamping: min_val <= out[i] <= max_val.
q16_t syn_vec_max (const q16_t * v, uint16_t n)
Find maximum value in vector.
q16_t syn_vec_mean (const q16_t * v, uint16_t n)
Calculate arithmetic mean (average) of vector.
q16_t syn_vec_min (const q16_t * v, uint16_t n)
Find minimum value in vector.
q16_t syn_vec_rms (const q16_t * v, uint16_t n)
Calculate Root Mean Square (RMS) of vector.
void syn_vec_scale (const q16_t * v, q16_t scale, q16_t * out, uint16_t n)
Elementwise vector scalar multiplication out = v * scale.
void syn_vec_sub (const q16_t * a, const q16_t * b, q16_t * out, uint16_t n)
Elementwise vector subtraction out = a - b.
q16_t syn_vec_variance (const q16_t * v, uint16_t n)
Calculate variance of vector elements.

Public Functions Documentation

function syn_vec_add

Elementwise vector addition out = a + b.

void syn_vec_add (
    const q16_t * a,
    const q16_t * b,
    q16_t * out,
    uint16_t n
) 


function syn_vec_clamp

Elementwise vector clamping: min_val <= out[i] <= max_val.

void syn_vec_clamp (
    const q16_t * v,
    q16_t min_val,
    q16_t max_val,
    q16_t * out,
    uint16_t n
) 


function syn_vec_max

Find maximum value in vector.

q16_t syn_vec_max (
    const q16_t * v,
    uint16_t n
) 


function syn_vec_mean

Calculate arithmetic mean (average) of vector.

q16_t syn_vec_mean (
    const q16_t * v,
    uint16_t n
) 


function syn_vec_min

Find minimum value in vector.

q16_t syn_vec_min (
    const q16_t * v,
    uint16_t n
) 


function syn_vec_rms

Calculate Root Mean Square (RMS) of vector.

q16_t syn_vec_rms (
    const q16_t * v,
    uint16_t n
) 


function syn_vec_scale

Elementwise vector scalar multiplication out = v * scale.

void syn_vec_scale (
    const q16_t * v,
    q16_t scale,
    q16_t * out,
    uint16_t n
) 


function syn_vec_sub

Elementwise vector subtraction out = a - b.

void syn_vec_sub (
    const q16_t * a,
    const q16_t * b,
    q16_t * out,
    uint16_t n
) 


function syn_vec_variance

Calculate variance of vector elements.

q16_t syn_vec_variance (
    const q16_t * v,
    uint16_t n
) 



The documentation for this class was generated from the following file src/syntropic/util/syn_vector.h