Device and Method for Spectral Analysis