MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: maximize crosscorrelation

  • To: mathgroup at
  • Subject: [mg125407] Re: maximize crosscorrelation
  • From: alexxx <alexxx.magni at>
  • Date: Tue, 13 Mar 2012 03:00:57 -0500 (EST)
  • Delivered-to:
  • References: <jjhq5j$ivq$>

On 11 Mar, 10:10, Bill Rowe <readn... at> wrote:
> On 3/10/12 at 6:16 AM, at (alexxx) wrote:
> >I have two similar signals s1 and s2, where one is shifted with
> >respect to the other by an unknown amount. These signals are
> >captured by an oscilloscope, so you can represent them as arrays of
> >{t,v} time and voltage values.
> >I always knew that the theory says in such cases you have to
> >maximize the selfcorrelation between the two signals, but I never
> >used it until now.
> >(BTW I was surprised to find that Mathematica had it as a standalone
> >function, but doesnt provide it anymore)
> >Anyway, 1st thing since crosscorr requires integration I defined the
> >interpolation functions f1= Interpolation[v1];  f2=
> >Interpolation[v2];
> For discrete data the function you want is ListCorrelate. For example,
> First generate a "signal" and the same signal with an offset:
> x = RandomReal[1, {20}];
> y = RotateLeft[x, 5];
> Now find the offset by:
> In[12]:= Ordering[
>   Flatten@Table[ListCorrelate[RotateLeft[x, n], y], {n, 20}], -1]
> Out[12]= {5}

works perfectly, thanks a lot!


  • Prev by Date: Re: pole/zero plot for TransferFunctionModel in the control system package?
  • Next by Date: Re: Non linear model fitting with an integral model
  • Previous by thread: Re: maximize crosscorrelation
  • Next by thread: Textures with AlphaChannel not working on OS X system