It's interesting that calculating the FFT and then the IFFT is more accurate; I wasn't aware of that. Thanks!
-- mb On Tue, Mar 4, 2014 at 10:51 AM, Tobias Knopp <[email protected]>wrote: > This depends a lot on the input sizes. For full length convolutions, the > fft approach should be more accurate because of less additions. For very > short kernels this does not hold anymore. But in practice these kinds of > errors are mostly negligable. > > > Am Dienstag, 4. März 2014 16:42:33 UTC+1 schrieb Miguel Bazdresch: >> >> I was worried about getting "a little noise in the result", so I ran a >> quick test in Matlab and Julia, and got almost exactly the same error. This >> is the Matlab code: >> >> Ts=0.01; >> t=-10:Ts:10; >> s=sinc(t); >> sc=Ts*conv(s,s); >> sc=sc(1000:3000); >> sum((sc-s).*(sc-s)) >> >> ans = >> >> 0.3695 >> >> So, at least for accuracy, julia's conv implementation seems to be no >> worse than Matlab's. >> >> >> On Tue, Mar 4, 2014 at 7:19 AM, Toivo Henningsson <[email protected]>wrote: >> >>> Yes, with sufficient padding, you can compute a linear convolution (of >>> finite length vectors) exactly using a circular convolution. The FFT might >>> introduce a little noise in the result, but that is all. >>> >>> >>> On Tuesday, 4 March 2014 13:12:48 UTC+1, Oliver Lylloff wrote: >>>> >>>> Well ok, >>>> >>>> Maybe I misunderstood the whole thing then but since fft assumes >>>> periodic input then I don't see how it can be a linear convolution. I guess >>>> Base.conv2 probably uses zero-padding to reduce wrap-around but in theory >>>> it would still be a circular convolution. I'll read up on it :) >>>> >>>> Best, >>>> Oliver >>>> >>>> Den tirsdag den 4. marts 2014 13.07.20 UTC+1 skrev Andreas Noack >>>> Jensen: >>>>> >>>>> Both conv and conv2 are linear convolutions but the implementations >>>>> use the fft. Maybe the documentation could be more clear on that. >>>>> >>>>> >>>>> 2014-03-04 13:01 GMT+01:00 Oliver Lylloff <[email protected]>: >>>>> >>>>>> Thanks Tim. >>>>>> >>>>>> Can't believe I missed that - been working with Images.jl all day. >>>>>> Nice job by the way, very useful. >>>>>> >>>>>> Best, >>>>>> Oliver >>>>>> >>>>>> Den tirsdag den 4. marts 2014 12.48.01 UTC+1 skrev Tim Holy: >>>>>> >>>>>>> Images.jl's imfilter might be what you want. >>>>>>> --Tim >>>>>>> >>>>>>> On Tuesday, March 04, 2014 03:38:15 AM Oliver Lylloff wrote: >>>>>>> > Hello all, >>>>>>> > >>>>>>> > Is anyone aware of a linear convolution implementation? >>>>>>> > The Base.conv and Base.conv2 functions are implemented with fft >>>>>>> which makes >>>>>>> > them circular convolution functions (as far as I know). >>>>>>> > >>>>>>> > I'm looking for something alike Matlabs conv2 or SciPys >>>>>>> signal.convolve2d. >>>>>>> > >>>>>>> > Should be straightforward to implement though. >>>>>>> > >>>>>>> > Best, >>>>>>> > Oliver >>>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Med venlig hilsen >>>>> >>>>> Andreas Noack Jensen >>>>> >>>> >>
