NAME
Math::PhaseOnlyCorrelation - calculate the phase only correlation
VERSION
This document describes Math::PhaseOnlyCorrelation version 0.06
SYNOPSIS
use Math::PhaseOnlyCorrelation qw/poc/;
my $array1 = [1, 2, 3, 4, 5, 6, 7, 8];
my $array2 = [1, 2, 3, 4, 5, 6, 7, 8];
my $coeff = poc($array1, $array2);
Or if you want to use own FFT function, you may use like so:
use Math::FFT;
use List::MoreUtils qw/mesh/;
use Math::PhaseOnlyCorrelation qw/poc_without_fft/;
my @array1 = (1, 2, 3, 4, 5, 6, 7, 8);
my @array2 = (1, 2, 3, 4, 5, 6, 7, 8);
my @zero_array = (0, 0, 0, 0, 0, 0, 0, 0); # <= imaginary components
@array1 = mesh(@array1, @zero_array);
@array2 = mesh(@array2, @zero_array);
my $array1_fft = Math::FFT->new(\@array1);
my $array2_fft = Math::FFT->new(\@array2);
my $result = poc_without_fft($array1_fft->cdft(), $array2_fft->cdft());
my $ifft = Math::FFT->new($result);
my $coeff = $ifft->invcdft($result);
DESCRIPTION
This module calculate Phase Only Correlation coefficients. This measures degree of similarity between two waves (signals) heed to only phase component,
so this method is not affected by an amplitude difference.
The more similar two signals (waves), coefficient will approximates 1.0. In the opposite case, coefficient will approaches zero.
METHODS
- poc
-
Calculate phase only correlation with FFT (This function is using Math::FFT).
This function needs two arguments. Both of arguments are array reference. Array reference just has real part (don't need imaginary part).
- poc_without_fft
-
Calculate phase only correlation without FFT.
This function needs two arguments. Both of arguments are array reference, these reference must be processed by FFT.
CONFIGURATION AND ENVIRONMENT
Math::PhaseOnlyCorrelation requires no configuration files or environment variables.
DEPENDENCIES
Math::FFT (Version 1.28 or later)
List::MoreUtils (Version 0.33 or later)
Test::Most (Version 0.31 or later)
INCOMPATIBILITIES
None reported.
BUGS AND LIMITATIONS
No bugs have been reported.
Please report any bugs or feature requests to bug-math-phaseonlycorrelation@rt.cpan.org
, or through the web interface at http://rt.cpan.org.
AUTHOR
moznion <moznion@gmail.com>
LICENCE AND COPYRIGHT
Copyright (c) 2012, moznion <moznion@gmail.com>
. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.