fix SignalGenerator bug in python 3k