In this paper, we analyze electroencephalograms (EEGs) which are recordings of brain electrical activity. We develop new clustering methods for identifying synchronized brain regions, where the EEGs show similar oscillations or waveforms according to their spectral densities. We treat the estimated spectral densities from many epochs or trials as functional data and develop clustering algorithms based on functional data ranking. The two proposed clustering algorithms use different dissimilarity measures: distance of the functional medians and the area of the central region. The performance of the proposed algorithms is examined by simulation studies. We show that, when contaminations are present, the proposed methods for clustering spectral densities are more robust than the mean-based methods. The developed methods are applied to two stages of resting state EEG data from a male college student, corresponding to early exploration of functional connectivity in the human brain.