1
$\begingroup$

There is probably something trivial behind this, but I am missing something. I need to create a stationary random time series data v(t) which is the the sum of another time series u(t) and u(t) with a time shift $\tau$, i.e

$v(t) = u(t) + u(t - \tau)$

The series u(t) is itself a stationary colored Gaussian time-series with some PSD $S_u(f)$. No problem! I wrote a small function (using Python) to make u(t) for a given PSD. I calculate the PSD of the the generated time series using Welch's method and it checks out.

enter image description here

If we take the Fourier transform of u(t - \tau) it should just gain an extra phase compared to the Fourier transform of u(t)

$F[u(t - \tau)] = \int dt \, u(t -\tau) \, e^{2 \pi j f t } = \int dt \, u(t) \, e^{2 \pi j f t } e^{- 2 \pi j f \tau } = \tilde{u}(f) e^{- 2 \pi j f \tau }$

Since $v(t) = u(t) + u(t - \tau)$,

$\tilde{v}(f) = \tilde{u} (f) \, (1 + e^{- 2 \pi j f \tau }) $

And the PSD of V should then be (using Euler identity)

$S_v (f) = 4 S_u (f) \cos^2 (\pi f \tau )$

In particular $S_v$ should vanish when $f = \frac{2n + 1}{2 \tau}$ with the smallest zero being at $\frac{1}{2 \tau}$. However when I test my this with the u(t) series I generated above the PSD looks different. There are zeros low frequencies which shouldn't exist. For example here is the PSD of the v(t) series and the spectra I would expect for $\tau = 2$. (The first zero should be at 0.25 Hz)

enter image description here

Moreover the zeros in the data seems to change with the sampling frequency I am using. The v(t) series for the above plot has a sampling frequency of 0.25 Hz. Here is one with 0.5 Hz, keeping everything else the same.

enter image description here

I am kind of baffled by this. Any help would be greatly appreciated. Sorry about the long post, and thanks in advance!!

EDIT: After using a higher sample rate as suggested by Hilmar below, and fixing the error I described in the comment everything looks good. Spectrum for the fixed case below.

enter image description here

$\endgroup$
  • $\begingroup$ plot your data on a linear frequency scale. the nulls are periodic in frequency $\endgroup$ – Stanley Pawlukiewicz Jun 22 at 12:10
  • $\begingroup$ At a sample rate of 0.25Hz and a delay of 2 seconds, there shouldn't be any null at all $\endgroup$ – Hilmar Jun 22 at 12:11
0
$\begingroup$

Your math is correct, for a delay of 2 seconds, the first null in the PSD should be at 0.25 Hz.

I'm guessing the problem is in the code you use to generate the signals and/or the PSD. The sample rates seem awfully low. At a sample rate of 0.25 Hz, your 2 second delay is just half a sample, that means you would have to implement a fractional delay to generate the signal. T

$\endgroup$
  • $\begingroup$ You are totally right!! The low sampling frequency should have had required a fractional delay. But I had further messed up the time delay part. In the code the time delay should be by something like $f_s \tau$ samples of the time series, where as I was doing $\frac{\tau}{f_s}$ samples. While this gave me an integer delay for the time series, it was of course the wrong time shift. I added a plot when I do the right time shift with a higher sampling frequency and things look okay. Thank you very much! $\endgroup$ – elenasto Jun 22 at 13: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.