The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 16th, 2024, 8:15pm
Pages: 1
Send Topic Print
Help with Verilog -A:bandpass lna (Read 6081 times)
surer
New Member
*
Offline



Posts: 2

Help with Verilog -A:bandpass lna
Nov 28th, 2007, 4:16am
 
I want to realize a model of fo - >1GHz and bandwidth - > 100MHz low noise amplifier. But Ican't realize the bandpass characteristic and the flat bandwidth. Maybe the lowpass easy to realize?
post the code,and help me to modify.

`include "constants.vams"
`include "disciplines.vams"

module lna_single(rf_in,rf_out,gnd);
inout rf_in,rf_out,gnd;
electrical rf_in,rf_out,gnd;
electrical p1,p2,p3;

parameter real gain = 10;       //power gain in dB
parameter real r_in = 50 from (0:10K];   //input resistance in Ohms
parameter real r_out= 50 from (0:1M];  //output resistance in Ohms
parameter real iip3 = 10;       //input referred 3rd order intercept point in dBm
parameter real nf = 2.0 from (0:inf);    //noise figure in dB
parameter real fg = 1100M from [1M:20000M];
parameter real fc = 900M from [1M:19000M];
parameter real fb = 700M from [1M:19000M];
parameter real fa = 1300M from [1M:20000M];

real a,c,rnf,gain_lin,ip3_lin;
real inmax,outmax;
real noise_voltage_squared;
real zeros[0:1],poles[0:1];

analog begin
   //Convert the input parameter from engineering units to implementation units
   @(initial_step) begin
       gain_lin = pow(10,gain/10);
       ip3_lin = sqrt((pow(10,iip3/10))*2*r_in*0.001);
       rnf = pow(10,nf/10);
       noise_voltage_squared = 4*`P_K*(rnf-1)*$temperature*r_in;

       a = sqrt(gain_lin*r_out/r_in);    // voltage gain
       c = (4*a)/(3*ip3_lin*ip3_lin);  //

   // Compute the critical point
       inmax = sqrt(a/(3*c));
       outmax = (2*a*inmax)/3;
       
   // Define transfer function zero and pole
            zeros[0] = `M_TWO_PI*fa;
            zeros[1] = `M_TWO_PI*fb;
            poles[0] = `M_TWO_PI*fc;
            poles[1] = `M_TWO_PI*fg;
   end

   //add noise voltage source
       V(rf_in,p1) <+ white_noise (noise_voltage_squared,"lna_diff");

   //input resistance
       V(p1,gnd) <+ I(p1,gnd)*r_in;
       
   //frequency response & consider the function laplace_zp
           V(p2,gnd) <+ laplace_zp(V(p1,gnd),zeros,poles);
     
   //nonlinear characteristic
       if(abs(V(p2,gnd))<inmax)
               V(p3,gnd) <+ 2*(a-c*V(p2,gnd)*V(p2,gnd))*V(p2,gnd);
       else if (V(p2,gnd) > 0)
               V(p3,gnd) <+ 2*outmax;
       else
               V(p3,gnd) <+ -2*outmax;

   //output resistance
           V(rf_out,p3) <+ I(rf_out,p3)*r_out;
     
end
endmodule
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Help with Verilog -A:bandpass lna
Reply #1 - Nov 28th, 2007, 7:53am
 
I know some simulators require the zeros and poles arguments to be constants; you have yours set up as variables that are set in the @initial_step.  (They're variables, even though you set them from constants/parameters.)

Try using a fixed "vector" {1, 2, 3} for zeros and poles and see if this works, then we can investigate ways to use parameter arrays.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
surer
New Member
*
Offline



Posts: 2

Re: Help with Verilog -A:bandpass lna
Reply #2 - Nov 28th, 2007, 4:41pm
 
my lna verilog-a code is refered to the book "Modeling.and.Simulation.for.RF.System.Design".
the main question locates in the laplace function.
and I dont know how to realize the 100M flatten gain. If use the zeros and poles, need enough Octave to satisfy the code function.
in addition, the bandpass is other issue to me. All paper provides the method to realize lowpass. I try to use the method of ative filters to realize the bandpass and not succeed.
So maybe the code needs to use new techique or modify the method that I used. help me and I starve for the behavioral models to AMS simulation. 3x
Back to top
 
 
View Profile   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.