Return the values of the pulse sampled at a constant rate given by the
sampling rate provided.
If the inverse of the sampling rate passed doesn’t exactly divide the
total duration of the pulse, this function will round the number of
segments of the discretized output to the nearest number that is an
integer multiple of the inverse of the sampling rate.