generic circular buffer implementation in C
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
circbuf/meanbuf
Ondřej Hruška 891c07f5fb moved to folders, updated etc 10 年前
..
README.md moved to folders, updated etc 10 年前
meanbuf.c moved to folders, updated etc 10 年前
meanbuf.h moved to folders, updated etc 10 年前

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).