Skip to content

binary-com/perl-feed-phasecheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Feed::PhaseCheck

Build Status codecov

Module that finds the relative time delay between two feed segments.

Accomplished by shifting one feed relative to the other and then computing the error (absolute difference).

The shift that yields the lowest error corresponds to the relative delay between he two input feeds.

The output consists of the delay found, and the error in delayed point.

Module has only one function compare_feeds.

Usage:

use Feed::PhaseCheck qw(compare_feeds);
my $sample = {
    "1451276654" => "1.097655",
    "1451276655" => "1.09765",
    ...
    "1451276763" => "1.0976",
    "1451276764" => "1.097595"
};
my $compare_to = {
    "1451276629" => "1.09765",
    "1451276630" => "1.09764916666667",
    ...
    "1451276791" => "1.097595",
    "1451276792" => "1.097595"
}
my $max_delay_check = 30;    # seconds
my ($errors,$delay_with_min_err) = compare_feeds($sample,$compare_to,$max_delay_check);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published