Measuring the amplitude of specific frequencies in the spectrum of the EEG signal is a technique that is increasingly used to study the cortical activities related to rhythmic activities, such as the processing of acoustic rhythms, or the performance of periodic movements (ie 1): the periodic activities appear as clear peaks that can be easily distinguished from background noise. However, many rhythms are not strictly periodic and rather have a period that fluctuates over time. The nearly periodic activities are blurred in the EEG spectrum, as the peaks are spread out to neighboring frequencies and add up to the background noise. Here, we introduce a time-warping method to align nearly-periodic EEG signals on a constant period and therefore concentrate the signal in the frequency spectrum.