Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed STFT.inverse() could not work correct under batch operations #101

Merged
merged 1 commit into from
Aug 6, 2021
Merged
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 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