Re: finding periodicity in a set

• To: mathgroup at smc.vnet.net
• Subject: [mg39283] Re: finding periodicity in a set
• From: Scott A Centoni <scentoni at stanford.edu>
• Date: Sun, 9 Feb 2003 04:50:32 -0500 (EST)
• References: <b1t5bj\$90v\$1@smc.vnet.net> <b1votq\$pk5\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```The following response from Mihajlo Vanevic has solved my problem, and I
thought it would be helpful to others as well:

>Ok, now I get it... ;o)
>
>But if you know that your error is, say, less than 0.01,
>try this dirty (but rather fast) approach:
>
>In[]:=
>xlist = 0.202 + 1.618 Table[0.001 Random[] + Random[Integer, {3, 17}],
{100}];
>
>In[]:=
>error = 0.01;
>
>In[]:=
>xxlist = First /@ Split[Sort[xlist], #2 - #1 < error &];
>
>In[]:=
>Fit[xxlist, {1, x, x^2}, x]
>
>Regards,
>         Mihajlo Vanevic
>         mvane at EUnet.yu
>         2003-02-07
>
>**************************************************************
>*    At 2003-02-07, 03:07:00
>*        Scott A Centoni, scentoni at stanford.edu  wrote:
>**************************************************************
>
>>Thanks for the responses!  (Particularly from Matt Flax.)  I see now
>>that my sample fake data set is misleading, I should have specified it
>>as
>>
>>xlist = 0.202 + 1.618 Table[0.001 Random[] +
>>Random[Integer,{3,17}],{100}]
>>
>>to make it crystal clear that no correlation between successive items in
>>the list is implied and that the order is completely irrelevant.
>>
>>Scott A Centoni wrote:
>>
>>>I have a list of coordinates where I want to find the period and offset
>>>(modulo the period).  To illustrate, let's create the fake data set
>>>
>>>xlist = 0.202+1.618(0.001 Random[ ] + Range[3, 17])
>>>
>>>I want a function that will return
>>>
>>>periodicity[xlist]
>>>
>>>{1.618,0.202}
>>>
>>>_pace_ an error in the third decimal place.  Note that the order of the
>>>data in the list is irrelevant; it's to be considered a set, not a
vector.
>>>
>>>My first thought is to turn this into a sum of delta functions
>>>
>>>xfunc = Plus@@(DiracDelta[x-#]&/@xlist)
>>>
>>>and then Fourier transform this
>>>
>>>kfunc = FourierTransform[xfunc,x,k]
>>>
>>>and find the first nontrivial peak.  Does someone have a better way?  Or
>>>if not, what's the "best" way of locating the peak?
>>>
>>>Thanks,
>>>Scott
>
>**************************************************************
>
>
>
>
>

```

• Prev by Date: Re: triangles
• Next by Date: Simplify[Abs[x],x<0]]
• Previous by thread: Re: finding periodicity in a set
• Next by thread: Re: Re: finding periodicity in a set