# find the maximum of the DFT of sampled signal

The signal $$x(t)=\cos(10\pi t+\phi)+\cos(20\pi t)$$ is sampled with a sampling frequency $$F_s$$ as $$25 \mathrm{Hz}$$ where the phase $$\phi$$ is unknown.

Sampling the continuous time signal $$y[n]=x(nT)$$ where $$T=1/F_s$$.

After calculating the DFT of $$y[n]$$ with the length of DFT $$N=100$$, which of $$k$$ will give us the maximum of the magnitude of $$Y[k]$$?

– GKH
Commented Feb 3, 2020 at 9:32
• May I know why you have introduced one more unknown $\phi$ in seeking an answer? Commented Feb 3, 2020 at 9:42
• I thought of converting to Euler and then converting to DFT but the answer I get is incorrect. @GKH
– ori
Commented Feb 3, 2020 at 9:48
• This is the qeustion I got... @jomegaA
– ori
Commented Feb 3, 2020 at 9:49

Note that the frequencies of the FFT grid are given by

$$f_k=\frac{kf_s}{N},\qquad k=0,1,.\ldots,N-1\tag{1}$$

where $$N$$ is the FFT length.

Now observe that the two frequencies of the given signal fall exactly on the grid. So you only have to determine these two frequencies, and then use $$(1)$$ to figure out the corresponding indices.

EDIT:

It's always good to check your results using some simulation software. The following Octave/Matlab script confirms what you came up with.

phi = 0;    % exact value irrelevant
n = 0:99;
T = 1/25;
y = cos( 10*pi*n*T+phi ) + cos( 20*pi*n*T );
Y = fft(y);
subplot(2,1,1), plot(n,abs(Y),'x'), grid on


• I already did it and I get k=20,40,60,80. its incorrect. The answer should be k=10,20,80,90
– ori
Commented Feb 3, 2020 at 10:56
• @ori: What you got is correct. Why don't you just use some software and check the result? The given answer is wrong. Commented Feb 3, 2020 at 11:03
• @ori: I've added a simulation to my answer to convince you that we're right and the given solution is wrong. Commented Feb 3, 2020 at 11:17
• I understand, thank you very much
– ori
Commented Feb 3, 2020 at 11:20
• @jomegaA: If you want the zeroth bin in the center you can use fftshift. Commented Feb 3, 2020 at 11:35

My humble attempt and I could be totally wrong in trivial things. Phase $$\phi=0$$