Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions allosaurus/pm/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def framesig(sig, frame_len, frame_step, dither=1.0, preemph=0.97, remove_dc_off
# check kaldi/src/feat/feature-window.h
# the last frame_len-1 points might be cutoff
padsignal = sig[:(numframes - 1) * frame_step + frame_len]
if wintype is 'povey':
if wintype == 'povey':
win = np.empty(frame_len)
for i in range(frame_len):
win[i] = (0.5 - 0.5 * np.cos(2 * np.pi / (frame_len - 1) * i)) ** 0.85
Expand Down Expand Up @@ -163,4 +163,4 @@ def do_preemphasis(signal, coeff=0.97):
:param coeff: The preemphasis coefficient. 0 is no filter, default is 0.95.
:returns: the filtered signal.
"""
return np.append((1 - coeff) * signal[0], signal[1:] - coeff * signal[:-1])
return np.append((1 - coeff) * signal[0], signal[1:] - coeff * signal[:-1])