Fitting the spectral density function.