Open
Description
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])
Metadata
Metadata
Assignees
Labels
No labels
Activity