-2

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.

Peter K.
  • 25,714
  • 9
  • 46
  • 91
Almeisan
  • 11
  • 6

1 Answers1

1

With a low number of periods of a strictly real signal per FFT length, the positive frequency and negative frequency Sincs interfere. Try a higher number of periods (but not near Fs/2), or a complex exponential. Also zero pad by a multiple of your rectangular window length, that multiple being the number of samples of each Sinc lobe you want to see in the FFT result.

hotpaw2
  • 35,346
  • 9
  • 47
  • 90
  • This is what I get from 300 * sin(6Pit), so a 3 Hz sine. I Sample 15 times a second: http://i563.photobucket.com/albums/ss73/Harunobu/signal.png I create 4096 datapoints in a single 4096 window. This is what I get: http://i563.photobucket.com/albums/ss73/Harunobu/leakage.png No scalloping and no meaningful effect of the Hamming window. No zero-padding, but that seems pointless to even try anyway. Don't understand why it is done and can't imagine everyone is secretly doing it, without mentioning, then doing something to get rid of the artifacts it causes. – Almeisan Aug 12 '16 at 18:22
  • Padding creates a mess, Hamming does little to alleviate. But no scalloping. http://i563.photobucket.com/albums/ss73/Harunobu/padding.png – Almeisan Aug 12 '16 at 19:00
  • The scalloping is apparent in your zero-padded plot. But you have to zoom way in (magnify) to see it more clearly. – hotpaw2 Aug 12 '16 at 20:08