top.pl: improve signal processing code.