# how to create a DFT with scalloping/spectal leakage

I had some problems with scalloping and spectral leakage. I think I solved that.

I wrote an algorithm in C++ using FFTW3. It works. But now I want to show when you get scalloping.

It took me some time to really understand what is going on. To understand that a rectangular window has a sinc function as the DFT. And that you can have the bins of the sinc function at zero if you have integer numbers of periods in the window.

I read the Harris paper and it helped.

So I try to create a pure sine with certain sampling frequency and a certain window size to create scalloping. I can get leakage, but only the Eiffel Tower effect/leakage skirt. Shouldn't I get the most scalloping when there are 1.5 periods in a window?

For example, in this pdf: http://m.eet.com/media/1051177/Windowing_pt1_Carnes.pdf

I want to get something as shown in figure 1, but all I get is something like figure 4. I do not understand the difference between scalloping and Eiffel tower effect and this causes me to not be able to accurately show how windowing function helps.

Are they all secretly using zero-padding? Or you get scalloping only with infinitely high resolution? I don't get it. What dataset do I DFT to get extreme scalloping? Ill try it with matlab and my algorithm. But I can't generate it myself.

• When it comes to demonstration, I already did similar stuff before that can be simply re-used.
– jojeck
Aug 12, 2016 at 11:45
• You also don't get scalloping. Aug 12, 2016 at 12:13
• Well, I do get it, but you can't see it directly without zero-padding. Please see other answer
– jojeck
Oct 8, 2017 at 9:08
• @Almeisan there's strong indication that jojek knows what he's talking about, and you're not. I recommend that you carefully read and try to evaluate the actually good answers you've gotten – you got quite some misconceptions and are liable to bad temper. Oct 20, 2017 at 20:36
• Also, you must not vandalize your questions; we've discussed this before. Oct 20, 2017 at 20:37