[Numpy-discussion] Creating a sine wave with exponential decay
ram at rachum.com
Tue Jul 23 10:28:03 EDT 2019
Hi everyone! Total Numpy newbie here.
I'd like to create an array with a million numbers, that has a sine wave
with exponential decay on the amplitude.
In other words, I want the value of each cell n to be sin(n) * 2 ** (-n *
What would be the most efficient way to do that?
Someone suggested I do something like this:
y = np.sin(x) * np.exp(newfactor * x)
But this would create 2 arrays, wouldn't it? Isn't that wasteful? Does
an efficient way of doing that without creating a redundant array?
Thanks for your help,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion