Determining SOLT kit errors via basis pursuit - Page 1
Forum section: electronics / general

author: rhb
author_rank: Super Contributor
timestamp: October 04, 2019, 06:10:32 pm
content: I had a fresh think about the problem this morning. Generally motivated by the intense activity surrounding the nanoVNA.In particular, if one considers an SOLT as a series inductance and shunt inductance, capacitance and resistance with different delays for each of the 4 variables, one has a problem which is well suited to a sparse L1 pursuit solution as developed by Donoho and Candes.The theoretical results for all 4 cases are well known and causality imposes hard constraints on the relationship between the real and imaginary parts of the solution. This leads to a situation where one can solve for the errors in the SOLT cal kit independently of the errors in the VNA using linear programming and a typical desktop PC.Thus it should be possible to do an SOLT cal using less than perfect SOLT parts and compute on a PC the parameters needed to correct for errors of the SOLT kit.For the benefit of those not familiar with basis pursuit or sparse L1 pursuits in general, this amounts to solving the following problem.Of all the possible values of the delay and reactance of the 4 variables, which combination is the best fit to the data under the constraint that the answer must physically exist and must only include the effects of the cal kit?

author: W8BYA
author_rank: Newbie
timestamp: October 05, 2019, 10:08:58 pm
content: Of all the possible values of the delay and reactance of the 4 variables, which combination is the best fit to the data under the constraint that the answer must physically exist and must only include the effects of the cal kit?Hey there Reg ! After pondering this pursuit I have concluded it was time for some American Honey

author: rhb
author_rank: Super Contributor
timestamp: October 05, 2019, 10:44:58 pm
content: Here are TDR plots of the concept. Actual calculation would be done in the frequency domain. But it's easier to visualize the superposition of reflections in the time domain.On further analysis I concluded that a more complex model is desirable and no more difficult. So I plan to include all shunt and series parasitic terms which are appropriate for the case of an SOLT calibration.First the theoretical TDR for S-O-L including the parasitic inductance of the short and capacitance of the open. The exponential spike portion requires infinite bandwidth, so even with a 20 GHz SD-24 you tend not to see it. I'll set up the 11801 and post actual SMA-M SOL traces later.The connector also has parasitic resistance and reactance. Those effects are shown in this figure. The reason that all this can be separated is because of the reflection delay.Figures are from "Electronics Measurement and Instrumentation" by Oliver and Cage of HP.The mathematical foundations are presented in the attached papers by Donoho and Candes. Reading the proofs is optional. The introductions explain the concept well. Proving that is works and why is rather painful. these are just the tip of the iceberg. But like using an FFT, doing it in practice is easy.Reg

author: profdc9
author_rank: Frequent Contributor
timestamp: October 09, 2019, 03:07:07 am
content: I am familiar with the L1 basis pursuit and sparse reconstruction methods of Donoho and Candes.With only four standards, I think there is barely enough information to provide a six-point calibration uniquely (given that one only is finding S11 and S21). More data would be needed, but obtaining reliable standards would be tricky. Perhaps, for example, one could use shorted stubs of various lengths as standards, and try to fit the lengths of the stubs.I think L1 minimization is only good for sparse problems, and I don't think VNA calibration is sparse, unless you plan to basically only find a limited subset of calibration corrections that best correct the data. But if you want to find a fully dense set of calibration variables, there is no way around simply needing more data.The problem is highly nonlinear. One way to solve it in practice is to use iteratively reweighted least squares, which can be set up so that minimizes a L1 norm. This is a variation on the Levenberg-Marquardt method, where you would find the Jacobian matrix that describes the partial derivatives of the data with respect to the calibration parameters, and then do invert this matrix to solve for the best fit parameters, adjusting weights as you go to favor one parameter over the other, the parameters representing hypothesis about which model best fits the calibration standards.For the VNA I built, I wrote down a brief description of the calibration method I used. It was very simple and worked:https://github.com/profdc9/VNA/blob/master/doc/VNA%20calibration%20method.pdfMight I suggest that the NanoVNA (and my design) have some problems that probably make a method like this overkill and not likely to result in much improvement in practice? Designs using the SA612 are susceptible to thermal drift, even though they are partially thermally compensated. Also, the codec clock is not synchronized with the SI5351A clock on the NanoVNA, so there is phase error that accumulates over a longer interval. I have triggered the data acquisition off of the intermediate frequency signal to try to remedy this problem and have obtained higher dynamic range as a result.

author: OwO
author_rank: Super Contributor
timestamp: October 09, 2019, 05:04:39 am
content: In practice simply measuring a low loss stub (in addition to S,O,L) is enough to infer the parameters of the calibration kit. We know that |S11| of the stub will never be >1, and we know it's a decreasing function of frequency (and usually fairly smooth too). These two assumptions (if valid) will give you more information than only assuming measured networks are physical.

author: OwO
author_rank: Super Contributor
timestamp: October 09, 2019, 05:07:53 am
content: Quote from: profdc9 on October 09, 2019, 03:07:07 amNewer NanoVNA variants will have an addtional internal e-cal just like the Siglent which will remove the mixer's error contribution and eliminate temperature drift. The reference measurement takes care of phase drift between TCXO phase and RF phase.

author: profdc9
author_rank: Frequent Contributor
timestamp: October 09, 2019, 02:41:37 pm
content: I'm not saying the phase drift can't be corrected, but currently the clock to the TLV320 is just the clock from the processor, which isn't particularly accurate or stable. A perfect 10 kHz IF frequency from a perfectly stable TCXO is not going to be 10 kHz when sampled by the TLV320. If the reference and signal mesurements are demodulated using a sinusoidal demodulation assuming a pure frequency (as it appears to be in dsp.c) there is error. A FFT cross-correlation would do a better job, but is probably beyond the capability of the STM32F0 processor in a reasonable amount of time. The phase error accumulates over the entire interval over which a single frequency measurement is taken.

