Skip to content

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

Closed
wants to merge 6 commits into from
Closed

Add filter_waveform #2928

wants to merge 6 commits into from

Conversation

mthrok
Copy link
Collaborator

@mthrok mthrok commented Dec 17, 2022

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.

figure

@mthrok mthrok marked this pull request as ready for review December 21, 2022 18:26
@mthrok mthrok requested review from carolineechen and a team December 21, 2022 18:26
Copy link
Contributor

@carolineechen carolineechen left a 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

Comment on lines +584 to +586
print("mix:", mix)
print("ref1:", ref1)
print("ref2:", ref2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove print statements

Copy link
Collaborator Author

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.

Copy link
Contributor

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.

Copy link
Collaborator Author

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
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

mthrok and others added 2 commits December 21, 2022 17:12
Co-authored-by: Caroline Chen <carolinechen@fb.com>
@facebook-github-bot
Copy link
Contributor

@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@mthrok merged this pull request in 69e8dbb.

@github-actions
Copy link

Hey @mthrok.
You merged this PR, but labels were not properly added. Please add a primary and secondary label (See https://github.com/pytorch/audio/blob/main/.github/process_commit.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants