To perform spectral analysis, data on disease counts over time is first collected. This data is then transformed using mathematical techniques such as the Fourier Transform to convert the time series into a frequency domain representation. The resulting spectrum illustrates how different frequency components contribute to the overall time series.