Skip to content

Commit

Permalink
update numpy pad signature
Browse files Browse the repository at this point in the history
numpy.lib.pad => numpy.pad
  • Loading branch information
DavidDoukhan committed Nov 8, 2024
1 parent 650f3ed commit 6f2c3da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inaSpeechSegmenter/sidekit_mfcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ def framing(sig, win_size, win_shift=1, context=(0, 0), pad='zeros'):
shape = (int((sig.shape[0] - win_size) / win_shift) + 1, 1, _win_size, sig.shape[1])
strides = tuple(map(lambda x: x * dsize, [win_shift * sig.shape[1], 1, sig.shape[1], 1]))
if pad == 'zeros':
return numpy.lib.stride_tricks.as_strided(numpy.lib.pad(sig, c, 'constant', constant_values=(0,)),
return numpy.lib.stride_tricks.as_strided(numpy.pad(sig, c, 'constant', constant_values=(0,)),
shape=shape,
strides=strides).squeeze()
elif pad == 'edge':
return numpy.lib.stride_tricks.as_strided(numpy.lib.pad(sig, c, 'edge'),
return numpy.lib.stride_tricks.as_strided(numpy.pad(sig, c, 'edge'),
shape=shape,
strides=strides).squeeze()

Expand Down

0 comments on commit 6f2c3da

Please sign in to comment.