Add phase to waves.sine
This commit is contained in:
parent
61a21ff4be
commit
bf13ec9a94
1 changed files with 3 additions and 3 deletions
|
@ -8,9 +8,9 @@ import numpy as np
|
||||||
|
|
||||||
__default_num_harmonics = 10
|
__default_num_harmonics = 10
|
||||||
|
|
||||||
def sine(domain, freq=1.0):
|
def sine(domain, freq=1.0, phase=0):
|
||||||
'''Render a sine wave in the given domain with the specified frequency.'''
|
'''Render a sine wave in the given time domain with the specified frequency and phase.'''
|
||||||
return np.sin(2.0 * np.pi * freq * domain)
|
return np.sin(2.0 * np.pi * freq * domain + phase)
|
||||||
|
|
||||||
def saw(domain, freq=1.0, num_harmonics=__default_num_harmonics):
|
def saw(domain, freq=1.0, num_harmonics=__default_num_harmonics):
|
||||||
'''
|
'''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue