Products > Test Equipment
Pocket-Sized 6 GHz 1 TS/s ET Scope
joeqsmith:
It's VERY possible the problem is in my software, which is why I wanted to use yours to collect the data. Best to divide these problems in half.
I am not fitting the data. Rather I simply use linear interpolation. Corrected previous statement, there is no fitter Using this, with a 1GHz full scale signal applied, I measure -36.6dB for THD. The published measured value was -37.65 +/-12dB. Being the lazy person I am, I called it a day.
Let me try adding a gaussian fit like was first mentioned and see if it improves things.
***
A new day.
From the manual:
--- Quote ---you can recover the signal voltage V0 by interpolating between the two neighboring voltages where F(V ;Δt) first transitions from below 1/2 to above 1/2.
--- End quote ---
--- Quote from: SJL-Instruments on January 27, 2024, 07:22:10 am ---...
2. If two or more voltages in the CDF are equal, sort the corresponding CDF values (for that voltage value) from lowest to highest. If the interpolation is done in an incorrect order, a large apparent spike may result (example 2, attached).
These considerations do not apply if you directly fit an error function to the CDF data.
We just discovered effect (2) recently, so we may send you an updated firmware file tomorrow that implements this sorting for you.
--- End quote ---
--- Quote from: SJL-Instruments on January 17, 2024, 01:54:05 am ---...
--- Quote from: joeqsmith on January 17, 2024, 01:37:32 am ---Do you always use a Gaussian fit to get the centroid?
--- End quote ---
A bit complicated, but details if you're interested: to a first approximation, you can use the interpolation procedure we described in the last post. This usually gets you close, but the noise performance is poor since you're only using two samples.
Fitting a Gaussian error function is theoretically the best thing to do (in the sense of Fisher information), but in practice is overly sensitive to outliers on the wings. What we've found works well in practice is to fit a line to the inverse Gaussian CDF applied to the data, but truncated within a certain region (say 10-90%) of the CDF, with the truncation also seeded by the interpolation method. (This is also faster on the CPU.) You need to weight samples with some care to maintain equal sensitivity to all values (which minimizes the total propagated noise, and improves outlier robustness).
This gives a significantly lower noise floor than the interpolation method alone, but is still robust to spurious errors.
--- End quote ---
Attached plot shows a typical CDF values (WHITE) that appear out of order. The GigaWave has all the recent patches. If I don't sort them, and weigh CDF values that are outside of the 5-95% at 0 (no effect), all others inside the window weighted at 1, then run a linear fit (RED). Then interpolate the fitted data to find the centroid index. Use that index and linear interpolation to determine the voltage. The two numbers are close. Also shown using 10/90% window, same weighting, with sorting CDF.
First, do I always need to sort the CDF values? Is there a problem that I am seeing what appears to be out of order data?
With this calculation being crucial, it seems that for anyone wanting to reproduce the result obtained using your software, your conversion needs to be well documented.
joeqsmith:
Plot comparing the linear and gaussian fit with sorted CDF and 10/90% window, 0 weight for anything outside. Again, linear interpolation used to locate mid point.
I have not tried these in my software to see which is more robust. Rather I would like to replicate what your software does.
At some point, when I start working on the review (remember the review?), I am guessing there will be tests I want to conduct that your software does not support. For example, maybe I decide to show the THD. Your software does not have this feature built-in. To automate such measurements, my software will need to replicate your results.
SJL-Instruments:
--- Quote from: joeqsmith on January 29, 2024, 12:57:01 pm ---First, do I always need to sort the CDF values? Is there a problem that I am seeing what appears to be out of order data?
--- End quote ---
Do not sort the CDF data. The out-of-order points are expected, and result from noise in the signal. (More precisely, the integrated portion of the low-frequency content up to the sampling timescale, Section 2.2.2.)
If you set Nmin=Nmax=N0 (fixed triggers per sample), the noise in the CDF will go to zero as N0 -> infinity.
--- Quote from: joeqsmith on January 29, 2024, 12:57:01 pm ---Plot comparing the linear and gaussian fit with sorted CDF and 10/90% window, 0 weight for anything outside. Again, linear interpolation used to locate mid point.
I have not tried these in my software to see which is more robust. Rather I would like to replicate what your software does.
--- End quote ---
You should not fit a line or a Gaussian to the CDF data. You should fit a Gaussian error function, of the form:
f(x) = 1/2 (1 + erf(A(x-x0)))
where A and x0 are free parameters. The fitted value of x0 is the extracted voltage.
We've added a section laying this out clearly in the next manual revision (see attached image).
There have been enough updates that we've released revision H6 of the manual, which contains this explanation.
joeqsmith:
Thanks. This helps.
Could you do me a favor and write a simple program that maybe reads one of the streamed CSV files from your software, performs the calculations (identical to how your software works) and shows the result? I wouldn't care if you released the source or not although it may be helpful to have it. Basically, I want to prove that we obtain the same results.
Reminds me of a few years ago, I ran into a similar problem where a coworker was using MatLab's filtfilt function and I was attempting to replicate their algorithms.
https://www.eevblog.com/forum/chat/matlab-zero-phase-digital-filtering-question/msg4429354/#msg4429354
I got lucky in that case as someone had found a document that detailed how it worked. I did something similar where I fed data through both algorithms to prove out my math.
***
Another option you may want to consider is where you provide interface libraries for the different OSs you support. This would give you total control over the algorithms and takes that burden away from customers. Personally, I see it as a wash, as long as you provide enough detail to implement your exact algorithms.
Also, personally I like having the PC make all of these calculations rather than the embedded system. Why not leverage the latest PC technology. I have to believe it also makes your job much easier by minimizing the complexity of the firmware. I think about that NanoVNA and just how unstable that firmware was.
SJL-Instruments:
--- Quote from: joeqsmith on January 29, 2024, 02:47:35 pm ---Could you do me a favor and write a simple program that maybe reads one of the streamed CSV files from your software, performs the calculations (identical to how your software works) and shows the result? I wouldn't care if you released the source or not although it may be helpful to have it. Basically, I want to prove that we obtain the same results.
--- End quote ---
Here's an open-source CoLab notebook that implements both the linear interpolation and curve fit methods:
https://colab.research.google.com/drive/1wAReesZiEhuauzbm_8LAfhkgA2IYOyij?usp=sharing
There's a sample file in the notebook if you just want to check your code.
If you want to use your own data, you will need to select "Raw CDF Data" when exporting/streaming to get a .npz file. The CSV files only contain the extracted voltage information (no CDFs).
You might want to check your linear interpolation code as well - we didn't see any spikes even when re-analyzing all our past data using linear interpolation. (The noise was a bit higher, though.)
--- Quote from: joeqsmith on January 29, 2024, 02:47:35 pm ---Another option you may want to consider is where you provide interface libraries for the different OSs you support. This would give you total control over the algorithms and takes that burden away from customers. Personally, I see it as a wash, as long as you provide enough detail to implement your exact algorithms.
--- End quote ---
Our Python API is cross-platform and implements the curve fitting algorithm. We understand not everyone wants to use Python, though - the description in manual revision H6 is hopefully clear enough to implement yourself.
--- Quote from: joeqsmith on January 29, 2024, 02:47:35 pm ---Also, personally I like having the PC make all of these calculations rather than the embedded system. Why not leverage the latest PC technology. I have to believe it also makes your job much easier by minimizing the complexity of the firmware. I think about that NanoVNA and just how unstable that firmware was.
--- End quote ---
That's our philosophy as well. Software is much easier to update, lowers the end-user cost of the hardware, and gives the user more flexibility if they need it (as you've been doing in LabView). :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version