Skip to content

Commit

Permalink
Merge pull request #101 from mcw519/master
Browse files Browse the repository at this point in the history
Fixed STFT.inverse() could not work correct under batch operations
  • Loading branch information
KinWaiCheuk authored Aug 6, 2021
2 parents 61e03b2 + 4938f44 commit ac9cd13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Installation/nnAudio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def uniform_distribution(r1,r2, *size, device):
def extend_fbins(X):
"""Extending the number of frequency bins from `n_fft//2+1` back to `n_fft` by
reversing all bins except DC and Nyquist and append it on top of existing spectrogram"""
X_upper = torch.flip(X[:,1:-1],(0,1))
X_upper = X[:,1:-1].flip(1)
X_upper[:,:,:,1] = -X_upper[:,:,:,1] # For the imaganinry part, it is an odd function
return torch.cat((X[:, :, :], X_upper), 1)

Expand Down Expand Up @@ -532,4 +532,4 @@ def early_downsample(sr, hop_length, n_octaves,

sr = new_sr

return sr, hop_length, downsample_factor
return sr, hop_length, downsample_factor

0 comments on commit ac9cd13

Please sign in to comment.