Ultrafast modulation spectroscopy in cascading three-level and four-level systems