# Calculating original signal from Discerete Fourier Transform

I am trying to calculate the original equation using a DFT. I start with a equation, generate values from this equation and then get the dft of these values. The aim is to generate the original equation using the dft values.

Consider the following equation $$f(t) = 1 + 0.75\cos(2\pi t/4) + 0.2\cos(4\pi t/4) + 0.5\cos(6\pi t/4)$$

original signal for $t=[0,1,2,3]\Rightarrow [2.45,0.80,-0.05,0.80]$

DFT: $[4,2.5,0.8,2.5]$

From DFT (i.e $[4,2.5,0.8,2.5]$) how do I retrieve the coefficient $0.75, 0.2$ and $0.5$ present in the original equation?

Cheers, Ambi.

• Would you mind revising your question and double checking everything? It looks like numbers that you provided are not correct. Anyway - keep in mind to divide the FFT by number of samples (in the most simple case) and then you can consider frequency components. Obviously the last two in your case are summing up to 0.7, so I think it's wrong to start with... – jojek Nov 30 '15 at 23:20
• Hi jojek, edited the question. Values 0.75, 0.2 and 0.5 are not DFT but the coefficients of cos components in the original equation. Why do I need to divide them by number of samples? – user1163441 Dec 1 '15 at 1:03
• The frequency 6 $\pi$ / 4 = 1.5 $\pi$ is too high. It is higher than the Nyquist frequency $\pi$ so your sampling aliases it to another frequency. – Olli Niemitalo Dec 1 '15 at 7:48

At first glance your first paragraph seemed wildly confusing to me. (The notion of "calculating" an equation makes no sense.) But now I see what your professor is asking of you. He wants you to determine the coefficients of an equation. He gave you a continuous $f(t)$ equation of a signal containing a DC component (1cos(0$\pi$$t$/4) and three sinusoids. And the 2nd and 3rd sinusoids have frequencies that are integer multiples of the 1st sinusoid.
So, your prof wants you to select the values and length ($N$) of a $t$ time sequence that will make those sinusoids reside exactly at an $N$-point DFT's bin centers. When that happens the bin centers' frequencies will give you the frequencies of the three sinusoids in your $f(t)$ equation. The peak values of the non-zero DFT spectral components (DC plus the three sinusoids) will enable you to establish the [1, 0.75, 0.2, 0.5] peak amplitude coefficients in your $f(t)$ equation. Your prof wants you to learn how a sinewave whose peak amplitude is $A$ produces a DFT spectral component magnitude value of $M$ given the $N$ length of your DFT. Your job is to see how $A$, $M$, and $N$ are related to each other. This is a good homework problem.
Your $t$ = [0,1,2,3] sequence's period is one which means your sample rate is 1 sample/second. And as Ollie said, that's too slow. Set your $t$ sequence to [0, 0.5, 1, 1.5, 2, ..., 6.5, 7, 7.5], compute a 16-point DFT, compute the spectral magnitudes, and see what happens .
• @user1163441 : Do you have a $\frac{1}{N}$ factor missing from your definition of the DFT? – Peter K. Dec 1 '15 at 13:09