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

Home » Public Forums » archive » Re: Lag and A_Correlate/C_Correlate
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Lag and A_Correlate/C_Correlate [message #67136] Mon, 06 July 2009 18:00
Max is currently offline  Max
Messages: 2
Registered: July 2009
Junior Member
On Jul 7, 1:51 am, Gianguido <gianguido.cia...@gmail.com> wrote:
>> We would both be very grateful if someone could help clear up these
>> questions: firstly, what does lag measure? Secondly, how does the lag
>> parameter affect the output of the A_CORRELATE and C_CORRELATE
>> functions? Thirdly, what can my friend do to get this to work?
>
> 1) lag is an input not an output. so i am not sure what you mean by
> what does it measure.
> A different way to think of lag is "shift". then these routines
> calculate how "similar" the arrays are if you shift them by 'lag'.
>
> 2) this depends entirely on the input array.
>
> 3) give us more info on the problem she's trying to solve.
>
>
>
>> One idea I've had from searching the internet include creating an
>> array of size n (perhaps F=findgen(n), where n≈90,000) and trying
>> C_CORRELATE with something like "lag = [-F, F]". Is this at least on
>> the right track?
>
> findgen won't give you very interesting results. I would create:
>
> x=findgen(1000)/25.
> g1=exp(-(x-10)^2)
> g2=exp(-(x-30)^2)
>
> plot, x, g1
> oplot, x, g2;as you can see these curves would match perfectly if they
> were *shifted* by 20!
>
> lag=indgen(1000)
>
> cor=c_correlate(g1,g2,lag,/double)
>
> plot, lag/25., cor
> ;this plot shows that g1 and g2 are most correlated if you indeed
> shift them by 20!
>
> Hope this helps.
>
> Ciao,
> G

Thanks very much. Again, sorry I couldn't be more useful in my
description. I've forwarded my friend the link to this thread, so she
should be on eventually to provide some more details to anyone
interested in tackling this. If she isn't, I appreciate your taking
time out to help with such a basic question. If she does come on to
post...hi Catie!
Re: Lag and A_Correlate/C_Correlate [message #67137 is a reply to message #67136] Mon, 06 July 2009 16:51 Go to previous message
cgguido is currently offline  cgguido
Messages: 195
Registered: August 2005
Senior Member
> We would both be very grateful if someone could help clear up these
> questions: firstly, what does lag measure? Secondly, how does the lag
> parameter affect the output of the A_CORRELATE and C_CORRELATE
> functions? Thirdly, what can my friend do to get this to work?

1) lag is an input not an output. so i am not sure what you mean by
what does it measure.
A different way to think of lag is "shift". then these routines
calculate how "similar" the arrays are if you shift them by 'lag'.

2) this depends entirely on the input array.

3) give us more info on the problem she's trying to solve.



>
> One idea I've had from searching the internet include creating an
> array of size n (perhaps F=findgen(n), where n≈90,000) and trying
> C_CORRELATE with something like "lag = [-F, F]". Is this at least on
> the right track?
>

findgen won't give you very interesting results. I would create:

x=findgen(1000)/25.
g1=exp(-(x-10)^2)
g2=exp(-(x-30)^2)

plot, x, g1
oplot, x, g2;as you can see these curves would match perfectly if they
were *shifted* by 20!

lag=indgen(1000)


cor=c_correlate(g1,g2,lag,/double)

plot, lag/25., cor
;this plot shows that g1 and g2 are most correlated if you indeed
shift them by 20!

Hope this helps.

Ciao,
G
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Lag and A_Correlate/C_Correlate
Next Topic: nike clothing,nike shoes,online store,http://www.maidi2008.net air Jordan Shoes,Nike Air Jordans, Air Force Ones,Retro Air Jordan, Bape Hoodies,Bape shoes-Tencent Traveler|Jordan Shoes,Nike Air Jordans, Air Force Ones,Retro Air Jordan, Bape Hood

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

Current Time: Wed Oct 08 11:53:39 PDT 2025

Total time taken to generate the page: 0.00675 seconds