Generate Signal In Python