Skip to main content

Crate delay_line

Crate delay_line 

Source
Expand description

A delay-line buffer for real-time use.

§Examples

In this example, we mix in a delayed version of the signal x, delayed by 2 samples.

use delay_line::*;

let mut x = [1.0, 0.0, 0.0, 1.0, 0.0, 0.0];

let mut delay = delay_line![0.0; 2];

for x in &mut x
{
    *x += delay.delay(*x)*0.5;
}

assert_eq!(x, [1.0, 0.0, 0.5, 1.0, 0.0, 0.5])

Macros§

delay_line

Structs§

DelayLine
A similar data-structure to a VecDeque, in that it is cyclic, but instead of cycling around its capacity, it cycles around its length. This makes rotation and SISO-behaviour simpler, but all operations that change the delay-line’s length require it to be made contiguous first.

Type Aliases§

IntoIter
Iter
IterMut