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?