0
$\begingroup$

Coursera Signal processing by EPFL says the function that represents the peaks are cosine by looking at the DFT of 1024 samples. But why on what basis it can be said so?

Now if you look in detail and what happens in the spectrum, we see that the peaks are for k equal to 64 and for k equal 960. We also see that the peaks appear only in the real part of the spectrum, and we remember them when this happens, the underlying sinusoid, the sinusoid represented by the peaks is a cosine

enter image description here

So from this simple visual inspection, we can write our signal as such (as below), there will be a cosine component and we will have to determine both the frequency and the initial phase of this cosine. And there will be other part that we can probably call a noise component the sense that doesn't have any structure.

enter image description here

$\endgroup$

1 Answer 1

4
$\begingroup$

The DFT is showing you the results extending from DC to very nearly $f_s$ where $f_s$ is the sampling rate. This is equivalently the spectrum going from $-f_s/2$ to $+f_s/2$ if you take the 2nd half of the DFT and move it to the beginning (using 'fftshift' in MATLAB and python tools and as detailed in these other post):

https://dsp.stackexchange.com/a/94429/21048

https://dsp.stackexchange.com/a/94505/21048

That said, note that the Fourier Transform in general when positive and negative frequencies are shown is not showing us the components of real sinusoids, but instead components of $e^{j\omega t}$. We note from Euler's formula that a cosine is related to $e^{j\omega t}$ as follows:

$$\cos(\omega_1 t) = \frac{1}{2}e^{j\omega_1 t} + \frac{1}{2}e^{-j\omega_1 t} $$

We see from this that there is a component at frequency $\omega_1$ that has a magnitude of 1/2 and starting phase of 0, and another components at frequency $-\omega_1$ and starting phase of 0.

Compare this to the same relationship for a sine which is given as:

$$\sin(\omega_1 t) = -j\frac{1}{2}e^{j\omega_1 t} + j\frac{1}{2}e^{-j\omega_1 t} $$

This has components also at $\pm \omega$ but the phase is $\pm j$ or $\pm90°$. For this reason we know the result shown which has a frequency given as $k = \pm64$ (after we do fftshift) is a cosine and not a sine given the imaginary component is 0 at all frequencies and therefore the phase is 0 at the frequencies $k=\pm64$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.