I need to generate a pulse train where the time duration of the pulse td<<T the period of the pulse. Ideally I would like to use something analogous to the SquareWave function. The problem with SquareWave is that it is a square wave and by definition has 50% duty cycle. I can construct a couple of pulses using combination of UnitStep functions, but for a string of many pulses, it is an awkward approach.
See here:
Edit:
I have a solution of myself:
Sum[UnitBox[k (x - T j)], {j, -10, 10}]
UnitBox gives a top hat centered at 0, width 1. The k makes it with a shorter width. The T is the periodicity.
When k=1/T, you get a straight line.
And when k<1/T you get a different thing than the one you asked for.
But if k>1/T, you get this pulse train.
You can also add a phase, to make the function start where you want:
Sum[UnitBox[k (x - T j+phi)], {j, -10, 10}]
With a phi that runs from 0 to T.
Change the values for j to get the number of pulses. Number of pulses=2j+1.
I hope it helps!