X-Git-Url: https://git.realraum.at/?p=svn42.git;a=blobdiff_plain;f=rf433rcv%2Fpc%2Fdecode.pl;fp=rf433rcv%2Fpc%2Fdecode.pl;h=0000000000000000000000000000000000000000;hp=f9aeb3204fad992aa5595e74d52cd8f8fa377e13;hb=fff7d88ae580a68519a3b9f590a2cf9cce21ef8b;hpb=5b00dab1a7d2ac2d8a593f0bd6e85a7194e2c9bd diff --git a/rf433rcv/pc/decode.pl b/rf433rcv/pc/decode.pl deleted file mode 100755 index f9aeb32..0000000 --- a/rf433rcv/pc/decode.pl +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/perl -use strict; -my @data = split //,<>; - -my @statistics; - -my $start = $data[0]; -my $current = $start; -my @lengths; -my $count=0; -for my $input (@data) -{ - $count++; - if ($input != $current) - { - push @lengths,[$current,$count]; - $statistics[$current]{$count}++; - $count=0; - $current=$input; - } -} - -for my $i (0..1) -{ - print STDERR "$i:\n"; - my $stat = $statistics[$i]; - for my $key (sort {$a <=> $b} keys %$stat) - { - if ($stat->{$key+1}) - { - if ($stat->{$key+1}>$stat->{$key}) - { - $stat->{$key+1}+=$stat->{$key}; - delete $stat->{$key}; - } else { - $stat->{$key}+=$stat->{$key+1}; - delete $stat->{$key+1}; - } - } - print STDERR "$key $stat->{$key}\n"; - } -} -my $seq; -if (defined $ARGV[0]) -{ - my ($state)=$ARGV[0]; - my ($time) = reverse sort {$a <=> $b} keys %{$statistics[$state]} ; - my $start = 0; - my $counter=0; - for my $data (@lengths) - { - if ($data->[0]==$state && $data->[1]==$time) - { - if ($start) - { - print $counter-2,"\n"; - last; - } else { - $start =1; - print $counter-1," "; - } - } - $counter+=$data->[1]; - } -} -