Extraction of spectral densities from lattice correlators