Pulse function for control of the coherent excitation in stimulated Raman spectroscopy