Spectral analysis (full version)