You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When doing testing I noticed that there is possibility for "IndexError" if frequency is low and frequency estimation (that can slightly vary on frequency) gives abit too high number. Line number below might be off because of my debugging things.
waveform_analysis/thd.py", line 235, in THD
ampl = abs(f[i * h])
~^^^^^^^
IndexError: index 6006 is out of bounds for axis 0 with size 6001
I've tried to use "if ..." to check that there actually is that index and that helped, but maybe there is better, more optimized way to do it. At least it gets the error go away.
if i * h <= len(f):
ampl = abs(f[i * h])
The text was updated successfully, but these errors were encountered:
When doing testing I noticed that there is possibility for "IndexError" if frequency is low and frequency estimation (that can slightly vary on frequency) gives abit too high number. Line number below might be off because of my debugging things.
I've tried to use "if ..." to check that there actually is that index and that helped, but maybe there is better, more optimized way to do it. At least it gets the error go away.
The text was updated successfully, but these errors were encountered: