Expand description
A ring buffer implementation where newer samples overwrite old samples. This implementation also enables the use of Rust iterators to iterate through the ring buffer in order from oldest to newest entries.
This library is implemented without the use of the standard library, and thus requires passing in a “backing store” of a statically allocated array.
Macros§
Structs§
- Ring
Buffer - An implementation of a ring buffer data structure that creates a “lossy” queue. This is a
simplified version of the generic heapless
Queue
with a few constraints relaxed: - Ring
Buffer Iterator
Functions§
- ac_rms
- Calculate the root-mean-square of
buffer
, passing inmean
as the pre-calculated mean. - mean
- Calculate the mean of the values inside
buffer
. - windowed_
ac_ rms - Calculate the AC RMS of the last
window_len
values insidebuffer
. - windowed_
mean - Calculate the mean of the last
window_len
values insidebuffer
.