We propose a new approach to modelling almost periodic signals and to model-based estimation of such signals from noisy observations. The signal model is based on Fourier series where both the coefficients and the fundamental frequency can continuously change over time. This signal model can be represented by a factor graph which we use to derive message passing algorithms to estimate the time-dependent model parameters from the observed samples