-
Notifications
You must be signed in to change notification settings - Fork 113
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
N arg convolution #299
N arg convolution #299
Conversation
I have added an overlap-save algorithm to convolution, which is substantially faster (~2x) for large convolution problems. It is also substantially faster than other packages like ImageFiltering.jl. For smaller convolutions, it is about the same or a little bit slower than standard fft convolution. The cutoff between overlap-save and simple fft convolution is pretty arbitrary at the moment, so it would be nice to add some benchmarking to allow DSP.jl to choose between the two algorithms depending on the size of the input. It would also be nice to add spatial/time domain filtering for small convolutions, as it would almost certainly be faster than fft convolutions. This is relevant to JuliaDSP#224.
Not yet passing tests (several issues)
I have added an overlap-save algorithm to convolution, which is substantially faster (~2x) for large convolution problems. It is also substantially faster than other packages like ImageFiltering.jl. For smaller convolutions, it is about the same or a little bit slower than standard fft convolution. The cutoff between overlap-save and simple fft convolution is pretty arbitrary at the moment, so it would be nice to add some benchmarking to allow DSP.jl to choose between the two algorithms depending on the size of the input. It would also be nice to add spatial/time domain filtering for small convolutions, as it would almost certainly be faster than fft convolutions. This is relevant to JuliaDSP#224.
Running into problems with similar
With regards to type stability, output type depends only on input type so in principle conv(And by extension xcorr) is type-stable, but it seems that the compiler can't infer this. How do I ensure the compiler recognizes this? |
It's hard for me to follow what changes you've made to the overlap save branch, because you're merging against master. Is there any way you could rebase your commits on top of my branch so that it's easier to see what's changed? |
I'm just sort of browsing through your commits, so I don't know if I have an accurate read on what you've changed. However, if I understand correctly you've changed |
On this repository, not until it's merged I think, but I can make a PR into overlap-save on your fork, and we can bring the discussion back here later. |
ah ok, nb is supposed to be the maximum, is nx supposed to be the minimum? |
The names of the parameters comes from this function's use in |
on to the next issue...
I'll try to take a look at this soon. |
Thanks Galen. I think I've figured out what was currently causing errors, however for 3 test cases 'naively' performing convolution over all the arguments is significantly faster than this implementation, (one of which is all int, so I think I was wrong earlier about it being due to type differences). |
Basing off your branch (and probably those merges I did earlier) has made rebasing a big mess. I'm trying to resolve it by cherry-picking commits onto a new branch - but that's going wrong pretty spectacularly. I think I may just need to manually move all my changes onto a new branch based on overlap-save, which probably means abandoning this PR. |
As I suspected I needed to manually move my changes onto a new branch, closing this and making a new PR |
Sorry... |
Haha, not your fault |
Adresses #224
This PR builds on @galenlynch 's overlap-save branch, so naturally, wait for merging until that is done.
And of course also until I've fixed those tests