Skip to content

Errors (IndexError) on silent waves (degenerate pathological cases) #19

Open
@nyanpasu64

Description

  File "/home/nyanpasu64/miniconda3/envs/wavetable/lib/python3.6/site-packages/waveform_analysis/freq_estimation.py", line 92, in freq_from_autocorr
    start = find(d > 0)[0]
IndexError: index 0 is out of bounds for axis 0 with size 0

If freq_from_autocorr is given a silent signal d contains a series of 0.

I feel the best solution is to just return some arbitrary value without crashing.


I don't remember if it happens in practice, but a while back I found that parabolic(f, 0) compares to f[-1] (which is wrong but doesn't crash) and parabolic(f, len(f)-1) compares to f[len(x)] which raises IndexError.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions