-
Notifications
You must be signed in to change notification settings - Fork 423
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
_reorder_sources() in OLA compares scaled/windowed frame with un-scaled/un-windowed frame #688
Conversation
…he way it had been coded, the previous frame might have been scaled or windowed already. But to get best results, we probably want to compare to an unscaled, un-windowed version.
Hey, Look at the diff, because you changed other things (formating), the diff is much less clear. Can you change only the functional part of the code you intend to change please ? |
Looked at the diff—I don't think I have changed the formatting. 🤷♂️ |
if self.use_window: | ||
frame = frame * self.window.to(frame) | ||
frame *= self.window.to(frame) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a functional change, only cosmetic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am not mistaken, *=
acts in-place, so the frame
tensor itself gets modified, meaning that the frame
in the out
list is also modified.
frame = frame * self.window.to(frame)
would not accomplish this, would it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I misread the logic at first, thanks.
else: | ||
frame = frame / (self.window_size / self.hop_size) | ||
out.append(frame) | ||
frame /= self.window_size / self.hop_size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This too right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
You are right, it was functional because of the inplace modification I didn't get. Merging. |
Hey there,
_reorder_sources()
is called with the current and the previous frames as arguments. The way it had been coded, the previous frame might have been scaled or windowed already. But to get best results, we probably want to compare to an unscaled, un-windowed version. That's what this change fixes.Cheers.