Copyright | (c) Ivan Perez 2019-2022 (c) Ivan Perez and Manuel Baerenz 2016-2018 |
---|---|
License | BSD3 |
Maintainer | ivan.perez@keera.co.uk |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Discrete to continuous-time signal functions.
Discrete to continuous-time signal functions
Wave-form generation
hold :: Monad m => a -> SF m (Event a) a Source #
Zero-order hold.
Converts a discrete-time signal into a continuous-time signal, by holding the last value until it changes in the input signal. The given parameter may be used for time zero, and until the first event occurs in the input signal, so hold is always well-initialized.
>>>
embed (hold 1) (deltaEncode 0.1 [NoEvent, NoEvent, Event 2, NoEvent, Event 3, NoEvent])
[1,1,2,2,3,3]
Accumulators
accumBy :: Monad m => (b -> a -> b) -> b -> SF m (Event a) (Event b) Source #
Accumulator parameterized by the accumulation function.
accumHoldBy :: Monad m => (b -> a -> b) -> b -> SF m (Event a) b Source #
Zero-order hold accumulator parameterized by the accumulation function.