I want to be able to generate a model timeseries from a given power spectrum. The power spectrum is measured from other data and hence has no fit parameters and is empirical. How does one go about generating simulated timeseries from such a PSD?

It is easy to go from signal to PSD (e.g. scipy.signal.periodogram) but what about the other way?

With DRWs you can simply generate iteratively by adding a Gaussian deviate to the previous datapoint but what do you do if the power spectrum is not analytical?


To go from a signal to a power spectrum, the Fourier Transform algorithm (or its discrete version) provides a classic method. The Inverse Fourier Transform will do the reverse.

One thing to watch for - when you generate a power spectrum from a signal, each component of the spectrum should have an amplitude AND A PHASE. You may have missing information if you only have the amplitude of the frequency components, and don't know their phase.

To generate model timeseries, you might have to iterate over randomly chosen phase values for each component of the spectrum, to generate a population of potential solutions to the signal.

If you have two separate amplitude power spectra, observed at different times, then it is possible to iteratively recover the missing phase information by transforming back and forth between signal and frequency space, and at each step when you reach frequency space, updating the amplitude estimates based on the observations. The resulting phase estimates will eventually converge on the correct solution, given sufficiently little noise in the observations. The Gerchberg-Saxton and Fienup algorithms are of interest here.

This related question has more information about why you need the phase: https://stackoverflow.com/questions/49625895/how-to-retrieve-original-signal-from-power-spectrum

This paper details some of the ways to recover missing phase information in inverse spectral decomposition: https://arxiv.org/pdf/1705.09590.pdf

| cite | improve this answer | |
  • $\begingroup$ Interesting, OK thanks. I assume that the phase holds the information for any auto-correlation in the timeseries? $\endgroup$ – Lucidnonsense Oct 5 '19 at 12:44
  • $\begingroup$ The stackoverflow answer I linked indicates that all the possible signals generated from an amplitude spectrum share the same autocorrelation function. $\endgroup$ – Jonathan Moore Oct 5 '19 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.