Photon echo under excitation of a medium by pulses consisting of an arbitrary number of oscillations