Skip to content

Commit

Permalink
Merge pull request #66 from bmcfee/complex-stft
Browse files Browse the repository at this point in the history
fixed warning in stft methods for complex types
  • Loading branch information
bmcfee committed May 3, 2017
2 parents 4a2693e + 1cf5b07 commit 036fb28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pumpp/feature/fft.py
Expand Up @@ -68,16 +68,16 @@ def transform_audio(self, y):
n_frames = self.n_frames(get_duration(y=y, sr=self.sr))

D = stft(y, hop_length=self.hop_length,
n_fft=self.n_fft, dtype=np.float32)
n_fft=self.n_fft)

D = fix_length(D, n_frames)

mag, phase = magphase(D)
if self.log:
mag = amplitude_to_db(mag, ref=np.max)

return {'mag': mag.T[self.idx],
'phase': np.angle(phase.T)[self.idx]}
return {'mag': mag.T[self.idx].astype(np.float32),
'phase': np.angle(phase.T)[self.idx].astype(np.float32)}


class STFTPhaseDiff(STFT):
Expand Down

0 comments on commit 036fb28

Please sign in to comment.