#!/usr/bin/perl # Given some frequencies (in MHz) for your scanner radio, # what steps they are on, or between? # Usage example: validstep 216.047 [451.045 ...] # Copyright : http://www.fsf.org/copyleft/gpl.html # Author : Dan Jacobson -- http://jidanni.org/ # Created On : Fri May 2 02:43:01 2003 # Last Modified On: Mon Mar 31 06:50:41 2008 # Update Count : 263 use strict; use warnings FATAL => 'all'; use constant S => 10000000; for my $freq (@ARGV) { print "\n-- $freq:\n"; $freq *= S; for ( 1000000, 500000, 300000, 250000, 200000, 150000, 125000, 100000, 90000, 1000000 / 12, 62500, 50000 ) { printf "%.5f:", $_ / S; my $mod = $freq % $_; unless ($mod) { print "exact\n"; next; } my $ratio = int( $freq / $_ ); printf "%.5f%-10s%.5f\n", $ratio * $_ / S, ##Dots to show the distance between the two edges: "." x ( sprintf "%.0f", 10 * $mod / $_ ), ( $ratio + 1 ) * $_ / S; } }