Skip to main content
added 5 characters in body
Source Link
Dan Boschen
  • 55k
  • 2
  • 59
  • 143

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$.

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 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$.

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$.

Source Link
Dan Boschen
  • 55k
  • 2
  • 59
  • 143

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 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$.