A clustering procedure for time series based on the use of the total variation distance between normalized spectral densities is proposed in this work. The approach is thus based on classifying time series in the frequency domain by consideration of the similarity between their oscillatory characteristics. As an application of this procedure, an algorithm for determining stationary periods for time series of random sea waves is developed, a problem in which changes between stationary sea states is usually slow. The proposed clustering algorithm is compared to several other methods which are also based on features extracted from the original series, and the results show that its performance is comparable to the best methods available, and in some tests, it performs better. This clustering method may be of independent interest. Copyright © 2016 John Wiley & Sons, Ltd.