using a variable number of pulses in a train