1

If I perform a FFT of a real signal which is limited on time (for example the atmospheric pressure in time from 0s to 5000s), is it possible that the fact that is limited on time can affect the FFT results? I read this thread and I don't know a priori how many cycles can fit inside it. Is it possible that spectral leakage occur? In the end it is like a big rectangular window.

Are there ways to overcome the effect of the limited sampled signal length?

Peter K.
  • 25,714
  • 9
  • 46
  • 91
user49811
  • 33
  • 5

1 Answers1

3

This is a recurring question on the website, and I'm sure if you search for "spectral leakage" here, there are PLENTY of resources available such as here and here

Answer to your question is, yes, there are ways to diminish the effects of spectral leakage using windows different from the regular rectangular window.

This is a good resource for learning about what spectral leakage is, and ways to deal with it.

Jdip
  • 5,980
  • 3
  • 7
  • 29
  • 2
    Nice link! I hadn't seen that before. – Peter K. Dec 16 '22 at 12:48
  • 1
    If I don't want to divide my signal in windows is still possible to diminish the effect of the spectral leakage? – user49811 Dec 16 '22 at 12:55
  • I suggest you read the link I provided, where they explain this in detail. Based on the timing between my answer and your comment I doubt you've had the time to go through! You don't need to divide the signal in windows if you don't want to. You can replace the "big rectangular window" by a different window such has a hanning window for example. That means before doing the FFT on your signal, multiply it by that window. – Jdip Dec 16 '22 at 12:58
  • 1
    Hanning is a major modification of the signal, I'd say introduces more distortions to FFT than it alleviates. A flattop that decays near edges, like Tukey, preserves most of time-frequency behavior and should hold beyond idealized cases. – OverLordGoldDragon Dec 16 '22 at 13:08
  • I have already read this link before posting that's why I answered so fast. Thanks also to this link I supposed that I had a problem of spectral leakage. So you suggest to do a big hanning window? – user49811 Dec 16 '22 at 13:10
  • 1
    Yes, except it doesn't have to be a hanning window. As @OverLordGoldDragon suggests, try a Turkey window! It will only attenuate the signal near the edges, unlike a hanning window which is more useful with window-overlap methods. My answer has links that can help you decide what window you can use. – Jdip Dec 16 '22 at 13:17
  • 1
    The Tukey window is really relegated to transient events where we are interested in accurately capturing the amplitude over a short interval in time, it has great freq resolution for the main-lobe but comes at a cost of very poor sidelobe suppression in frequency compared to other windows. See this classic paper by fred harris which covers using different windows in many applications, in particular Fig 12 is interesting in stacking up the Tukey vs Hamming Windows. For optimum time bandwidth resolution, the Kaiser window is a great choice and DPSS is optimum when processing allows. – Dan Boschen Dec 17 '22 at 21:42
  • link mentioned in comment above: https://www.cs.cmu.edu/afs/cs/user/bhiksha/WWW/courses/dsp/spring2013/WWW/schedule/readings/windows_comparison2_harris.pdf – Dan Boschen Dec 17 '22 at 21:42
  • 1
    Thanks @DanBoschen! Great link! – Jdip Dec 17 '22 at 22:55
  • @DanBoschen For accurately representing a general signal, the "lobe analysis" isn't applicable. Non-Tukeys like DPSS significantly change signal amplitude near edges, which is simply a distortion. We may better estimate certain parameters in various settings, sure, but that's separate. I think Hamming and everything else are a terrible choice for someone who just wants an accurate general spectrum. -- Also I wasn't notified of your reply. – OverLordGoldDragon Jan 07 '23 at 11:57
  • 1
    @OverLordGoldDragon It really depends on what you mean by "representing". If you are interested in a power spectral density plot as done in general spectral analysis of stationary signals, Tukey is a bad choice. Lobe analysis is particularly important when we are evaluating multiple signals within a spectrum or similarly waveforms with content at multiple frequencies and in particular for these cases the condition of having weaker signals in the presence of stronger signals: where our concern in the analysis is with dynamic range (at the expense of spectral resolution). – Dan Boschen Jan 07 '23 at 13:06
  • 1
    This consideration would apply of course to when we refer to "accurate general spectrum" where these cases can occur (Kaiser is even a better choice over Haming in that case, and Tukey would not be a good choice). If we are interested in power spectral density plots with signals that are themselves noisy or in the presence of noise, then using a Kaiser window with the Welch method is a good go-to (where spectral resolution is again traded for noise in our estimate). – Dan Boschen Jan 07 '23 at 13:06
  • @DanBoschen By "accurately representing" I mean the DFT reflects the spectrum in absence of windowing artifacts. If we're windowing the entire signal, this naturally becomes impossible, but the idea is of course tradeoffs. Now, I made the silly error of thinking windowing changes time-frequency geometry... badly confused with effects of changing STFT windows. My mistake. This makes non-Tukeys less terrible - how much, depends. Though if DFT is worth inspecting at all then maybe the signals are indeed suited for non-Tukeys - honestly not experienced enough to tell. – OverLordGoldDragon Jan 07 '23 at 13:15
  • @OverLordGoldDragon Yes your point is completely valid especially for other cases when the signal is not stationary and we are interested in frequency vs time or other details. But given this question was specific to spectral leakage (where these other concerns would be dominant), windowing and the consideration of the sidelobes (where the spectral leakage occurs) is VERY important. – Dan Boschen Jan 07 '23 at 13:17
  • @DanBoschen I'm just concerned with artificial modifications. If I conclude 10 sec audio is half as loud at 2.5 sec mark as at 5 sec because of windowing, that's a lie! And most real-world signals are made of time-localized components (decay to zero before reaching edges), which makes windowing redundant, and Tukey is the best "non-window window" we've got for dealing specifically with edge discontinuities. I think time localization is key here and your last comment is right, but OP does ask about an intricate real-world signal that's >1 hr long, hence my concerns. – OverLordGoldDragon Jan 07 '23 at 13:20
  • 1
    Yes good point and very unlikely to be a stationary signal in this case! – Dan Boschen Jan 07 '23 at 13:21