Corrections for Windowing functions in FFT calculations

Having problems ? let us know the details here
Post Reply
dnessett
Active User
Active User
Posts: 34
Joined: Tue Oct 16, 2018 10:30 pm

Corrections for Windowing functions in FFT calculations

Post by dnessett » Sun Apr 21, 2019 5:28 am

Hi,

This is really not a "getting started" sort of question, but I could find no other board to use in asking it.

When the PicoScope FFT spectrum analyzer is applied to an input signal, there is the option of selecting a window function to reduce spectral leakage from one bin to another. A general discussion of this problem is provided in this paper, which concentrates on power spectra, but the whole idea of spectral leakage applies to any FFT calculation, including that in which the spectral values are voltages or log voltages (i.e., dBV). I have had extensive discussions on this topic with Gerry in this thread and many of my questions were answered by him.

However, there is one question I failed to ask; specifically, when a windowing function is selected, are the data in the bins of the resulting spectrum adjusted by the effective noise bandwidth associated with that function. This is normally required when the spectrum comprises values associated with white noise. For power spectra, this adjustment comprises dividing the bin values by a constant associated with the windowing function. For example, if Blackman-Harris windowing is selected, the constant is 1.7.

The question is: does the PicoScope 6 software perform this correction, or is it the responsibility of the user to do so. This is important because if the PicoScope 6 software performs the correction, the user should not, because that would give an incorrect result.

This problem is illustrated by attempting to compute the noise floor of the PicoScope. If one puts a 50 ohm terminator on an input and then collects data from that input, the result will represent the noise floor of the instrument. However, it isn't clear whether that is the case, since if the PicoScope 6 software does not correct for spectral leakage due to the windowing function, then the results would have to be divided by the constant associated with it.

I have asked similar questions before and Gerry provided very detailed and informative answers. However, I failed to ask this specific question. I am computing the noise floor of the PicoScope 4262, so I need to know whether the PicoScope 6 software performs the correction or if I need to do so.

Gerry
PICO STAFF
PICO STAFF
Posts: 404
Joined: Mon Aug 11, 2014 11:14 am

Re: Corrections for Windowing functions in FFT calculations

Post by Gerry » Mon Apr 29, 2019 3:00 pm

Hi Dan,

Apologies for the delay in responding.

The Windowing functions are necessary to prevent spectral leakage of the signal where the signal contains frequency components that have not been sampled coherently. Incoherent sampling is where, for a specific frequency, the captured data does not result in an integer number cycles, and therefore results in transients being created by the Fourier transform process of repeating the the captured data. The transients in the Time Domain are transformed into wideband Magnitude components in the frequency domain which means that they are leaking across many bins (in fact all bins to some extent). The Windowing functions change the start and end of the data in a window so that when the captured data is repeated there is minimal disjoint, and therefore minimal transients and minimal wideband spectral leakage. Because the windowing functions alter the the actual data, it must be compensated, according to whether the spectrum is an Energy (Power) Spectrum, or Amplitude (Voltage) spectrum (because the correction values are different). PicoScope 6 applies coherent gain to the Window Function so that the Amplitude level is matched before and after the FFT is applied, because we plot an Amplitude (Voltage) spectrum.

If you need any further explanation of windowing then I fully recommend these 2 articles (2 of the best articles for simple explanations of the phenomenon that I have found): https://community.plm.automation.siemen ... a-p/432760, and https://community.plm.automation.siemen ... a-p/431775

The answer to your question regarding the noise floor is that you need to be very careful about measuring noise in a Spectrum plot created from a DFT or FFT. First of all when analysing noise in a Spectrum plot, most people are interested in noise power Spectrums as these tend to be how noise is analyzed, and the calculations of standardized measurements are straightforward to perform (as, for instance RMS is based on the squares of the magnitudes, which is what you get in a power spectrum, for which the appropriate windowing function correction will have been applied, i.e. for energy/power). Also, as I've mentioned in previous posts, you need to take into account Process Gain which reduces the noise floor as a proportional logarithm of the number of bins used for the plot. So, As PicoScope 6 computes the Voltage and applies the windowing correction for that, you would need to undo the windowing correction for voltage, square the component for power, and then apply the correction for power, if you want the power spectrum equivalent of each plotted value.

