#!/usr/bin/perl -w

$pi = 3.1415926;
$dither = 0.0;

for ($i = 0; $i < 100; $i++) {
	$dither = rand(1) - 0.5;
	print($i."\t".(&round(sin(0.08 * $pi * $i) * 7.0 + $dither)/8.0)."\n");
}

sub round {
	my $x = shift;
	my $y = 0.5 + abs $x;
	my $abs = int $y;
	$abs -= $abs % 2 if $y == $abs;
	($x <=> 0) * $abs;
}
