Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run demo, getting float>integer issue #15

Open
mbrown0294 opened this issue Apr 20, 2022 · 0 comments
Open

Cannot run demo, getting float>integer issue #15

mbrown0294 opened this issue Apr 20, 2022 · 0 comments

Comments

@mbrown0294
Copy link

I'm having an issue running the demos. I'm running the demo in a Jupyter Notebook, but when I get to generating a tone, I get this error, which seems to be coming from numpy's ramped_tone() function. Any chance you know how to get around this?

`
TypeError Traceback (most recent call last)
in
1 fs = 100e3
2 cf = 1000
----> 3 tone = wv.ramped_tone(
4 fs=fs,
5 freq=1000,

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/thorns/waves.py in ramped_tone(fs, freq, duration, pad, pre, ramp, dbspl, phase)
169
170 if ramp != 0:
--> 171 ramp_signal = np.linspace(0, 1, np.ceil(ramp * fs))
172 s[0:len(ramp_signal)] = s[0:len(ramp_signal)] * ramp_signal
173 s[-len(ramp_signal):] = s[-len(ramp_signal):] * ramp_signal[::-1]

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/overrides.py in linspace(*args, **kwargs)

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/function_base.py in linspace(start, stop, num, endpoint, retstep, dtype, axis)
118
119 """
--> 120 num = operator.index(num)
121 if num < 0:
122 raise ValueError("Number of samples, %s, must be non-negative." % num)

TypeError: 'numpy.float64' object cannot be interpreted as an integer
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant