From bf13ec9a94ea829216626491e03b7cc5ab771bf7 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 27 Mar 2018 07:21:10 -0700 Subject: [PATCH] Add phase to waves.sine --- signals/waves.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/signals/waves.py b/signals/waves.py index 7dc1224..bc199fa 100644 --- a/signals/waves.py +++ b/signals/waves.py @@ -8,9 +8,9 @@ import numpy as np __default_num_harmonics = 10 -def sine(domain, freq=1.0): - '''Render a sine wave in the given domain with the specified frequency.''' - return np.sin(2.0 * np.pi * freq * domain) +def sine(domain, freq=1.0, phase=0): + '''Render a sine wave in the given time domain with the specified frequency and phase.''' + return np.sin(2.0 * np.pi * freq * domain + phase) def saw(domain, freq=1.0, num_harmonics=__default_num_harmonics): '''