  The generalized Klein-Nishina formula for Compton scattering of charged
particles by a finite train of pulses is derived in the framework of quantum
electrodynamics. The formula also applies to classical Thomson scattering
provided that frequencies of generated radiation are smaller that the cut-off
frequency. The validity of the formula for incident pulses of different
durations is illustrated by numerical examples. The positions of the
well-resolved Compton peaks, with the clear labeling by integer orders, opens
up the possibility of the precise diagnostics of properties of relativistically
intense, short laser pulses. This includes their peak intensity, the
carrier-envelope phase, and their polarization properties.
