# Discrete Fourier transform intuition

I'm given a signal $$x(t)=\cos(200\pi t)$$ which is sampled at $$t=n/400$$ instance, for $$n=0,1,2,..,7$$
I've to comment on $$X$$, the 8 point discrete Fourier transform.

Just multiplying by the DFT matrix with input signal, gives me
$$X=[0,0,4,0,0,0,4,0]$$ But I'm unable to understand why exactly do those zeros appear?

• The question misses a connection to physics in its current form. A better place to ask this is dsp.stackexchange.com or math.stackexchange.com. But make sure that the question or a similar question hasn't been asked before. Oct 18, 2021 at 9:13
• $x$ is an average of two complex exponentials.
– J.G.
Oct 18, 2021 at 9:39
• @J.G. could you please elaborate a bit more? Oct 18, 2021 at 9:55
• @ChiragMehta $\cos\omega t=\frac12(e^{i\omega t}+e^{-i\omega t})$; take $\omega=200\pi$.
– J.G.
Oct 18, 2021 at 9:59

This is more math than physics, but I have sketched some quick diagrams that hopefully can give some intuition to this. Suppose we observe a set 9 discrete measured quantities as follows: It looks periodic, but we do not yet know in what ways and how periodic it really is.

The main idea is to hit the observed series of values (ie. multiply the numbers point by point, as shown in examples below) with different sine functions, which we know are also periodic. We attempt to hit it with 3 different sine function as follows:   We see that only a very special function, the one in the middle, which actually has the same original shape as the observed discrete values, will give a positive result. All the other analysing functions with the "wrong" periodicity gives a 0 answer.

The idea is to use a computing machine to hit the observed set of values with as many analyzing functions as we like. The ones that give a non-zero answer is related in some ways to the original observed set of values.

This is the fundamental idea of discrete fourier transform. The rest of the fourier analysis is mainly about finding the bounds and limites, such as how high a frequency we need to test, what is the minimum resolution of data to get a clear positive answer, and what does the answer '4' really mean in the second calculation above, etc...

For a complex valued data, we just think of it as a 2-D array. So we repeat the same process as above two times, once for the set of real values, and another for the set of imaginary values. A complex number is just a 2D array [r_part, i_imag], and at the very end we can take the Pythagorean distance sqrt(x^2+y^2) of the real and imaginary components for each frequency bin to get the final answer.

Hope it helps.

The input signal that you started with is time domain, in other words succeeding data points are separated in time, each data point is at the next time interval. On the other hand, the output signal, in other words the discrete cosine transform, is in frequency domain, so each succeeding data point is the 'next' frequency. This DCT result which is mostly zeros is saying that the input has only a single frequency in it, which we know is true, because it was a single cosine function. Why are there 2 non - zeros then? Because DCTs (and also Fourier transforms) have the annoying concept of negative frequency. In practice engineering applications would just use the first half of the DCT, which only contains a single '4' ie the [0,0,4,0,0] bit. In other words, the DCT is telling you that the input signal correlates well with that single frequency, and not at all with the other frequencies that the DCT was 'asking' about.