-
Notifications
You must be signed in to change notification settings - Fork 696
Add frequency_impulse_response #2879
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
Conversation
warnings.warn("The input frequency response should not contain negative values.") | ||
ir = torch.fft.fftshift(torch.fft.irfft(magnitudes), dim=-1) | ||
device, dtype = magnitudes.device, magnitudes.dtype | ||
window = torch.hann_window(ir.size(-1), periodic=False, device=device, dtype=dtype).expand_as(ir) |
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.
does it have to be a hann window specifically?
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.
No, this is no different than the standard approach of windowing. Other windows can be used. Hann window is the standard one.
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.
by standard approach, I mean smoothing the side effect of bound effects.
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.
got it. in that case, perhaps we can consider adding an argument similar to window_fn
for Spectrogram
that allows for customizing the window
@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hey @mthrok. |
This commit adds
frequency_impulse_response
function, which generates filter from desired frequency response.Example