comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Convolving speed issue
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Convolving speed issue [message #59838 is a reply to message #59837] Thu, 17 April 2008 13:03 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
Again, I don't know for sure what Matlab does,
but the following gives the convolution of a * b

s1=size(a)
s2=size(b)
nx1=s1[1]
ny1=s1[2]
nx2=s2[1]
ny2=s2[2]

aa=fltarr(nx1+nx2-1,ny1+ny2-1)
bb=fltarr(nx1+nx2-1,ny1+ny2-1)
aa[0,0]=a
bb[nx1-1,ny1-1]=b

conv=double(shift(fft(fft(aa,-1)*fft(bb,-1),
1)*n_elements(aa),nx2,ny2))
;use double because real_part seem to be broken on my system for some
reaon...

Ciao,
Paolo

rog...@googlemail.com wrote:
> Yes, you're right. But I have to produce the same results Matlab
> produces with conv2. The Implementation of convolving matrices in the
> frequency domain is unfortunately also different. I tried this before
> - for small and also for large matrices.
>
> I can't understand, why there should not be another possibility within
> IDL to compute simple c[n1,n2]=sum(sum(a[k1,k1]*b[n1-k1,n1-k1]))? Any
> other ideas?
>
> Nevertheless, thanks Paolo for the hint.
>
> Best regards
>
> Chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Passing strings by Spawn
Next Topic: Re: Problem with histogram calculation - please need help

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 13:23:28 PDT 2025

Total time taken to generate the page: 2.48014 seconds