MATLAB Answers

Calculate windowing correction factor

385 views (last 30 days)
acegi bdegi
acegi bdegi on 12 Dec 2017
Edited: Michael on 20 Jan 2020
When using windows on my signal, I want to use a correction factor to correct either the energy or the amplitude for the window. When using the ratio mean(rectangular window) / mean(modified window), where mean(rectwin) = 1, to calculate the amplitude correction factor (ACF), it works well for both the Hanning and Hamming window, if I compare the results with the table in this link. But for the flattop window and the Blackman window, the results are not the same. Same goes for the energy correction factor (ECF) if I use the ratio rms(rectangular window) / rms(modified window), where rms(rectwin) = 1.
This is the code I use to calculate the correction factors
N = 2^10;
w = hanning(N);
rms_w = rms(w);
ECF = 1/rms_w
mean_w = mean(w);
ACF = 1/mean_w
This gives me ECF = 1.6322 and ACF = 1.9980 for the Hanning window, which is the same values as the table (ECF = 1.63 and ACF = 2). So I might say I'm doing the calculation right. But for the flat top window, using w = flattopwin(N), the results are ECF = 2.3901 and ACF = 4.6432, which should be ECF = 2.26 and ACF = 4.18. But when facing the flat top window, it has negative values as well. I am not sure if I have to use this negative values or the absolute values for calculating the ACF. When using w = abs(w), ACF = 3.9810, which is still not the same as the table. And besides that, I cannot substantiate to use the absolute value. The values for the ECF and ACF when using the blackman window by using the command w = blackman(N) gives ECF = 1.8128 and ACF = 2.3833, which should be ECF = 1.97 and ACF = 2.80.
Are the flat top window and blackman window used in MATLAB, the same as used in this table?
What am I doing wrong here?
Can someone help me please?
  4 Comments
acegi bdegi
acegi bdegi on 2 Jan 2018
Thanks, but it's not an evidence but a guess. A guess is not enough for my final report. I showed in my script that the rms value of the FFT of the signal is nearly the same (~1.0 ratio) as the rms value of the corrected windowed FFT of the signal. Since rms value stands for the energy of the graph, can I state that the correction factor is calculated correctly? If yes, the values in the table are indeed not correct and I have proved that the energy (rms) is the same after applying the windowed correction factor and therefore the window correction factor is correct.

Sign in to comment.

Answers (4)

Ameen Muhammed
Ameen Muhammed on 17 Feb 2019
According to [1] eq. 9.23 amplitude correction of window effect is give by
Check [1] for proof.
[1] Brandt, A., 2011. Noise and vibration analysis: signal analysis and experimental procedures. John Wiley & Sons.
This simply evaluates to
ns = 1000;
w = hann(ns);
Aw=length(w)/sum(w);
This equation gives slightly different results than values reported in Siemens PLM blog
windoCorFactor.PNG
The equation above gives the following values
Window | Amplitude Correction
------------------------------------------------------
Hanning | 2.0020
Flattop | 4.6433
blackman | 2.3833
Hamming | 1.8534
  1 Comment
Michael
Michael on 20 Jan 2020
Good answer.
Just be aware in relation to reference [1] that one of the formulae shown later for power correction of windowing contains a typo that has not yet been picked up in the errata for the book.
Equation 9.33 of [1] wrongly defines the window normalised equivalent noise bandwidth as:
which should of course be
ie the window coefficients in the denominator are not squared before summing, only after.
  1. Brandt, A, 2011. Noise and vibration analysis: signal analysis and experimental procedures. John Wiley & Sons

Sign in to comment.


David Goodmanson
David Goodmanson on 3 Jan 2018
Hi acegi,
I don't think Christoph was guessing. Most of these window functions have adjustable parameters, subject to change. I would say that the differences are due to incomplete description of what you are operating on. Plus, you get to adjust the number of points you are doing the calculation with.
For example, the Blackman window on the Siemens site is probably the Blackman-Nuttall window (see 'window function wiki') which for a large number of points gives
acf = 2.7507 ...... ecf = 1.9567
but with 64 points this can be coaxed up to
acf = 2.7940 ...... ecf = 1.9720

Sudhar Ekanayake
Sudhar Ekanayake on 1 Jul 2018
Edited: Sudhar Ekanayake on 1 Jul 2018
Math Work has very poor documentation on this. Few things I am still having issues.
1) First you multiply your PSD by factor of 2.00 to take into account the effect of Nyquist Frequency. (I believe for pwelch, we don't need to multiply by 2.00, it is already accounted in the function ???)
2)Secondly if we use Hann window, we need to multiply by 1.5 (ENBW - Equivalent Noise Band Width) to accommodate the amplitude error OR multiply by 2.0 to accommodate the amplitude error ( see the figure)
3)Do we need to multiply 1.63 energy correction factor when calculating RMS ?
Are the ACF or ECF factors are the same despite the total signal length ? Or it is depended on the signal length and the window size ? Have I understood this correctly ?

Christian Hildebrand
Christian Hildebrand on 13 Nov 2019
I stumbled across this (old) question when doing research on window functions, hope someone finds this information helpful:
You have to correct the amplitude of the windowed time-signal because the window function introduces a constant offset (this is what the equation from Ameen does). Can be read in [p. 195, 1]. If you look at the help pages from matlab, e.g. https://de.mathworks.com/help/signal/ref/flattopwin.html for the Flat Top Window, you see that there is the constant coefficient , in this case 0.21557895. So for correct amplitudes you just have to multiply the time signal with .
The help pages always state the algorithm used for the window, so you should look there what constant value is used and use that in your code.
Example for Flat-Top Window:
%Create Signal
t=0:0.0001:0.1
y=0.5*square(2*pi*30e3*t) + 0.5;
%Create Flat-Top Window and apply
w = flattopwin(length(y))';
y = w.*y;
%Amplitude-Correction
y = y.*1/0.21557895;
[1]: M. Meyer. Signalverarbeitung: Analoge und digitale Signale, Systeme und Filter. Vieweg+Teubner Verlag, 2014.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by