# Frequencies of complex exponentials in Discrete Fourier Transform

What I understand is that using DFT, we are representing a given discrete signal using a basis of complex exponentials of different harmonic frequencies. If I am taking 16 point DFT of a signal sampled at 1 KHz, k=0 corresponds to 0 Hz, k=1 corresponds to 62.5Hz etc. Is this correct?

In the figure, a cosine of 187.5Hz is shown and it is sampled at 1KHz. The sampled signal is actually the cosine part of the complex exponential of k=3 in a 16 point DFT. What confuses me is that, although the continuous time signal is periodic with frequency 187.5Hz, the sampled signal is not having the same period.

If the sampled signal is not of frequency 187.5Hz, how can we say that basis vectors of k=3 picks up the signal component of 187.5Hz?

• What do you mean by "the sampled signal is not having the same period"? The sampled signal has period $N=16$, and its periodic continuation are samples of the original cosine wave. Jun 27, 2020 at 7:42
• @MattL. What I meant is in the given figure, the 2nd cycle of continuous cosine starts at around 5.3ms but as you rightly pointed out, the 2nd cycle of the discrete cosine starts at 17ms (17th sample). If both the discrete and the continuous signals have the same frequency, shouldn't they have the same period? Jun 27, 2020 at 8:37
• @user656885 they do. You're just omitting the last millisecond of continuous signal in your plot. Jun 27, 2020 at 9:48
• 0 to N-1, think O---O---O---O--- then the next one O---O---O---O--- and so on. The subtle point to remember is that for non-rational frequencies, the discrete sequence in never periodic, i.e. never repeats. For rational, non-integer frequencies, the repeat period is a multiple of the underlying continuous period. Jun 27, 2020 at 9:59
• What the OP means is that the discrete-time signal doesn't repeat after the first period of the cosine. Jun 27, 2020 at 10:03

It's not necessary for a discrete-time signal to have the same period as the continuous-time signal that it represents. As long as the continuous-time signal is band-limited and as long as the sampling frequency is greater than twice the bandwidth of the continuous-time signal, the discrete-time signal can perfectly represent the continuous-time signal.

In your example, the continuous-time signal is

$$x(t)=\cos(2\pi f_0t)\tag{1}$$

and the discrete-time signal is

$$x_d[n]=x(nT)=\cos(2\pi f_0Tn)\tag{2}$$

$$x_d[n]$$ perfectly represents $$x(t)$$ if $$f_0T<\frac12$$ is satisfied. In general, $$x_d[n]$$ is not even a periodic sequence. It is only periodic if $$f_0T$$ is rational.

With the choice $$f_0T=3/16$$ we make sure that $$x_d[n]$$ perfectly represents $$x(t)$$, and we also make sure that $$x_d[n]$$ is periodic with period $$16$$. Note that there can't be $$3$$ periods of the discrete-time signal in the DFT frame, simply because $$16/3$$ is not an integer.

Since $$x_d[n]$$ has period $$16$$, taking a length $$16$$ DFT results in a single frequency component. With $$f_0T=3/16$$, that component occurs at frequency index $$k=\pm 3$$, which exactly represents a continuous-time sinusoid at frequency $$3/16\cdot f_s$$ (with $$f_s=1/T)$$.

• I didn't answer, it is in a comment. Your statement about representation only extends beyond the DFT frame if the signal is whole periodic within that frame. Jun 27, 2020 at 10:12
• @CedronDawg: In the first part of my answer I'm not referring to the DFT, just to general representation of continuous-time signals by (infinitely long) discrete-time signals. The last paragraph addresses the DFT. I think the OP is wondering why there aren't $3$ periods of the discrete-time signal in the DFT frame. Jun 27, 2020 at 10:16
• Thanks @MattL. It is clear now. I had a feeling that the discrete signal should also be periodic and hence thought that I made some mistakes while plotting. Thanks again! Jun 27, 2020 at 18:11

"187.5Hz is shown and it is sampled at 1KHz."

Sampling is better represented with units of samples per second.

$$\frac{ 187.5 \frac{cycles}{second} }{ 1000 \frac{samples}{second} } \cdot 16 \frac{samples}{frame} = 3\frac{cycles}{frame}$$

Since your frequency is a whole number, there will be no leakage in the DFT.

While we're at it, have a unit based look at the exponential term of the DFT definition:

$$\frac{2\pi}{N}kn$$

$$\frac{ \frac{radians}{cycles} }{ \frac{samples}{frame} } \cdot \frac{cycles}{frame} \cdot samples = radians$$

One of the most important things to know about the DFT is that the bin index ($$k$$) represents the frequency in terms of cycles per frame. (Except in MATLAB where it is off by one.)