The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 8th, 2024, 12:32pm
Pages: 1
Send Topic Print
Variable Gain with table_model (Read 83 times)
bessib
New Member
*
Offline



Posts: 2

Variable Gain with table_model
Oct 30th, 2006, 8:56am
 
Hello,

i want to model Gain Compression of a mixer caused by insufficient LO-Power with the table_model function. Here is my script and the table file:

             V(in)  <+ 50*I(in);                                                                                   //50Ohms input
           Power_LO_Vsquared = pow(V(LO),2)/50;                                                   //determining LO-Power
           Power_LO_dBm = abs(10*log(1e-30+Power_LO_Vsquared/1e-3));              //conversion to dBm
           Gain_tbl_dB = $table_model(Power_LO_dBm, "mixer_gain_temp2.tbl","");   //loading Gain from file
           Gain_tbl_V = pow(10,Gain_tbl_dB/20);                                                     //conversion of Gain
           V(out) <+ Gain_tbl_V*V(in);                                                                    //weighting Input with Gain

#mixer_gain_temp2.tbl
#
#LO-Power(dBm)              Gain(dB)
0                        2.6
1                        3.6
2                        6
3                        5.6
4                        6.6
5                        7.6
6                        8.4
7                        9.2

The script reads out the correct Gain but unfortunately there must be a problem in mulitplying the Gain with the input voltage.
Can anyone help me?

Thanks!
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Variable Gain with table_model
Reply #1 - Oct 30th, 2006, 12:00pm
 
In line 2 V(LO) would be the instantaneous LO voltage. Probably not what you want.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
bessib
New Member
*
Offline



Posts: 2

Re: Variable Gain with table_model
Reply #2 - Nov 2nd, 2006, 7:47am
 
Thanks for your reply, Ken. Is there a way to extract the peakvalue of the voltage as a variable of type real?

Bessi
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: Variable Gain with table_model
Reply #3 - Nov 2nd, 2006, 12:40pm
 
If you do, I think you'll end up with hidden state, the bane of RF simulations ...  But you are asking for some way to remember the past history of the model.  If you can save it to a node, rather than a real, then you might be OK.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Variable Gain with table_model
Reply #4 - Nov 2nd, 2006, 8:39pm
 
Rectify and filter.

-Ken
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.