# The Fourier transform of a triangular window function

Windowing functions are explained on Wikipedia and they include plots of the Fourier transform for several windowing functions. For the triangle window they provide
The above Fourier transform plot has a horizontal axis that goes from -40 bins to +40 bins, so this seems to be a discrete Fourier transform. However, I don't get a plot like that when I apply an FFT to 80 samples of a triangular window. I am further confused in that the graphic of the Fourier transform looks like a continuous plot rather than 80 discrete samples.

My questions are: How does one create the plot for the Fourier transform of a triangular window? Is the plot for a continuous Fourier transform or discrete Fourier transform?

• This plot was probably done with lots of zero padding. Do an FFT over 16k points or so. This is equivalent to dense interpolation in the frequency domain. – Hilmar Nov 28 '16 at 21:52
• Or check here. – Gilles Nov 28 '16 at 22:00

Not the perfect fit, but a quick-and-dirty base to play on:

%nBin = 81;
nBin = 2049;

y=(20*log(fftshift(abs(fft(triang(81),nBin)))))';
x = linspace(-40,40,length(y));
basey = min(0,min(y));