Comments (4)
The implementation from julius is now part of Torchaudio: pytorch/audio#1087 :)
from julius.
First this project is a DSP hobby, so I'm quite happy to reimplement things that already exists.
From your question I decided to run a quick comparison. First in terms of speed, torchaudio seems to be slower, at least on CPU. I guess it is because it does multiple calls to conv1d
followed conv_transpose1d
, while julius has a single call to conv1d
. I will open up a bug report to torchaudio on that issue.
from torchaudio.compliance import kaldi
import torch
import julius
x = th.randn(1, 44100 * 10)
rolloff = 0.99 # lowpass filter freq used by torchaudio
zeros = 6 # use the same number of zero crossing as torchaudio
for from_sr, to_sr in [(5, 7), (7, 5)]:
print("comparing for", from_sr, to_sr)
%timeit kaldi.resample_waveform(x, from_sr, to_sr)
%timeit julius.resample_frac(x, from_sr, to_sr, rolloff=rolloff, zeros=zeros)
yt = kaldi.resample_waveform(x, from_sr, to_sr)
yj = julius.resample_frac(x, from_sr, to_sr, rolloff=rolloff, zeros=zeros)
print(torch.norm(yt - yj))
comparing for 5 7
32.4 ms ± 309 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
4.46 ms ± 44.9 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
tensor(8.7085e-05)
comparing for 7 5
12.9 ms ± 323 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
2.83 ms ± 43.9 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
tensor(5.1333e-05)
Julius implementation is also shorter in terms of code.
from julius.
Bug report opened pytorch/audio#1057
from julius.
Great, I agree that we can learn a lot to re-implement something, and it would be even better as share your idea to benefit the whole community. Thank you.
from julius.
Related Issues (11)
- Comparison HOT 5
- Time spent on repeated kernel construction HOT 2
- split_bands doesn't print in IPython notebook with a numpy array in cutoffs HOT 2
- Question about the window function HOT 3
- Add convenience function for high pass filter HOT 6
- Allow specifying expected output length when resampling HOT 5
- Bandpass filter HOT 3
- cuFFT error: CUFFT_EXEC_FAILED HOT 2
- Pytorch version HOT 2
- More memory efficient implementation / improvements on julius for > 100K sequence length? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julius.