-
Notifications
You must be signed in to change notification settings - Fork 696
Add filter_waveform #2928
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
Add filter_waveform #2928
Conversation
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.
left a couple comments, there are also a couple of lint errors
print("mix:", mix) | ||
print("ref1:", ref1) | ||
print("ref2:", ref2) |
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.
remove print statements
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.
Why? It is useful to have the print statements when test fails.
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.
I see, I thought it was accidentally leftover from debugging. Can we print only if it's failing to avoid extra print clutter and make it more clear the function that is being tested in the print? Otherwise if we start adding generic print/debug statements in tests it can lead to extra clutter.
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.
We use pytest
as runner, and it by default captures and hides the stdout/stderr. So it's shown only when told so or failed.
self.assertEqual(mix[:10], ref1[:10]) | ||
# The second filter is effective in the second half | ||
self.assertEqual(mix[-9:], ref2[-9:]) | ||
# the middle portion is where the two filters affect |
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.
is this missing another assert for the middle portion?
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, the middle portion is mixture of two so we can't assert.
Co-authored-by: Caroline Chen <carolinechen@fb.com>
@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1 similar comment
@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hey @mthrok. |
This commit adds "filter_waveform" prototype function.
This function can apply non-stationary filters across the time.
It also performs cropping at the end to compensate the delay introduced by filtering.
The figure bellow illustrates this.
See subtractive_synthesis_tutorial for example usages.