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

nara_wpe based WPE dereverberation as data augmentation #663

Merged
merged 5 commits into from
Apr 10, 2022

Conversation

pzelasko
Copy link
Collaborator

I added WPE using nara_wpe (optional dependency) as a torch.nn.Module DereverbWPE. I was able to verify by listening to the outputs that it appears to work correctly (although the audible differences are very slight, at least for single-channel data).

It also moves AudioTransform to a different file without any changes. Ultimately I didn't add a complementary cut.dereverb_wpe() API, but it should be straightforward to do by following other data aug examples (e.g. perturb_speed, reverb_rir) if somebody needs it.

@pzelasko pzelasko merged commit 8968fbe into master Apr 10, 2022
@boeddeker
Copy link

In fgnt/nara_wpe#72 TeaPoly proposed to stabilize WPE by using the same idea as the numpy version to stabilize the code. This is not possible, because torch works differently (The async execution on the GPU doesn't allow that.)

In General, I recommend using the numpy version of WPE, since it is way better tested, and I found some situations, where numpy has a better numerical stability.

In lhotse, I found

    def __call__(self, samples: np.ndarray, *args, **kwargs) -> np.ndarray:
        if isinstance(samples, np.ndarray):
            samples = torch.from_numpy(samples)
        augmented = dereverb_wpe_torch(samples, **asdict(self))
        return augmented.numpy()

I personally would change it to the numpy implementation. Since the code doesn't use the GPU, it shouldn't have a relevant impact on the runtime.

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.

2 participants