# DFT of Sinusoid Peaks

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

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

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.
• You're intermixing the dirac $\delta$ for continuous time (Fourier transform) with the $\delta$ (impulse) for discrete time, which is technically incorrect. May 19 at 13:20
• 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. May 19 at 15:39