# Confused about the period of a discretised time-series

I have managed to confuse myself about the periods of discretised time series. It is all rather embarrassing.

This is one period extracted from my continuous signal (radians on y, time on x):

To use it in my calculations I use a discretised vector of N points. The above signal has a period of $T=0.95s$. The discretised version A has $N=100$ and the angle, over time, is indexed from 1 to 100.

Q1: is the period of my angle vector $[\theta_1,\ldots,\theta_{100}]$; $T=100$?

Now suppose I need to standardise my data as such, incl the index:

% standardise training inputs
m = mean(A);
s = std(A);
x(:,1) = 1/s(2) * (A(:,2) - m(2));  % index
x(:,2) = 1/s(1) * (A(:,1) - m(1));  % velocity


Q2: Is the new period then simply max(x(:,1))?

• Are you proposing to "standardize" your time basis?! That doesn't make sense for a periodic time basis. – MSalters Jan 23 '17 at 22:42
• Most discrete signal analysis ignores the sampling interval once converted. By that I mean that your indices are 1, 2, 3, ..., 100, so your period would be 100 in discrete time. You would normally denote this as N=100. It looks like your indices got mixed up in Q2. Anyway, you would not normally compute the mean and standard deviation of an independent variable. You should just index it with 1, 2, 3, ..., 100. – Commodore63 Jan 24 '17 at 3:25
• @Commodore63 thank you that clarified things; I am using this with Gaussian processes which is why I need to standardise my data. – Astrid Jan 24 '17 at 21:11

On the continuous setting, the period is the minimum $T\ne 0$ such that $\theta(t+T)=\theta(t)$. Once you decide to have $N$ regularly sampled points inside a period, you introduce a sampling period $T_N$ that is directly proportional to the period: $T_N=T/N$. Hence, you can describe your period as a quantity with a time unit (second) or as a unitless number of samples, equivalently.

Now, if for some reason you normalize the time axis with an affine function, the mean will only shift the whole axis (no change for the period), and the scaling only will dilate or shrink the interval between samples.

So here, the effect of $s(1)$ will turn $T_N$ into $T_N/s(1)$, and also $T$ into $T/s(1)$.

In your case, you can directly compute $s(1)=T_N\sqrt{\frac{N(N+1)}{12}}$. In this formula, the scale factor depends on $N$ only, and not on the start and end indices. For $N=100$, the new period should be now a unitless quantity of $$T/s(1) = \sqrt{\frac{12N}{N+1}}\,.$$

• That was surprisingly harder than I thought. – Astrid Jan 26 '17 at 7:48
• I will provide more details later. Beware though, there is apparently a swap of indices between your 'x(:,1)' and 'x(:,2)' – Laurent Duval Jan 26 '17 at 8:34
• Also, what is s(1) in your above notation? – Astrid Jan 26 '17 at 10:54
• I took $s(1)$ as the 'std' in the dimension of the time index. I am surprised by your notation $x(:,1) = 1/s(2)\ldots$ and $x(:,2) = 1/s(1)\ldots$ – Laurent Duval Jan 26 '17 at 10:58
• Aha, sorry, yes that is obvious now. Yeah I have a lot of datastreams and I am storing the std in s and treating it as a vector. Matlab makes that easy after all. – Astrid Jan 26 '17 at 11:35