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

Home » Public Forums » archive » Re: Approximate convolution - for loop problem
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: Approximate convolution - for loop problem [message #64402 is a reply to message #64381] Mon, 22 December 2008 01:31 Go to previous messageGo to previous message
Wout De Nolf is currently offline  Wout De Nolf
Messages: 194
Registered: October 2008
Senior Member
On Sun, 21 Dec 2008 09:32:40 -0800 (PST), samuel.leach@gmail.com
wrote:


> nsamp=n_elements(signal)
> const1 = exp(-tsamp/taubolo)
> const2 = 1.-const1
>
> bolo_signal = const2*signal
> for ii= 1L,nsamp-1L do begin
> bolo_signal[ii] += const1*bolo_signal[ii-1]
> endfor
>
> where tsamp and taubolo are scalars. Is there any way to avoid the for
> loop in this case? The hope is to speed up the execution.

This is without loop. Not sure it's faster though.

a=[1.,2.,3.,4.]
c=0.5
n=n_elements(a)

a=reform([reform(rebin([a,0],n+1,n-1,/sample),n*n-1),a[0]],n ,n)
i=REBIN(LINDGEN(n), n, n)
j=REBIN(TRANSPOSE(LINDGEN(n)), n, n)
a*= i ge j

c=rebin(c^reverse(indgen(n)),n,n,/sample)
a=reverse(total(a*c,1))
print,a
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Sun symbol (again!)
Next Topic: Re: Problem reading data from stdin using EOF(0) in version 6.0 and 7.0

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

Current Time: Thu Oct 09 07:19:57 PDT 2025

Total time taken to generate the page: 0.16010 seconds