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 #64381] Mon, 22 December 2008 14:19 Go to previous message
Sam is currently offline  Sam
Messages: 4
Registered: March 1999
Junior Member
It seems more memory demanding and I can not allocate the memory for
it.
Well, thank you for the suggestions. Best Regards, Sam.


On Dec 22, 10:31 am, Wox <s...@nomail.com> wrote:
> On Sun, 21 Dec 2008 09:32:40 -0800 (PST), samuel.le...@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: Wed Oct 08 16:06:30 PDT 2025

Total time taken to generate the page: 0.00442 seconds