AllenDowney / ThinkDSP

Think DSP: Digital Signal Processing in Python, by Allen B. Downey.
https://allendowney.github.io/ThinkDSP/
3.93k stars 3.2k forks source link

Spectrogram slice expects integer #25

Closed osunderdog closed 7 years ago

osunderdog commented 7 years ago

Chapter three Spectrogram header. in wave.make_spectogram I am running into this error:

TypeError: slice indices must be integers or None or have an index method

Looks like wave.split() expects integer input, but the spectrogram has division which causes i and j to go to float.

because this line is division: step = seg_length / 2

maybe step = seg_length//2

??

AllenDowney commented 7 years ago

Fixed with commit 75ed0c1 Thank you!