surer
New Member
Offline
Posts: 2
|
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
|