This article deals with the problem of the determination of the finite or countable set of frequencies belonging to any arbitrary almost periodic (in the sense of Bohr) time series. For this purpose, we present a simple computation procedure based on the local maxima of the modulus of a weighted Fourier transform from finite observation of the time series, computed at frequencies in a finite uniform grid of [0, 2π). We study the convergence of this algorithm as the length of the observation goes to infinity. First non-random signals are considered. Then we tackle the case of a signal disturbed by an additive noise. Finally we show how the algorithm can be applied to almost periodically correlated random time series.