The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 19th, 2024, 3:50am
Pages: 1
Send Topic Print
simulating behavioral lna gives wrong results (Read 11517 times)
Jochen
Junior Member
**
Offline



Posts: 11
Nuremberg, Germany
simulating behavioral lna gives wrong results
Nov 06th, 2006, 6:09am
 
Hello everyone!

I am developing a behavioral model of a lna similar to "LNA_PB" from Ken Kunderts Paper "Modeling RF Systems" from section modeling. When simulating this model (LNA_PB) I am not getting the specified noise figure and ip3.
My results differ in +1.25db for ip3 and +0.2db for noise figure.
I used noise-free load resistors.

I have used qpss, pss and pnoise simulation in spectre/cadence with settings as advised for lnas in the cadence papers. The difference remained...
I guess, there is something wrong with my simulation setup?

Could someone help me? Any hint appreciated!
Did someone experience the same problems?

Thank you,
Jochen
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: simulating behavioral lna gives wrong results
Reply #1 - Nov 6th, 2006, 9:42am
 
Actually, Jess Chen wrote "Modeling RF Systems" (http://www.designers-guide.org/Modeling/modeling-rf-systems.pdf).

There is no need to use noise-free load resistors. Spectre & SpectreRF properly account for noise in the load.

It would be helpful if you published your circuit and testbench. That way we could offer much more specific comments and suggestions.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
Eugene
Senior Member
****
Offline



Posts: 262

Re: simulating behavioral lna gives wrong results
Reply #2 - Nov 6th, 2006, 11:33am
 
Ken is right. It would be easier if we could see your setup. However, without seeing your setup, I would suggest three things:

1. For IIP3, make sure your extrapolation point is in the linear region. You should do a wide enough power sweep to reveal the linear region.

2. SpectreRF has evolved since the Cadence documentation you probably read was written. You might want to try different numerical options to see if the error goes away.

3. For noise figure, 0.2 dB sounds like it might be a noise temperature issue. If your specified noise figure is low, like 2dB as I recall, and you use default driving port and simulator temperatures, you will see errors on the order of 0.2dB because the noise inside the LNA_PB model is computed assuming the port temperature is the same as the simulator temperature. But in fact, the port temperature is 16.85 degrees C and the simulator temperature is 27 degrees C. You can check this by either changing the port's noise temperature to 27 C or the analysis options temperature to 16.85 degrees C. I think there may be a low priority PCR on this error.
Back to top
 
 
View Profile   IP Logged
Jochen
Junior Member
**
Offline



Posts: 11
Nuremberg, Germany
Re: simulating behavioral lna gives wrong results
Reply #3 - Nov 7th, 2006, 2:47am
 
Thank you for engaging with my problem, Eugene and Ken!

I must admit that I confused the authors, read so many papers in the last days...

Eugene, your hint was the right one! I changed my port temperature to 27 and now the deviation is almost zero (0.0002db). Thank you! I was guessing that it must be such an easy error.

For my IIP3-Deviation I will post a proper description of my setup:
Simulation Settings:
port:       prf = -40(dbm), frf1 = 1.9G, frf2 = 2.0G
LNA_PB:  nf = 0, ip3 = -10, gain = 20

qpss settings:
shooting
frf1      large         5 (harms)
frf2      moderate      3 (harms)

harmonics: default, <blank>
accuracy: conservative
sweep: prf, -40:5, step size 1

- additional stabilization time: 2n            -> no change of results
- flexible balance                                -> no change
- interchanging  moderate <-> large    -> no change
- different settings for harms               -> no change
- with pss (both signals large):             -> huge difference for measured ip3, about 8db

Direct Plot Form:
Differential Nets, 100M (Ohm), extrapolation point: -40 (must be linear region)

LNA_PB:
without clamping for more conventional look of curves!
code below


Hope now it is clearer what I am doing (wrongly).
Thanks for your help in advance!

Jochen

Testbench:

----LNA_PB-------------------------------------------------------------------
Code:
`include "constants.h"
`include "discipline.h"

module LNA_PB(I_in, I_out, Q_in, Q_out);

inout I_in, Q_in, I_out, Q_out;
electrical I_in, Q_in, I_out, Q_out, I_inn;
parameter real gain = 30;                   // Gain in dB.
parameter real ip3 	= -20;                   // 3rd order intercept point in dBm.
parameter real rin 	= 50 from (0:inf);        // Input resistance in Ohms.
parameter real rout = 50 from (0:inf);       // Output resistance in Ohms.
parameter real nf 	= 10 from [0:inf];         // Noise figure in dB.
real a, c, ip, rho, rhooutmax, rhoinmax, rhoout, noise_voltage_squared, rnf;

analog begin
	    // Convert the input parameters from engineering units to implementation units.
      @(initial_step) begin
           a = pow(10,gain/20);
           rnf = pow(10,nf/10);
           c = a*(4/3)/(pow(10,ip3/10)*2*50*0.001); // 50 Ohm ref. assumed.
           // Compute the critical point.
           rhoinmax = sqrt(a/(3*c));
           rhooutmax = (2*a/3)*rhoinmax;
           noise_voltage_squared = 4*(rnf-1)*`P_K*$temperature*50;
					 $strobe("input_noise_pwr = %E", noise_voltage_squared);		//display input_noise_pwr
      end

      // Assign the input voltage to the variable, rho
      rho = V(I_inn, Q_in);  

      // Apply the third order non-linearity. Clamp the output for extreme inputs.
    //if (abs(rho) < rhoinmax )
			rhoout = (a - c*rho*rho)*rho;						//for testing
    //else if (rho >0) rhoout = rhooutmax;
    //else rhoout = -rhooutmax;

      // Load the input with the input resistance, rin.
      I(I_inn, Q_in) <+ V(I_inn, Q_in)/rin;
      // Apply the output signal to the output terminal through the output resistance, rout.
      I(I_out, Q_out) <+ (-rhoout + V(I_out, Q_out))/rout;

      // Apply the noise source. The noise source lies between the input resistance and
      // rho definition to make the noise independent of the source resistance.
      V(I_in, I_inn) <+ white_noise(noise_voltage_squared, "LNA_PB");
 end
 endmodule
 

Back to top
 

testbench.JPG
View Profile   IP Logged
Jochen
Junior Member
**
Offline



Posts: 11
Nuremberg, Germany
Re: simulating behavioral lna gives wrong results
Reply #4 - Nov 7th, 2006, 2:48am
 
and a picture of my ip3-simulation:
Back to top
 

ip3-sim.JPG
View Profile   IP Logged
Eugene
Senior Member
****
Offline



Posts: 262

Re: simulating behavioral lna gives wrong results
Reply #5 - Nov 7th, 2006, 2:26pm
 
Looking at your modified LNA_PB model, it seems you commented out the nonlinearity. Are you sure you posted the right model?
Back to top
 
 
View Profile   IP Logged
Jochen
Junior Member
**
Offline



Posts: 11
Nuremberg, Germany
Re: simulating behavioral lna gives wrong results
Reply #6 - Nov 8th, 2006, 1:01am
 
Yes, I am sure. Only the clamping is commented out. The nonlinearity is still included:
Code:
rhoout = (a - c*rho*rho)*rho; 

where rho means voltage_in and rhoout is voltage_out

Otherwise the output of the lna (blue line in ip3-sim.jpg) would be linear and not like it is!

Jochen
Back to top
 
 
View Profile   IP Logged
Eugene
Senior Member
****
Offline



Posts: 262

Re: simulating behavioral lna gives wrong results
Reply #7 - Nov 8th, 2006, 8:22am
 
Sorry, I scanned the code too quickly and missed the nonlinearity. I missed the blue curve too! Perhaps I need new glasses.

I don't see anything wrong with the model. I've used it before many times to produce the specified ip3. Did you try different numerical options? I would try one of the alternatives to the shooting method. I don't remeber their names but I've seen them make a difference.

You might also try different extrapolation points. The extrapolation point can be tricky. The extrapolation point must be low enough to avoid nonlinearity but high enough to avoid numerical problems.  I think yours is ok but you might try moving it around to ind out where it starts to significantly affect your ip3 simulation.

Another option is to try another method for simulating ip3. I have not used SpectreRF for a while. When I simulated IP3, I used the PSS/PAC approach outlined in the SpectreRF user's guide. I believe there's also a writeup in the rflib documentation on the model you are using.
Back to top
 
 
View Profile   IP Logged
Jochen
Junior Member
**
Offline



Posts: 11
Nuremberg, Germany
Re: simulating behavioral lna gives wrong results
Reply #8 - Nov 10th, 2006, 4:52am
 
Thanks for your advice, Eugene, but nothing changed:
I tried the flexible balance option, swept the extrapolation point over the full range and used the pss/pac-"rapid ip3" simulation approach. This approach is also described in a paper on this webpage: http://www.designers-guide.org/Analysis/intercept-point.pdf

I achieved alwas a difference of +1.25 db for the simulated ip3.

I believe that something is wrong with my simulation setup or testbench. You wrote the model delivered correct ip3 in your simulations. So there cannot be the source for the error...
Back to top
 
 
View Profile   IP Logged
Eugene
Senior Member
****
Offline



Posts: 262

Re: simulating behavioral lna gives wrong results
Reply #9 - Nov 10th, 2006, 7:29pm
 
I have two more suggestions.

1. Try driving it with one tone. Sweep the power of the input and compute the input referred one dB compression point. Since the model is a simple 3rd order nonlinearity, the compression point should lie 9.6dB below the specified IIP3. That will confirm that the model is OK.

2. If the model is not ok, it could be because you are using the wrong view. I notice that your model is differential. However, the original LNA_PB is single ended. The LNA_BB is differential and has a passband view. If you copied that cell to a new name, you may have dragged over both the veriloga and veriloga_PB views. The passband view I think you are trying to use is the veriloga_PB view. If you did not specify that in your view list or hierarchy editor, you would use the veriloga view by default. The veriloga view is the baseband equivalent view. I just checked the difference between the two views in a PI1dB testbench and saw about a 1.3dB difference in the compression point, which would translate into the same difference in the IIP3 simulations. The odd thing is that you got the right noise figure. If you were indeed using the baseband view you should have simulated a much higher noise figure, like 3dB higher.
Back to top
 
 
View Profile   IP Logged
Jochen
Junior Member
**
Offline



Posts: 11
Nuremberg, Germany
Re: simulating behavioral lna gives wrong results
Reply #10 - Nov 13th, 2006, 6:34am
 
Thank you for your efforts, Eugene!

I used your cp1-simulation approach to confirm wrong results of the verilog model. After detailed code debugging I have found the error now:
During the calculation of the 3rd order coefficient happens the miscalculation.
Code:
 c = a*(4/3)/(pow(10,ip3/10)*2*50*0.001);  



(4/3) evaluates to 1.0  because integer/integer evaluates to another integer!

The problem is solved through using:
(4.0/3)     or
(4.0/3.0)  or
4/3      <omitting the brackets>
in the equation.

I don't know if this problem occurs only in my simulator but I believe the origin is VerilogA.
Back to top
 
 
View Profile   IP Logged
Frank Wiedmann
Community Fellow
*****
Offline



Posts: 677
Munich, Germany
Re: simulating behavioral lna gives wrong results
Reply #11 - Nov 13th, 2006, 8:16am
 
Jochen wrote on Nov 13th, 2006, 6:34am:
I don't know if this problem occurs only in my simulator but I believe the origin is VerilogA.

This is standard behavior of many programming languages, see http://www.designers-guide.org/Forum/YaBB.pl?num=1124964940/11#11.
Back to top
 
 
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.