A customer writes with an issue related to amplitude errors they are seeing on frequency sweeps below 100 Hz. These can manifest as wildly wrong gain values. These are most often related to FFT size and/or window choice in some way. But a change will be made in 1.830 to help with the issue too.
The “AMP Frequency Response” plug-in was used to plot the gain of the QA401 in loopback mode, from 2 Hz to 100 Hz, log step, at 5 points per octave (this was at 48K sample rate with Hann windowing). These are likely reasonable settings for most, as these settings can deliver very good performance around 1 kHz
The resulting sweep appears as follows:
Notice above that the fuscia- and red-colored curve (256K FFT and 128K FFT respectively) are the only FFT sizes that didn’t show a discontinuity down to 2 Hz. Thr other plots, however, are very misleading.
What is going on here?
To understand this, let’s start with a moderate FFT size (16K) with a rectangle window (aka no window at all). As we set the measurement up, note we can see the resolution changing as we change FFT size. Below, the resolution is show as 2.92 Hz at 16K points. The resolution is the finest frequency the analyzer can resolve at the specified setting.
Next, let’s make a loopback measurement with a signal at -10 dBV that is 4 times our 2.92 Hz resolution, or 11.68 Hz. We measure a peak of -9.97 dB, which is a tiny 0.03 dB away from the expected value:
Next, let’s change the frequency to 5 times the 2.92 Hz resolution, or 14.6 Hz:
Again, the measurement above is spot on: just 0.01 dB error.
Now let’s make a measurement at a non-integer 4.5X our 2.92 Hz resolution, or 13.14 Hz. In order to do this, you need to have the “round to eliminate leakage” unchecked as shown in the Gen 1 settings:
The resulting plot is shown below. Note the measurement reported is more than 3 dB below our expected value. Why is this?
The reason, as you can see above, is because the frequency is straddling two bins. You can see both bins have a lot of energy present–almost equal amounts. The peak detect algorithm on the QA401 looks only for a nearby maximum. Thus, the error in reporting.
Now, if we double the size of the FFT, then the frequency we generated will be precisely in the 9th bin and the problem will be solved.
But what if we go to a 256K FFT (183 mHz resolution), and look at a tone in 76.5th bin, which would be 14.00 Hz:
The same problem appears again–more than 3dB error–even with a very high resolution!
How about if we switch to Hann window? It’s still not great…
How about Flat Top window?
Aha! That measurement is precisely as expected. Why? The answer is because the flat top window considers more bins–more than twice as many in fact–than the more popular window functions that might give better skirt performance.
A reasonable question is why not just change the algorithm on the QA401 to consider adjacent bins. While that could happen, I think the better answer is to use a window selection choice that matches with your measurement wants. The Flat Top is preferred for amplitude measurements primarily because it has very small ripple–it’s what you want if amplitude accuracy is your goal.
Formalizing what we just saw above…
If we want to make very high resolution measurements at low frequencies with smaller FFT sizes, then try the following:
- Use Flat Top window–it might give better performance than Hann
- Pick 8K FFT (or higher). This will give 5.85 Hz resolution.
- Step LINEARLY at a rate that equals an integer multiple of your resolution
- Pick a start frequency that is an integer multiple and at least 2X your resolution (2 * 5.85 Hz = 11.7 Hz). This ensures DC isn’t lumped into your first measurement
- Ensure ROUND TO ELIMINATE LEAKAGE is enabled in the Gen 1 setup.
(NOTE: Beginning with release 1.821 a change will be made so that your step rate needn’t be a integer multiple of the resolution. This is because the search window in the peak detect algorithm used in that plug-in will be opened from +/-5% to +/-10% [and all plug-ins will change to this window size]. The window exists so that harmonics aren’t ever considered under cases where heavy distortion is present).
Our settings are thus:
And the result is as follows:
Note that for the 64K FFT, the start frequency was 7.3 Hz (10X the resolution) and the step was 7.3 Hz too.
Release 1.821
Below is a plot from 1.821 comparing 8K Hann and 8K Flat Top using the following settings:
The plot below with the opened window shows Hann delivering a better result at 10 and 20 Hz
This should also help with log measurements at low frequencies.
Conclusion
Meaningful low frequency measurements can be made if the settings–including FFT size, step interval, and window choice–are made with an eye towards performance. Changes post 1.820 should help further and render moot much of above.
You might also consider making two measurements: A low-frequency measurement that uses linear steps and a slightly larger FFT size (covering ~5 to 100 Hz) and a high frequency measurement covering the remaining spectrum. The high frequency measurement could use a smaller FFT and log steps to speed the measurements. Both traces can be placed on the same graph. This gives the resolution you want at the low frequencies and the speed you want at the high frequencies.