  We adapt an existing data compression algorithm, MOPED, to the extraction of
median-likelihood star formation (SF) histories from medium-resolution galaxy
spectra. By focusing on the high-pass components of galaxy spectra, we minimize
potential uncertainties arising from the spectro-photometric calibration and
intrinsic attenuation by dust. We validate our approach using model high-pass
spectra of galaxies with different SF histories covering the wavelength range
3650-8500 A at a resolving power of about 2000. We show that the method can
recover the full SF histories of these models, without prior knowledge of the
metallicity, to within an accuracy that depends sensitively on signal-to-noise
ratio. The investigation of the sensitivity of the flux at each wavelength to
the mass fraction of stars of different ages allows us to identify new
age-sensitive features in galaxy spectra. We also highlight a fundamental
limitation in the recovery of the SF histories of galaxies for which the
optical signatures of intermediate-age stars are masked by those of younger and
older stars. We apply this method to derive average SF histories from the
highest-quality spectra of morphologically identified early- and late-type
galaxies in the SDSS EDR [...]. We also investigate the constraints set by the
high-pass signal in the stacked spectra of a magnitude-limited sample of
SDSS-EDR galaxies on the global SF history of the Universe. We confirm that the
stellar populations in the most massive galaxies today appear to have formed on
average earlier than those in the least massive ones. Our results do not
support the recent suggestion of a statistically significant peak in the SF
activity of the Universe at redshifts below unity, although such a peak is not
ruled out [abridged].
