spec function

Computing the spectrum