Application of the spectral representation of stochastic processes to the study of nonstationary light radiation: a tutorial