Efficient method for the calculation of time- and frequency-resolved four-wave mixing signals and its application to photon-echo spectroscopy.