# Discrete Fourier Series - Time Index

I have been trying to understand Discrete Fourier Time Series (NOT Transform).

It is defined as

$$a_k = \sum_{n=0}^{N-1} x[n]e^{jk\frac{2\pi}{N}n}$$

where N is the Time period and an integer (by definition), and $n$ goes from $0 ... N-1$.

Fair enough. But when N = 0.2 second as the time period of the wave, then how we define $n$, as $N-1$ is negative. I think here we should take $N$ as 200 miliseconds. And then loop $n$ from 0 ... 199.

But then the terms $x[n]$ (the samples) can be defined over either 200 milisec OR $2*10^8$ nanoseconds and so on. So for 200 ms case, we need 200 samples. But lets say I have taken 100 samples distributed equally over 200 ms time period. Now how we define $x[n]$ in this case, should I do like this: $x[0]=1, x[1]=0, x[2]=1,...$ That is, set alternate values to zero?

Because in the above equation, I need 200 values of $x$.

Or Better (I think):

Define $1 sec = 500ss$, where $ss$ is a hypothetical new unit of time, in that case time period is $N=0.2*500ss=100ss$ (with the condition that the final value is an integer). In this case we can loop over 100 samples easily without worrying over setting alternate values.

Can anyone kindly help me with this or on my thinking above.

Best Regards,

$N = 0.2$ second is not correct here. The positive integer $N$ has no unit. It is only the number of discrete samples you want to consider for computing the DFT. Once you have a discrete signal, with sampling period $\tau$, you can define a time frame of duration $T$ (with a unit, in second), on which you will evaluate the DFT. To be consistent, you should have an integer multiple of $\tau$ sampling periods in $T$.

Then, taking into account the first and last sample, if you have $N$ points aligned, they define $N-1$ intervals. Hence, $N-1=\frac{T}{\tau}$, or $N=\frac{T}{\tau}+1$. From that, you really see that $N$ is unitless (seconds divided by seconds). It is important to stick to common units for $\tau$ and $T$. If you already know the number of samples you want, knowing $\tau$, you can define $T$ has $(N-1)\tau$.

But from now on, you can reindex $x$ with integer indices. Before you had regularly sampled $\ldots,x(k\tau),\,x(k+1\tau),\ldots,x(m\tau),\ldots$ with respect to some absolute time.

Now, you have almost forgotten about the actual sampling rate, about the beginning of your time frame. So you have two major conventions:

• either index the first sample with $0$: $x[0],\,[1],\ldots,[N-1]$,
• or index the first sample with $1$: $x[1],\,[2],\ldots,[N]$.

If you now give your sampled signal to somebody else, he would know nothing about $\tau$ and $T$, and will work with an hypothetical new "integer" unit of sampling of $1$ (indeed, the ratio $\tau/\tau$).

The integer $N$ is the number of samples of $x[n]$ in one period. There need not be any relation to absolute time whatsoever, simply because $x[n]$ are just discrete data that are not necessarily samples of a function of time.

However, if the data $x[n]$ are samples of some continuous-time signal, then the time difference between two adjacent samples is, by definition, the sampling interval $T_s$, which is the inverse of the sampling frequency $f_s=1/T_s$.

In that case, the time corresponding to one period of $x[n]$, i.e., the time difference between two samples $x[n]$ and $x[n+N]$, equals $N\cdot T_s=N/f_s$.

First off you are stating that N is an integer and then asking about a situation where N=0.2. If N is an integer (which is indeed true), you should ask yourself how can you assert a noninteger value (0.2) to an integer?

• It is defined as integer in the definition of Discrete Time Fourier Series! – user3001408 Aug 23 '16 at 12:28
• I am trying to connect here between timeperiod and number of samples! And I am not talking about Transform, just simple periodic fourier coefficients! time period here is finite!! – user3001408 Aug 23 '16 at 12:38
• yes you are talking about the DFT. DFS=DFT. – robert bristow-johnson Aug 23 '16 at 15:59