Empirical spectral processes and their applications to time series analysis