Side lobes not visible in FFT of rect function I was making a plot to show side lobes for different spectral windows and I noticed if I take a simple fft of a rectangle window, I don't see any side lobes. I think I'm just making a simple mistake.

Here is the Python code I ran:

from matplotlib import pyplot as plt
import numpy as np
fAxis = np.linspace(-1/2,1/2,100)
rect = np.ones( 100 )
specWindow = abs(np.fft.fftshift(np.fft.fft(rect)))
plt.plot(specWindow)
plt.show()




Could anyone explain how to change my code slightly to see the side lobes I'd expect. I expect a discrete FT of a rectangle function to give me the Dirichlet kernel.
You have to imagine your signal as being periodically extended forever in both directions. Since you square window is constant over the whole interval when it is periodically extended it becomes flat everywhere. In other words, you don't have a square window. You just have a flat line. That's why only the zero frequency band on the fft has any amplitude. Try doing it again with some zeros on either side of your square window.