Regards,

Gerry
Gerry
Technical Specialist

dnessett
Active User
Active User
Posts: 34
Joined: Tue Oct 16, 2018 10:30 pm

Re: Corrections for Windowing functions in FFT calculations

Post by dnessett » Sun May 19, 2019 10:52 pm

Hi Gerry,

Previously, I decided to ignore the corrections for ENBW associated with a particular window function, since they were small. Consequently, while I read and understood your response to my original question, I did not pursue it further. I have changed my mind and now wish to ensure these corrections are applied.

When I read your last post on this topic, you indicated that the PicoScope 6 software applies the window corrections to the amplitude data in order to compensate for spectral leakage. Just be clear, I am displaying the spectrum in dBV units and capturing that data to a csv file (I have moved to a Windows based version of PicoScope 6, since the Linux version doesn't seem to correctly capture csv data, as we are discussing in this topic). However, you say in order to properly compute power spectrum data, I need to back out the voltage corrections, square the voltages and then apply the window corrections associated with power spectra.

In order to do that, I need to know the correction factor (for Blackman-Harris) PicoScope 6 applied to the voltage data. I also need to know what variation of Blackman-Harris you are using (e.g., 3-term, 4-term, etc.), so I can apply the correct power correction factor.

In addition, there is another issue concerning the PicoScope 6 software that I need to understand. According to this this paper (see section entitled "Computing Power Level and Spectral Noise Density"), the correction that should be applied is division by the the Noise Power Bandwidth of the window times the bin width. So, if the bin width is, say 19 mHz, the denominator correcting the power value would be .019*1.7 (assuming a 3-term Blackman-Harris window). You did not mention whether the PicoScope 6 software uses the bin width in the correction computation. I need to know this, since if the bin width is used, I need to back out the correction by multiplying by the Noise Power Bandwidth of the window times the bin width of the window.

Regards,

Dan

Gerry
PICO STAFF
PICO STAFF
Posts: 404
Joined: Mon Aug 11, 2014 11:14 am

Re: Corrections for Windowing functions in FFT calculations

Post by Gerry » Wed May 22, 2019 5:36 pm

Hi Dan,

To answer your question, the correction factor is correcting the amount that a windowed data element represents so, for example, for a Hanning window you would need to multiply the data element by 2 in order to convert the amplitude peak represented in a power spectrum to what it should be in an amplitude spectrum. So, as you apply a windowing function to a bin, by definition, the correction is applied according to the number of bins that there are, which is obviously inversely proportional to the bin width. So, the bin width must be (indirectly) taken into consideration in computing a correction (for plotting or conversion) and, as mentioned previously, we apply the amplitude correction to the bins as we ensure that the level is matched before and after computation of the plotted values.

Regards,

Gerry
Gerry
Technical Specialist

dnessett
Active User
Active User
Posts: 34
Joined: Tue Oct 16, 2018 10:30 pm

Re: Corrections for Windowing functions in FFT calculations

Post by dnessett » Wed May 22, 2019 9:04 pm

Hi Gerry,

Thanks for the response. Just to make sure I understand correctly, the adjustment PicoScope 6 makes to the data is to divide by the factor associated with the window, not by this factor times the bin width. So, to back it out, I multiply by that factor. Correct?

However, I still lack the necessary information to convert the amplitude based measurement (with window correction) to a power based measurement. In particular, I am using Blackman-Harris windowing. The links you gave in a previous message (from siemans) do not specify an amplitude correction factor for Blackman-Harris, so I don't know what value to use as a multiplier to back out the correction PicoScope 6 has applied. Also, there are variations of Blackman-Harris (see table 1 in this paper by Harris). It identifies two variants: 1) minimum 3-sample Blackman-Harris, and 2) minimum 4-sample Blackman-Harris. These variants have different power correction factors. I need to know which of these (or perhaps another) variant PicoScope 6 is using in order to apply the appropriate correction.

Regards,

Dan

Post Reply