-
Notifications
You must be signed in to change notification settings - Fork 89
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
Implement resample transform #37
Comments
There's also torchaudio's resample, should we should between both? |
I'm not so fond of torchaudio's resample function, because it seems to be much slower than julius. Here's the result of a crude benchmark that resamples some audio from 44100 hz to 48000 hz on CPU:
|
Ok, it's pretty clear that Julius is better, let's stick with it ! |
What other sample rate conversions did you try? Did you compile the Resample transform with torch.jit.script? |
In my crude benchmark, I ran it simply like this:
I didn't try other sample rate conversions |
I've got a notebook to benchmark different methods of resampling. There are some conversions that take longer, I think, due to there being a gcd between input and output sample rates. It would be good to add julius to that list and compare results when resampling is done in batches. https://gist.github.com/mogwai/a5df03e89ab33bc0a5648965280d5445 In your benchmark you for example load in and out of numpy which can take time. |
Yes, that would be interesting. Re numpy: Yes, but I did the numpy conversion in the julius benchmark as well. Pytorch tensors share memory with numpy arrays when running on CPU, so the "conversion" should be quite fast. |
I've added julius to the benchmark notebook. Seems that it does produce higher quality and does so faster most of the time. I did notice that it didn't output the same length of samples as was input to it so had to add a minor hack to solve that. https://gist.github.com/mogwai/a5df03e89ab33bc0a5648965280d5445 |
Yes, I've been using fix_length from librosa to solve the length issue. ( |
https://github.com/adefossez/julius
The text was updated successfully, but these errors were encountered: