I haven't tested it at all, but this is Val's algorithm in matlab, just because it's easier to experiment with things in matlab (compare the codes and you'll see what I mean :) ). --Zeracles 21:53, 12 June 2008 (CEST)