Generates a pulse train