pub fn sine<S>(phase: Phase<S>) -> Sine<S>
Expand description
Produces a Signal
that yields a sine wave oscillating at the given hz.
ยงExample
use dasp_signal::{self as signal, Signal};
fn main() {
// Generates a sine wave signal at 1hz to be sampled 4 times per second.
let mut signal = signal::rate(4.0).const_hz(1.0).sine();
assert_eq!(signal.next(), 0.0);
assert_eq!(signal.next(), 1.0);
signal.next();
assert_eq!(signal.next(), -1.0);
}