Skip to content

Commit

Permalink
solving make_spectrogram bug
Browse files Browse the repository at this point in the history
Bug Description: np.ndarray does not accept float as values for indices [ step = seg_length // 2 ] thus the make_spectrogram function doesn't work.
Solution: solving this issue by ensuring step is an integer [ step = int(seg_length // 2) ] thereby the values of i and j are also integers.
  • Loading branch information
aryabhatta000 authored Aug 13, 2018
1 parent 08219a7 commit 05bfe47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/thinkdsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ def make_spectrogram(self, seg_length, win_flag=True):
if win_flag:
window = np.hamming(seg_length)
i, j = 0, seg_length
step = seg_length // 2
step = int(seg_length // 2)

# map from time to Spectrum
spec_map = {}
Expand Down

0 comments on commit 05bfe47

Please sign in to comment.