Don't ask to ask, just ask | |
PerlMonks |
Re: Calculating cross-correlationby mykl (Monk) |
on Nov 25, 2010 at 12:32 UTC ( [id://873632]=note: print w/replies, xml ) | Need Help?? |
If you can't find a module that does cross-correlation, you can always use one of the many FFT implementations - in pseudo-code:
This makes use of the fourth of the properties listed here. If your input arrays are purely real, I think it may be possible to optimise this further by performing their FFTs in a single FFT calculation, with a bit of clever maths. I did calculation of a cross-correlation using this method some years ago, but it wasn't in Perl, unfortunately. -- "Any sufficiently analyzed magic is indistinguishable from science" - Agatha Heterodyne
In Section
Seekers of Perl Wisdom
|
|