Skip to content

Commit

Permalink
Merge pull request #33 from Helias/fix-non-int
Browse files Browse the repository at this point in the history
fix: non-int issue and remove useless variables
  • Loading branch information
SuperKogito committed Jul 4, 2022
2 parents c344e2b + 4d1554d commit c090c74
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions spafe/utils/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,11 @@ def framing(sig, fs=16000, win_len=0.025, win_hop=0.01):
raise ParameterError(ErrorMsgs["win_len_win_hop_comparison"])

# compute frame length and frame step (convert from seconds to samples)
frame_length = win_len * fs
frame_step = win_hop * fs
signal_length = len(sig)
frames_overlap = frame_length - frame_step
frame_length = int(win_len * fs)
frame_step = int(win_hop * fs)

# make sure to use integers as indices
frames = stride_trick(sig, int(frame_length), int(frame_step))
frames = stride_trick(sig, frame_length, frame_step)
if len(frames[-1]) < frame_length:
frames[-1] = np.append(frames[-1], np.array([0]*(frame_length - len(frames[0]))))

Expand Down

0 comments on commit c090c74

Please sign in to comment.