I am studying DFT of sinusoids, and my professor gave me this signal.

  • Sinusoid Frequency: 100Hz
  • Number of Samples: 512
  • Sampling Rate: 8 kHz

Plotting the spectral plot I have the following: Spectral plot

I was expecting a single peak initially since the signal is only composed of a single frequency but from my understanding of the DFT, it mirrors the positive and negative values from the Nyquist rate which is 4kHz hence resulting to the two peaks. My professor then asks to 'correct' the peaks by modifying the parameters of the sinusoid. I am just confused as from what I understand the resulting peaks are correct.

  • $\begingroup$ Salty, we don't know what your professor meant, either. Are your axis labels correct, by the way? $\endgroup$
    – mmmm
    May 19, 2021 at 1:02

1 Answer 1


What you understand is right. The second peak is the negative frequency component. I guess what your professor meant is that the Fourier transform of a sine wave is theoretically perfect Dirac $\delta$ function, and the discrete Fourier transform of a sine wave is a Kronecker $\delta$ function, but in your implementation, it's two peaks instead of two $\delta$ impulse.

The problem is the relationship of the frequency of sine wave and FFT size. As we know the frequency resolution of FFT is $$ \Delta f = \frac{f_s}{N} $$ where $f_s$ is sampling rate and $N$ is the length of FFT. The FFT results in perfect $\delta$ only when the sinusoid frequency is exactly integer multiples of $\Delta f$.

In your case $\Delta f=15.625$ Hz, try something like 125 Hz and see what happens.

  • $\begingroup$ You're intermixing the dirac $\delta$ for continuous time (Fourier transform) with the $\delta$ (impulse) for discrete time, which is technically incorrect. $\endgroup$
    – David
    May 19, 2021 at 13:20
  • $\begingroup$ @David yes I understand the difference between Dirac delta and Kronecker impulse. They are respectively the FT and DFT of a sinusoid signal right? $\endgroup$
    – ZR Han
    May 19, 2021 at 13:39
  • $\begingroup$ Yes, in you're explanation your refer to the Fourier transform and the $\delta$ function and then go on to use the $\delta$ function in discrete time. It can be confusing for those new to the field. $\endgroup$
    – David
    May 19, 2021 at 15:39
  • $\begingroup$ @David Ok I've edited the answer. $\endgroup$
    – ZR Han
    May 20, 2021 at 1:20
  • $\begingroup$ It's not clear what the professor wants, it might be what @ZRHan is indicating. But part of me just wonders if the professor wants him to make the x-axis on the FFT output correspond to actual frequency instead of FFT index out. In which case he'll just have to figure out the bin width and build an array, maybe do an fftshift as well. $\endgroup$
    – Eric C.
    Jun 14 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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