author: rhb
author_rank: Super Contributor
timestamp: October 09, 2019, 09:38:17 pm
content: In basis pursuit one computes the forward problem for a large set of possible cases. In the language of Mallat, this is called a "dictionary". The section on L1 pursuit in the 3rd ed of Mallat is the best general intro I know of.The inverse problem is then solved by selecting the combination which best fits the data under an L1 criterion. Thus the problem formulation is NP hard and solvable *only* if the solution is sparse which it implicitly is.As an example, consider a short as a lumped constant series resistance and inductance and shunt capacitance. To first order this is what one sees in a broadband TDR response. So each of the 3 terms has a phase shift term which multiplies it in the frequency domain. This leads to an equation of the general form:[ln(L) + T(L)] + [ln(R) + T(R)] + [ln(C) + T(C)] = ln(Reflected - Incident)where T(L), T(R) and T(C) are the phase shifts of the L, R & C terms. From a large number of values for each of the terms one selects the ones which minimize the error. That can be done by setting Ax=y such that each row of A is the LHS above, y is the RHS and then solving for an x vector with 6 non-zero terms by linear programming.The preceding is just a cartoon. It is *not* how one actually formulates the linear programming problem. In an actual formulation each row of A might have a million terms and there would be as many rows as there are measurement frequencies times the number of references (i.e. 3 for SOL and 4 for SOLT) In addition one would want to constrain the solution so that the imaginary part was the Hilbert transform of the real part and constrain the error terms in the VNA to be the same for all 4 measurements. So a very large and messy set of equations to solve. In practice, the only practical way to create the A matrix is to write a program to generate it.Mathematically this can be solved, however, computationally it may be intractably large without a very large memory machine. Whether it is feasible or not depends upon how large one has to make the search space. The TDR response gives approximate values for R,L & C and the associated delays. So it may be possible to significantly reduce the problem size. And if one is only solving for individual unit variations in precision devices, the search space gets smaller still.I was solving a very similar problem involving the exponential decline of fluid flow in porous media 6 years ago when I realized I'd been taught you couldn't do that. So I bought "A Mathematical Introduction to Compressive Sensing" by Foucart and Rauhut and spent the next 3 years reading 3000 pages of mathematics. Doing that alone without anyone to talk to was a very strange experience for someone with a BA in English lit. Unfortunately, oil and gas companies will not release detailed production data, so I never got to test the program I wrote with real data.

author: SilverSolder
author_rank: Super Contributor
timestamp: October 10, 2019, 01:19:28 pm
content: Not a math guy... so I don't understand why the SOLT problem isn't solvable analytically, rather than through searching?

author: rhb
author_rank: Super Contributor
timestamp: October 10, 2019, 06:49:41 pm
content: In general inverse problems don't have an analytic solution which is well behaved. For example:d = A*exp(a*t) + B*exp(b*t)That's the radioactive decay of two isotopes. In "Numerical Methods That Work" Foreman Acton advises the reader not to try to solve it. Send the person to the chemistry lab. Using L2 ( least summed squared error) it is hopelessly unstable. It's trivial to compute d, but solving for A, B, a, b & t is not .However, using L1 (least summed absolute error) it is trivial. The actual problem is L0 which is a search of all the possible answers. That problem is NP-hard. The discovery that L0 problems could be solved in L1 time was a major advance in applied mathematics.To solve the problem you compute exp(a*t) and exp(b*t) for all of the possible values of a & b which are known for the various isotopes and a range of times. You create an A matrix in which each row has a large number of entries for various values of a, b & t then you solve Ax=y by linear programming such that the x vector is all zeros except for a pair of non-zero values A & B. When you solve the problem the position of A & B in the x vector tells you what the the isotopes are and the age. A & B give you the relative proportions.I stumbled into this inverting the 1D heat equation which is an infinite sum of exponentials. I was getting spectacular results when I realized Acton had told me this was impossible. The mathematical proof of how and when it works is the most mind numbing math I've ever seen. The proof of a single theorem in one of Donoho's papers is 15 pages! After going through all that, Donoho quips that the reader will be relieved that the other two theorems are much shorter. In fact only 2-3 sentences each.In general there are many problems where there is an analytic solution if you know what the variables are, but no analytic solution going the other way and trying to find the variables. Such functions are the basis for modern cryptography where they are called trap door functions.Incidentally, sparse L1 pursuits were the basis for winning the Netflix prize by a team of mathematicians (from Bell Labs IIRC).Have Fun!Reg

author: SilverSolder
author_rank: Super Contributor
timestamp: October 11, 2019, 10:29:23 am
content: I hope I am seeing a glimmer of what you are trying to tell me - sometimes, there is "information loss" in an equation that delivers some output X, so you can't go backwards from X and recreate the original "rich" information (which could be several variables) that was the input to the equation in the first place?To take a simple example, a bit like power = I*VJust because you know the power is 200 watts, doesn't mean you know the voltage and current and it is in fact impossible to figure out, you have lost information by calculating the power.Is there a generic name for equations that are "bidirectional" vs. the ones that are "lossy"?

author: MiDi
author_rank: Frequent Contributor
timestamp: October 11, 2019, 12:03:13 pm
content: Quote from: SilverSolder on October 11, 2019, 10:29:23 amThe keyword is bijection or bijective function.P(I, V) = I x V is not bijective, whereas P(V) or P(I) = I x V are bijective.