Amplifier gain measured with nanoVNA: fundamental issue  - Page 1
Forum section: electronics / rf-microwave

author: kronos
author_rank: Contributor
timestamp: November 05, 2021, 05:45:46 pm
content: Hello,I am interested in RF amplifiers (small signal), and are new to this. I built 2 amplifiers, the second one performs much better; 20 dB gain, broadband, and it reaches 110 MHz or so. A lot for me.I have found a problem when measuring its gain with the nanoVNA. I placed a question in Beginners (https://www.eevblog.com/forum/beginners/amplifier-gain-measured-with-nanovna-fundamental-issue/), but I got no answer. Looking at the type of questions, it is possibly better in this group.My problem or doubt is the following.I want to measure the gain of the amplifier and plot it using a nanoVNA. First step is to perform a calibration of the nanoVNA (I do it from 1 to 150 MHz); when calibrating the through step, the connection looks like this (I am ignoring an attenuator at the amplifier input to avoid overload, for simplicity):The through-cable has 0 dB gain (or loss); the voltage at its input is Vi=Vs/2, that is, 6 dB lower than Vs: like a 6 dB loss. The nanoVNA measures the voltage at its input (S21) and calibrates knowing that the cable is 0 dB, so that although the total gain Vl/Vs is -6 dB, it shows 0 dB: it adds 6 dB to the measurement.So I now connect the amplifier. Assuming its input impedance Zin is 50 ohm, flat over frequency, the connection is now this:The amplifier has a flat gain of G db (G=Vl/Vi). Vi has a loss of 6 dB with respect to Vs, as before, so when the nanoVNA measures Vl/Vs it sees a total gain of G-6; it adds 6 dB, and shows a gain of G. All is OK.But now I connect an amplifier with a high input impedance; in the extreme case, Zin = ∞, so that Vi=Vs. There is now no loss w.r.t. Vs, the nanoVNA sees a signal that is 6 dB higher than the previous case, and it then shows a gain of G+6, which is wrong. This is actually what I see when I measure, the nanoVNA shows an excess gain of 6 dB compared to the gain I measure with the scope.Does this mean that I can only measure amplifier gain when Zin=50 ohm? Or am I missing something?But even if that is the case, the input impedance is not flat with frequency, it decays with frequency (in my case), distorting the Bode plot. So I can never measure amplifier gain with the nanoVNA! is this correct? It cannot be!

author: radiolistener
author_rank: Super Contributor
timestamp: November 05, 2021, 05:51:31 pm
content: Quote from: kronos on November 05, 2021, 05:45:46 pmyes, you're forgot to add attenuators on the amplifier output (to avoid NanoVNA overload or damage) and on amplifier input (to avoid amplifier overload).Now your NanoVNA may be damaged after that measurements. Check it.I recommend to use 10 dB attenuator on the amplifier input and 20 dB attenuator on the amplifier output for your case.You can put attenuators on NanoVNA connectors and calibrate it through attenuators.

author: kronos
author_rank: Contributor
timestamp: November 05, 2021, 06:29:16 pm
content: I put an attenuator (20 dB) at the VNA output, It is omitted from the scheme to make it clearer, but I mentioned it in the text.The amplifier output is very low level, it should not be a problem. Measurements with a 10 dB attenuator at the output of the amplifier yield the same results; I calibrated as you say between attenuators.I doubt that the nanoVNA is defective: it measures G+6 with and without attenuator at the amplifier output when the input impedance is high, and G when the input impedance of the amplifier is 50 ohm.

author: thinkfat
author_rank: Unknown
timestamp: November 05, 2021, 07:18:58 pm
content: The NanoVNA assumes a system impedance of 50 Ohms. This is what the "through" calibration is done against. So, yes, if you connect port 1 to a high impedance input, the measured gain will be incorrect.

author: kronos
author_rank: Contributor
timestamp: November 05, 2021, 08:17:01 pm
content: Quote from: thinkfat on November 05, 2021, 07:18:58 pmThis means that the input impedance of the amplifier must be 50 ohm. You cannot measure other amplifiers. OK.But the input impedance changes with frequency. Does that not distort the Bode plot? You can then never get a real frequency response of the amplifier with the nanoVNA.

author: Joel_Dunsmore
author_rank: Regular Contributor
timestamp: November 05, 2021, 08:24:08 pm
content: I learned this in my first amplifier design at HP, cascading 2 amplifiers and at low freq my gain was 6 dB higher than expected. When you connect the thru, Vi=Vs/2 because port 2 loads the source with 50 ohms; but when you connect your amplifier then Vi=Vs so the high impedance effect doubles the apparent input voltage, measuring with an Oscope which measures voltage gain and not power gain. Think if you measure a transformer with 2 turns. Your Vout will be 2x your Vin, so you will have voltage gain as measured on an oscilloscope, but you will not have any power gain. So, do you want to measure voltage gain or power gain? S21 power gain maybe be thought of as the amount of power at the output load of the amplifier compared to the amount of power to the 50 ohm load without the amplifier. It is a measure of the amount more power you put into the load. All other things (VNA source and load match being ideal) considered. Since the input voltage doubled with your amplifier as a load, the output voltage double and the output power went up 6 dB more than you expected based on an Oscope measure of Vout/Vin. But if you measured Vout/Vs you would see the gain is the same, I think. Note |S21|^2 is the actual power gain, where S21 is sqrt(power gain) or kind of voltage gain, but with an impedance included. But this is not the same as the power gain of the DUT where that is power delivered to a load divided by power absorbed by the input of the amplifier: for Hi Z this would tend to infinite. Rather it is the power at the load with the amplifier compared to the power at the load without the amplifier.

author: rf-messkopf
author_rank: Regular Contributor
timestamp: November 06, 2021, 12:35:20 am
content: As Joel has said, there are various gain notions which have to be distinguished carefully. There is, however, a close connection between power gain, i.e., the quotient \$G=P_{\rm L}/P_{\rm S}\$, where \$P_{\rm L}\$ is the power dissipated in the load, and \$P_{\rm S}\$ is the power delivered to the amplifier's input, and \$S_{21}\$. If the amplifier is fed from a source with impedance \$Z_{\rm S}\$ and is connected to a load \$Z_{\rm L}\$, then\[G=\frac{\lvert S_{21}\rvert^2\lvert1-\Gamma_{\rm L}\rvert^2}{(1-\lvert\Gamma_{\rm in}\rvert^2)\lvert1-S_{22}\Gamma_{\rm L}\rvert^2}.\]Here\[\Gamma_{\rm L}=\frac{Z_{\rm L}-Z_0}{Z_{\rm L}+Z_0}\]is the reflection factor of the load impedance relative to the system impedance \$Z_0\$, relative to which the S-parameters are taken (usually 50 Ohms), and\[\Gamma_{\rm in}=S_{11}+\frac{S_{21}S_{12}\Gamma_{\rm L}}{1-S_{22}\Gamma_{\rm L}}\]is the reflection factor looking into the amplifier input with the load \$Z_{\rm L}\$ attached. Notice that \$G\$ is independent of \$Z_{\rm S}\$.There is another notion of power gain, namely the quotient \$G_{\rm T}=P_{\rm L}/P_{\rm avail}\$, where \$P_{\rm avail}\$ is the power available from the source. This is known as transducer power gain. For this quantity we have\[G_{\rm T}=\frac{\lvert S_{21}\rvert^2(1-\lvert\Gamma_{\rm S}\rvert^2)(1-\lvert\Gamma_{\rm L}\rvert^2)}{\lvert1-\Gamma_{\rm S}\Gamma_{\rm in}\rvert^2\lvert1-S_{22}\Gamma_{\rm L}\rvert^2},\]where \$\Gamma_{\rm S}\$ is the reflection factor of \$Z_{\rm S}\$. This of course does depend on the source impedance. Notice that if \$Z_{\rm L}=Z_{\rm S}=Z_0\$, then \$G_{\rm T}=\lvert S_{21}\rvert^2\$, as is to be expected.Also notice that if \$Z_{\rm L}=Z_{\rm S}=Z_0\$ and the amplifier is matched at the input, i.e., \$S_{11}=0\$, then \$G=\lvert S_{21}\rvert^2\$.

author: richard.cs
author_rank: Super Contributor
timestamp: November 06, 2021, 11:52:44 am
content: Another thing to think about here - is your amplifier under test actually something intended to be used in a 50 Ohm system? If it is then the high input impedance is undesirable, because it means the amplifier performs less well than it could if the input were matched to 50 Ohms, simply because it is not absorbing all of the input power available. e.g. Consider if your amplifier Zin were say 800 Ohms then that does nearly give a doubling of input voltage from a 50 Ohm source, but a 1:16 impedance transformer (no power gain) placed at the input would allow you to have 4x the input voltage.Coming back to the original question, you can measure anything you like with a 50 Ohm VNA, and the measurement will tell you how that device will perform in a 50 Ohm system. If the device is not intended to be used that way, the measurement is still useful, but may need scaling.

author: RoV
author_rank: Regular Contributor
timestamp: November 06, 2021, 04:54:26 pm
content: I would say it in another way: you were expecting to measure voltage gain, but the VNA measures S-parameters instead, referred to a 50 ohm environment.In particular, S21 is the ratio of the voltage wave coming out of port 2, divided by the voltage wave entering port 1, all in a 50 ohm environment. Port 2 is actually loaded by 50 ohm by the VNA, so the numerator is the actual output voltage of your amplifier with 50 ohm load. However, the other term (denominator) equals the input voltage only if the amplifier input impedance is 50 ohm, otherwise you have mismatch, that causes a reflected wave to go back to VNA port 1: the input voltage is the sum of the 2 waves, forward and reflected.S11 measures the ratio of the reflected and forward voltage waves at port 1, so you can combine S11 and S21 to obtain the voltage gain.It's all about knowing what you are measuring... Look for the "scattering matrix" and you'll find a lot of information on this subject.

author: rf-messkopf
author_rank: Regular Contributor
timestamp: November 06, 2021, 07:18:21 pm
content: Quote from: richard.cs on November 06, 2021, 11:52:44 amThis is true, but only if the device under test can be considered to be sufficiently linear. Then the connection between the various power gains and the S-parameters I wrote about above holds true. However, for a nonlinear device, presenting a different impedance at the input or output may alter its characteristics, and the S-parameters taken with respect to 50 Ohms can become irrelevant for that situation.In practice, when the amplifier is class A and is operated far away from saturation, you can characterize it by the usual linear S-parameters and calculate various power gains, or stability circles, etc., from them. For a class E amplifier, for example, this is no longer possible. It you want to characterize such a device away from 50 Ohms and optimize for gain, you will need a load pull test setup.

author: kronos
author_rank: Contributor
timestamp: November 06, 2021, 07:29:29 pm
content: Thank you all for the replies. I think my key messages are "amount of power at the output load of the amplifier compared to the amount of power to the 50 ohm load without the amplifier", "you can measure anything you like with a 50 Ohm VNA, and the measurement will tell you how that device will perform in a 50 Ohm system", "you were expecting to measure voltage gain, but the VNA measures S-parameters instead, referred to a 50 ohm environment".rf-messkopf, I have to go very slowly through your formulae. I am currently unable to derive them from my theory knowledge. I fail to see for example why \$\Gamma_{in}\$ does not involve the input impedance of the amplifier.

author: rf-messkopf
author_rank: Regular Contributor
timestamp: November 06, 2021, 07:51:48 pm
content: Quote from: kronos on November 06, 2021, 07:29:29 pmThe derivation is (well, at least in in principle) not difficult, but perhaps a bit involved and too much at the beginning. See any good introductory book on microwave engineering for a derivation. You have to keep in mind that S-parameters are defined in terms of the incident and reflected wave quantities (corresponding to waves traveling to the right and left on a transmission line), and not primarily in terms of voltage and current at the port. On a TEM line you can convert the wave quantities to voltage and current, but traveling waves are a different and more general concept, and can be defined in situations when there is no voltage and/or current, e.g. in a waveguide or an optical fiber. The Wikipedia article (https://en.wikipedia.org/wiki/Scattering_parameters) shows the conversion to voltage and current in the TEM situation.Quote from: kronos on November 06, 2021, 07:29:29 pmIt does depend on the input impedance. \$\Gamma_{\rm in}\$ depends on \$S_{11}\$, which is the input reflection factor of the amplifier, and this is connected to its input impedance \$Z_{\rm in}\$ by way of\[\Gamma_{\rm in}=\frac{Z_{\rm in}-Z_0}{Z_{\rm in}+Z_0}.\]The second term in\[\Gamma_{\rm in}=S_{11}+\frac{S_{21}S_{12}\Gamma_{\rm L}}{1-S_{22}\Gamma_{\rm L}}\]is the influence of the output of the amplifier on the input. It vanishes if the amplifier is unidirectional i.e., if \$S_{12}=0\$.

author: joeqsmith
author_rank: Super Contributor
timestamp: November 06, 2021, 08:36:13 pm
content: Just another paper on the subject.https://www3.nd.edu/~hscdlab/pages/courses/microwaves/EE40458_11-13-15-2018.pdf

author: G0HZU
author_rank: Super Contributor
timestamp: November 06, 2021, 09:31:57 pm
content: QuoteYes, you are missing that there is always the option to measure all four s-parameters of the amplifier. However, for high input impedance amplifiers this can be a problem even for a lab VNA especially at low frequencies (eg <30MHz).Up at VHF a VNA can usually do a decent job of measuring s-parameters of the active device alone, eg a JFET or a dual gate mosfet can be measured in isolation in a test fixture with a VNA and the results should be quite good. This is often more powerful than just measuring the complete amplifier circuit.A nanoVNA would struggle with a JFET or MOSFET even at VHF (say 50-150MHz) for various reasons but it could probably produce a reasonable two port model of a JFET or dual gate mosfet across this frequency range.Once you have the model you can use it as a component in a circuit simulation and add resistors, inductors or capacitors. You can change the port impedance to something lower or higher (within sensible limits) and see what gain the amplifier stage can produce.So you are not confined to the limits of a 50R test environment environment at all as long as you make full use of the VNA. A VNA is a very powerful tool when used to its full potential. The next generation of nanoVNAs will hopefully make this process easier and with even higher levels of performance.

author: G0HZU
author_rank: Super Contributor
timestamp: November 06, 2021, 10:34:40 pm
content: I suppose the extreme case would be to try and use a VNA to try and find the highest frequency a transistor circuit could oscillate when used in various circuit configurations that are not confined to 50 ohms.This would require the transistor to be configured as an amplifier with >unity power gain and the correct phase response at the oscillation frequency. If all four s-parameters are taken of the transistor (say as common emitter or common collector at a certain Vce and Ic) then it should be possible to get a good idea how high in frequency the device can oscillate when reconfigured in an oscillator circuit at the same Vce and Ic.The results can be surprising. Eg a jellybean 2N3904 BJT can easily oscillate at 800MHz and this can be predicted using a VNA derived 2 port model of a 2N3904 taken between the VNA's 50R test ports. This can often get you fairly close to the upper limit for the device. 1GHz is probably a realistic upper limit for oscillation for the 2N3904 assuming a sensible Vce and Ic is used.This type of measurement/modelling of a 2N3904 is probably beyond even the nanoVNA V2 but I've never tried one. A reasonably decent lab VNA can get you close to the answer.

author: kronos
author_rank: Contributor
timestamp: November 07, 2021, 11:19:58 am
content: Quote from: joeqsmith on November 06, 2021, 08:36:13 pmThis paper is great, thanks. I can even follow it.Quote from: rf-messkopf on November 06, 2021, 07:51:48 pmI was convinced that \$\Gamma_{\rm in}=S_{11}\$, i.e., the nanoVNA measures \$\Gamma_{\rm in}\$ and this is what it uses to display the Smith Chart . I see that I was forgetting about the reverse transmission; it is probably a good aproximation in practical cases when \$S_{12}\approx 0\$, but it is only an approximation.

author: rf-messkopf
author_rank: Regular Contributor
timestamp: November 07, 2021, 06:35:12 pm
content: Quote from: kronos on November 07, 2021, 11:19:58 amUnfortunately one cannot assume that this is a good approximation for amplifiers in the hundreds of MHz range. It may well be true that the magnitude of \$S_{12}\$ is 40 or 50 dB below the magnitude of \$S_{21}\$. However, in the above formula for \$\Gamma_{\rm in}\$ the product \$S_{12}S_{21}\$ appears, and this need no longer be small, even if \$\lvert S_{12}\rvert\ll1\$.In fact, if \$\lvert\Gamma_{\rm in}\rvert<1\$ and \$\lvert\Gamma_{\rm out}\rvert<1\$, then the amplifier would be unconditionally stable. More often than not this is not the case, unless it is designed for that property.Edit:The amplifier is unconditionally stable if and only if \$\lvert\Gamma_{\rm in}\rvert<1\$ and \$\lvert\Gamma_{\rm out}\rvert<1\$ holds for any source and load impedance. If these inequalities only hold for a particular pair of source and load impedances, one can only conclude that the amplifier will be stable with these impedances.

author: G0HZU
author_rank: Super Contributor
timestamp: November 07, 2021, 07:05:24 pm
content: These issues reinforce the desirability to measure all four s-parameters rather than just s11 and s21. This allows these things to be explored on a simulator after exporting the s2p file from the VNA. Hopefully the next generation nanovnas will not be T/R VNAs and will offer full 2 port capability and make this process easier and faster.

author: RoV
author_rank: Regular Contributor
timestamp: November 07, 2021, 09:59:17 pm
content: However, don't forget that, when the DUT is connected to the VNA, gammaL = 0, because it's the 50 ohm load of VNA port 2, so S11=gammaIn. Obviously this is true only for 50 ohm load, but it's exactly what the VNA is measuring: the reflection coefficient at port 1.

author: G0HZU
author_rank: Super Contributor
timestamp: November 07, 2021, 10:36:19 pm
content: Agreed although I think we all know the nanovnaH doesn't have good port 2 VSWR at mid/high VHF. I think most people add an attenuator to improve this or replace port 2 with a decent 50R termination for this measurement.My first VNA was an old HP 8714B T/R VNA and that is how I used to measure s11 (with a good quality attenuator inline at port 2)I found I could measure all four s-parameters quite well with the 8714B as long as I did this. It was a bit fiddly doing the fixture swap around each time but it did give acceptable results. I've done the same with my nanoVNA quite a few times and the results have been quite good well up into the VHF band.

author: G0HZU
author_rank: Super Contributor
timestamp: November 07, 2021, 10:48:10 pm
content: Here's an old youtube demo where I measured a small 49:1 transformer with the nanovna H. Because I measured all four s-parameters I was able to change the port 2 impedance in the simulator and predict the insertion loss for the transformer when correctly terminated in 2450R.Sadly, this isn't an amplifier example but it does show that you can measure power transfer with a VNA if you measure all four s-parameters and then post process the result in a simulator like in the example below. Sorry, there's no sound, I didn't have a setup that could record audio at the time.At about 0:49 in the video you can see that by changing the port 2 impedance to 2450R the insertion loss of the transformer was in very close agreement with an alternative measurement method using a lab VNA and a 2400R resistor inline.At 1:22 in the video you can see I also optimised the port 1 impedance away from 50R to a complex impedance to get even lower insertion loss through the transformer at lower frequencies.So that shows an example where a full two port measurement using the nanovna can be used to measure the power transfer for a part that normally has one port at 2450 ohms.

author: rf-messkopf
author_rank: Regular Contributor
timestamp: November 07, 2021, 11:03:32 pm
content: Quote from: G0HZU on November 07, 2021, 10:36:19 pmBut as far as I'm aware the nanoVNA does support full two-port calibration in one direction with the usual 6-term error model in its firmware. The load match error of the receive port is therefore corrected, even though the physical port may off. Accuracy then becomes a matter of the cal kit.As was said above, this only works out perfectly for a linear DUT. But a transistor may behave differently when the physical load impedance is varied. Even though the error will be negligible if the transistor is operated such that the small-signal approximation applies.But it is true that the reference impedance \$Z_0\$ is somewhat arbitrary. The S-parameters as well as the reflection coefficients can be transformed to an impedance base different from 50 Ohms. See any introductory text on microwave engineering or simply use your favourite simulation package.

author: G0HZU
author_rank: Super Contributor
timestamp: November 08, 2021, 05:42:36 pm
content: QuoteOk, thanks. I may be a bit behind the times as my nanovna is still running early firmware. Is this supported in all versions of firmware?A while back I wrote my own PC software to control the nanovna and do the calibration process and this allows fixture reversal. I've stuck with early firmware because I found that it performed better on critical measurements where the mag of the reflection coefficient was near to 1.One thing I found a bit strange was that I did notice that the edelay command doesn't behave the way I expect. I have to include a scaling factor for edelay to get it to do what I expect. I have tried newer firmware but the edelay issue was still present.