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

ISTFT #130

Closed
wants to merge 27 commits into from
Closed

ISTFT #130

wants to merge 27 commits into from

Conversation

jamarshon
Copy link
Contributor

Inverse STFT

@jamarshon jamarshon changed the title [WIP] ISTFT ISTFT Jul 3, 2019
Copy link
Contributor

@vincentqb vincentqb left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! Do you have a reference besides [1] that presents the implementation done here?

torchaudio/functional.py Show resolved Hide resolved
torchaudio/functional.py Outdated Show resolved Hide resolved
test/test_functional.py Outdated Show resolved Hide resolved
@jamarshon
Copy link
Contributor Author

@vincentqb I think that [1] is sufficient to describe the overlap add method

@vincentqb
Copy link
Contributor

vincentqb commented Jul 5, 2019

@jamarshon Thanks for specifying the default values in the header of the function.

For acceptance, we need to validate correctness by documenting and testing enough to confirm the pull request is indeed correct. Evidences make the approval process faster.

For documentation, we need to provide references for the details of the implementation provided. For example, beside [Griffin and Lim], did you base your implementation on scipy's? The description of the pull request needs to offer enough context to understand the evidences provided: see for instance the new issue tab for pytorch. For instance, there are other issues or pull requests that are relevant, say #27 and #3775.

For testing,

  1. we need to show important properties are fulfilled: for example, the composition of ISTFT and STFT (and of STFT and ISTFT) is the identity under appropriate conditions,
  2. the algorithm is correct for a known analytical solution,
  3. the algorithm matches the result of an outside implementation.

If for example scipy's implementation was used as a reference, it could be mentioned here along with a notebook showing that the two results are the same, see for instance #21250.

(For reference, here are general acceptance criteria here.)

test/test_functional.py Outdated Show resolved Hide resolved
test/test_functional.py Outdated Show resolved Hide resolved
test/test_functional.py Outdated Show resolved Hide resolved
torchaudio/functional.py Outdated Show resolved Hide resolved
@jamarshon
Copy link
Contributor Author

jamarshon commented Jul 5, 2019

for reference, stft tests are being added for #131

Implementation inspired by https://github.com/seungwonpark/istft-pytorch/blob/master/istft_deconv.py

test/test_functional.py Outdated Show resolved Hide resolved
test/test_functional.py Outdated Show resolved Hide resolved
test/test_functional.py Outdated Show resolved Hide resolved
@vincentqb
Copy link
Contributor

Let's use sines as analytical solution. Could you try the following analytical solution? Take f(t) = sin(2*pi*n*t/L) where L is the window length and hop. The result should be a band at frequency 2*pi*n/L.

test/test_functional.py Outdated Show resolved Hide resolved
test/test_functional.py Outdated Show resolved Hide resolved
test/test_transforms.py Outdated Show resolved Hide resolved
test/test_functional.py Outdated Show resolved Hide resolved
test/test_functional.py Outdated Show resolved Hide resolved
Copy link
Contributor

@vincentqb vincentqb left a comment

Choose a reason for hiding this comment

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

Based on the testing we have done, the PR looks good to me. Thanks for working on this!

test/test_transforms.py Outdated Show resolved Hide resolved
@jamarshon jamarshon closed this Jul 10, 2019
This was referenced Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants