generic circular buffer implementation in C
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
circbuf/meanbuf
Ondřej Hruška 891c07f5fb moved to folders, updated etc hace 8 años
..
README.md moved to folders, updated etc hace 8 años
meanbuf.c moved to folders, updated etc hace 8 años
meanbuf.h moved to folders, updated etc hace 8 años

README.md

Averaging float buffer

(You can adjust it to use doubles, if you prefer.)

The meanbuf_create() function allocates a buffer.

You can then call meanbuf_add() to add a new value into the buffer (and remove the oldest). This function returns the current average value.

This buffer can be used for signal smoothing (such as from an analogue sensor).