Hi @MarkT, I took a look at this in more detail today. Here’s the QA403 in loopback with HFT144D weighting straddling two bins (worst case). The amplitude here normalized to zero (but it shows 5.23 dBr, that’s because the energy compensation hasn’t been done yet):
And here’s the same measurement with the tone adjusted to land precisely in the center of a single bin. Note the amplitude is the same and in fact the spectrum is the same.
And for comparison, here’s the two traces plotted together. There’s really no difference, which is indeed impressive!
And just in case the 1/2 bin frequency difference above isn’t clear, here’s a zoom:
Now, there are a never-ending collection of windows. Rather than implementing dozens and playing whack-a-mole as new requests come in, I’m thinking that a small text file could be authored that would have the code for the weighting. For example, for the HFT144D, the file would be named (for example) HFT144D.cs
and would appear similar to this:
public static double[] ApplyWindow(this double[] timeSeries)
{
// HTF144D
double[] r = new double[timeSeries.Length];
for (int i = 0; i < timeSeries.Length; i++)
{
double z = 2 * Math.PI * (double)i / timeSeries.Length;
double wj = 1.0 - 1.96760033 * Math.Cos(z) + 1.57983607 * Math.Cos(2 * z) - 0.81123644 * Math.Cos(3 * z) + 0.22583558 * Math.Cos(4 * z) - 0.02773848 * Math.Cos(5 * z) + 0.00090360 * Math.Cos(6 * z);
r[i] = timeSeries[i] * wj;
}
return r;
}
If you selected the USER windowing option(which would replace Hamming), you’d be asked to pick a *.cs file, that file would be compiled by the QA40x at run time, errors (if any flagged), and then execute. Alternately, the files could be DLLs, but that would require the installation of Visual Studio.
Then, someone that wanted 50 custom windows could have 50 *.cs files, and each would have whatever it took to make the window they wanted. Then they’d load any one of those 50 files as required by analysis needs.
Probably the ability to specify a USER windowing would be enabled via command line switch at first. And at that point, HAMMING would be replaced with USER.
What do you think?