The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 19th, 2024, 1:51am
Pages: 1
Send Topic Print
Simulate a Direct Conversion Mixer with Eldo-RF and ADMS (Read 13890 times)
trumpeu
New Member
*
Offline



Posts: 2

Simulate a Direct Conversion Mixer with Eldo-RF and ADMS
Jul 21st, 2008, 11:11am
 
Hi

I was trying simulate a Direct Conversion Mixer with Eldo-RF and ADMS but the sources do not work good and the results off simulation is not agree.
The result don't show the constellation both the input and the output.
I will describe the SPICE and Verliog AMS archives:
Verilog Ams
Quote:
// Demodulator IQ


`include "discipline.h"
`include "constants.h"

module res (rf,ol,ol1,vif_i,vif_q);
     parameter real rin=50;                                    //input impedance
     parameter real rout=50;                                    //output impedance
     parameter real ganho=10;                              //Gain in db
     parameter real iip3=-10;                              //third order intercept point
       parameter real iip2=2;                              //second order intercept point
     inout rf,ol,ol1;
     output vif_i,vif_q;
     electrical vif_q,vif_i;
     electrical rf,ol,ol1;
     real va,vb,ga,ia,ib,ic,vd,F_r,c_ruido,gc,Aiip3,vin,vout,Aiip2,gb;
     analog begin
           @(initial_step) begin                              //Parameters conversion
                 ga = pow(10,ganho/20);                        //Gain conversion
                 Aiip3=sqrt(pow(10,iip3/10)*2*rout*0.001);      
                 gc=(4/3)*ga/(Aiip3*Aiip3);                  
                 Aiip2=sqrt(pow(10,iip2/10)*2*rout*0.001);
                 gb=ga/Aiip2;
           end
           I(rf)<+V(rf)/rin;
           I(ol)<+V(ol)/rin;
           I(ol1)<+V(ol1)/rin;
           
           vin=V(rf);
           vout=ga*vin +gb*vin*vin -gc*vin*vin*vin;
           
           V(vif_i)<+vout*V(ol);
           V(vif_q)<+vout*V(ol1);            
     end
     endmodule


Spice:

Quote:
****
.verilog resistor.vla


Vout 11 0 RPORT=50
*+MPSK m=8 lpf=no_filter  
+MQAM M=16      LPF=no_filter BETA=0.35 IASC=1 QASC=1
+ four 1GHz MA (1) 50m 0
+ pattern delay=10n tsymb=50n RANDOM

Y1 res 11 12 13 22 31
+ param: iip3=-10 iip2=10  ganho=72

Vol  12 0 RPORT=50
+four FUND2 MA (1) 50m 0

Vol1 13 0 Rport=50
+four FUND2 MA (1) 50m 90


.modsst 5n 10u
.option hmax=1n
.option sst_tstop=1u
.param gan=-1
.SST fund1=1GHz NHARM1=3
+FUND2=1.1GHz NHARM2=3
.PLOT TMODSST V(11) V(22) V(31) V(12) V(13)
.PLOT FMODSST v(11) v(12) v(13) vr(22) vr(31) vi(22) vi(31)

.PLOT FOURMODSST FOURDB (v(11))
.PLOT FOURMODSST FOURDB (v(22))
.end


Thanks for atention

Ps. I use the tutorial http://www.designers-guide.org/Modeling/modeling-rf-systems.pdf for develop this situation

Ps. Sorry for the English
Back to top
 
 
View Profile   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: Simulate a Direct Conversion Mixer with Eldo-RF and ADMS
Reply #1 - Jul 21st, 2008, 5:12pm
 
Why do you set local frequency(FUND2) as 1.1GHz while you state "Direct Conversion Mixer" ?

trumpeu wrote on Jul 21st, 2008, 11:11am:
I was trying simulate a Direct Conversion Mixer with Eldo-RF and ADMS but the sources do not work good and the results off simulation is not agree.

What do you refer as disagreement ?

trumpeu wrote on Jul 21st, 2008, 11:11am:
The result don't show the constellation both the input and the output.

You seem to apply 16QAM signal with carrier frequency of 1.0GHz and Rsymb=20MHz as RF input signal.
Show me your constellation results.

To plot constellation you have to tune sampling timing of symbol.
I can't find even symbol_rate setting in your plot setup.
Do you understand difference of constellation and trajectory ?

For example, constellation function of Agilent ADS is like following.
   constellation(i_data, q_data, symbol_rate, delay)
Here symbol_rate and delay are required.
Even if there is no filter in your setup, you have to delay at least Tsymb/2-Tstep to plot constellation.

trumpeu wrote on Jul 21st, 2008, 11:11am:
.SST fund1=1GHz NHARM1=3 FUND2=1.1GHz NHARM2=3
.modsst 5n 10u

Although I don't know eldoRF, I guess the above two statement combination is for envelope analysis.

trumpeu wrote on Jul 21st, 2008, 11:11am:
.PLOT TMODSST V(11) V(22) V(31) V(12) V(13)
.PLOT FMODSST v(11) v(12) v(13) vr(22) vr(31) vi(22) vi(31)

In the above, there is no specification of harmonic to observe.

To plot constellation or trajectory of V(11), you have to specify harmonic=(1,0), that is 1GHz. Then plot {vr(11), vi(11)}.
While, to plot constellation or trajectory of V(22) or V(31), you have to specify harmonic=(-1,1), that is 100MHz. Then plot {vr(22), vi(22)} or {vr(31), vi(31)} .

In eldo/ADMS, where do you set such harmonics for envelope analysis ?

Back to top
 
« Last Edit: Jul 21st, 2008, 8:26pm by pancho_hideboo »  
View Profile WWW Top+Secret Top+Secret   IP Logged
trumpeu
New Member
*
Offline



Posts: 2

Re: Simulate a Direct Conversion Mixer with Eldo-RF and ADMS
Reply #2 - Jul 23rd, 2008, 8:15am
 
First thanks for the answer

pancho_hideboo wrote on Jul 21st, 2008, 5:12pm:
Why do you set local frequency(FUND2) as 1.1GHz while you state "Direct Conversion Mixer" ?

Sorry I wrote wrong in the last post. FUND2=1GHz.
pancho_hideboo wrote on Jul 21st, 2008, 5:12pm:
What do you refer as disagreement ?
You seem to apply 16QAM signal with carrier frequency of 1.0GHz and Rsymb=20MHz as RF input signal.
Show me your constellation results.

If I use FUND1=FUND2=1GHz I obtain this constellation(Plot source with v(11).h(1,0)):
The plot off in and out has attach

IT's OK

But IF I will change the verilog source, add a second order intermodulation. I don't see the modification of constellation.
I'm thinking that the results of mixer h(1,-1) is different of the dc output h(0,0) but I would like to see in same time. What I think is correct?
pancho_hideboo wrote on Jul 21st, 2008, 5:12pm:
To plot constellation you have to tune sampling timing of symbol.
I can't find even symbol_rate setting in your plot setup.
Do you understand difference of constellation and trajectory ?

Ok, I have used a EZWAVE for plotting the constellation, I have used a TCL archive for tune the sampling:
Quote:
evalExpression { setAngleUnits("degrees") }
evalExpression { setTemperatureUnits("celsius") }
evalExpression { wf0=mag(wf("<teste/FMODSST>V(11).H(1,0)"))}
evalExpression { wf1=mag(wf("<teste/FMODSST>V(22).H(1,0)"))}
evalExpression { saida=complex(wf("<teste/FMODSST>VR(22).H(1,-1)"),wf("<teste/FMODSST>VR(31).H(1,
-1)"))}
evalExpression { saida1=complex(wf("<teste/FMODSST>VI(22).H(1,-1)"),wf("<teste/FMODSST>VI(31).H(1
,-1)"))}
evalExpression { C2211=constellationdiagram(wf("<teste/FMODSST>V(22).H(1,-1)"),5E-8,35E-9) }
evalExpression { C1110=constellationdiagram(wf("<teste/FMODSST>V(11).H(1,0)"),5E-8,35E-9) }
evalExpression { C3111=constellationdiagram(wf("<teste/FMODSST>V(31).H(1,-1)"),5E-8,35E-9) }
evalExpression { C2210=constellationdiagram(wf("<teste/FMODSST>V(22).H(1,0)"),5E-8,35E-9) }
evalExpression { C2200=constellationdiagram(wf("<teste/FMODSST>V(22).H(0,0)"),5E-8,35E-9) }
evalExpression { C2220=constellationdiagram(wf("<teste/FMODSST>V(22).H(2,0)"),5E-8,35E-9) }
evalExpression { C2230=constellationdiagram(wf("<teste/FMODSST>V(22).H(3,0)"),5E-8,35E-9) }
evalExpression { saidadc1=wf("<teste/FMODSST>VR(22).H(0,0)")+wf("<teste/FMODSST>VR(22).H(1,-1)") }
evalExpression { saidadc2=wf("<teste/FMODSST>VR(31).H(0,0)")+wf("<teste/FMODSST>VR(31).H(1,-1)") }
evalExpression { saidadcc=complex(wf("<calc>saidadc1"),wf("<calc>saidadc2")) }
evalExpression { Csaidadc=Constellation_wf4=constellationdiagram(wf("<calc>saidadcc"),5E-8,3.5E-8
) }
evalExpression { Csaida=constellationdiagram(wf("<calc>saida"),5E-8,3.5E-8) }
evalExpression { Csaida1=constellationdiagram(wf("<calc>saida1"),5E-8,3.5E-8) }

pancho_hideboo wrote on Jul 21st, 2008, 5:12pm:
For example, constellation function of Agilent ADS is like following.
   constellation(i_data, q_data, symbol_rate, delay)
Here symbol_rate and delay are required.
Even if there is no filter in your setup, you have to delay at least Tsymb/2-Tstep to plot constellation.

it's same of ADS
constellationdiagram(complex(i_data,q_data, T_symbol,delay)


pancho_hideboo wrote on Jul 21st, 2008, 5:12pm:
Although I don't know eldoRF, I guess the above two statement combination is for envelope analysis.

Yes, It's same to ADS envelope analysis

trumpeu wrote on Jul 21st, 2008, 11:11am:
.PLOT TMODSST V(11) V(22) V(31) V(12) V(13)
.PLOT FMODSST v(11) v(12) v(13) vr(22) vr(31) vi(22) vi(31)

In the above, there is no specification of harmonic to observe.


And my problem is that I don't see the dc off-set of second order intermodulation

     
thank you for  attention

Back to top
 

entrada.jpg
View Profile   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: Simulate a Direct Conversion Mixer with Eldo-RF and ADMS
Reply #3 - Jul 23rd, 2008, 4:50pm
 
What your question or what you want to know is very unclear. This is also true for your first post.
Please explain more clearly.


trumpeu wrote on Jul 23rd, 2008, 8:15am:
First Sorry I wrote wrong in the last post. FUND2=1GHz.

No. If LO frequency(Fund2) is same as RF frequency(Fund1), you must not do two tone envelope analysis.
You have to set netlist like following.

Vol   12 0 RPORT=50 four FUND1 MA (1) 50m 0
Vol1 13 0 Rport=50 four FUND1 MA (1) 50m 90

.SST fund1=1GHz NHARM1=3
.modsst 5n 10u

trumpeu wrote on Jul 23rd, 2008, 8:15am:
If I use FUND1=FUND2=1GHz I obtain this constellation(Plot source with v(11).h(1,0)):
The plot off in and out has attach

Attached plot is just one. Is this for input(V(11)) or output(V(22)+j*V(31)) ?
I think attached figure is input signal's constellation.
Also you have to resimulate with one tone envelope analysis, and then you have to plot v(11).h(1).

trumpeu wrote on Jul 23rd, 2008, 8:15am:
IT's OK

What is OK ?
Explain in detail. There is no output constellation for comparison.

trumpeu wrote on Jul 23rd, 2008, 8:15am:
But IF I will change the verilog source, add a second order intermodulation. I don't see the modification of constellation.

Second order nonlinearity already exists in your Verilog-A code.
Do you mean that there is no change in output constellation(V(22)+j*V(31)) even if you change iip2 value ?
But you don't show any output constellation and your simulation setup is wrong.

trumpeu wrote on Jul 23rd, 2008, 8:15am:
I'm thinking that the results of mixer h(1,-1) is different of the dc output h(0,0) but I would like to see in same time. What I think is correct?

I can't understand the above statements.
If you do correct simulation setup where one tone envelope is invoked,
you should plot real(v(11).h(1))+j*imag(v(11).h(1)) for input constellation and real(v(22).h(0))+j*real(v(31).h(0)) for output constellation.

trumpeu wrote on Jul 23rd, 2008, 8:15am:
And my problem is that I don't see the dc off-set of second order intermodulation

Maybe your problem is that you don't understand general RF simulation technique such as HB and Envelope analysis.

When I have spare time, I will plot constellation of input and output using your Verilog-A code and Agilent ADS later.
Back to top
 
« Last Edit: Jul 24th, 2008, 6:14am by pancho_hideboo »  
View Profile WWW Top+Secret Top+Secret   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: Simulate a Direct Conversion Mixer with Eldo-RF and ADMS
Reply #4 - Jul 24th, 2008, 7:45pm
 
This is result of ganho_dB=72, iip3_dBm=-10 and iip2_dBm=10.
Back to top
 

aho_boke_iip2_p10.jpg
View Profile WWW Top+Secret Top+Secret   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: Simulate a Direct Conversion Mixer with Eldo-RF and ADMS
Reply #5 - Jul 24th, 2008, 7:46pm
 
This is result of ganho_dB=72, iip3_dBm=-10 and iip2_dBm=-30.
Back to top
 

aho_boke_iip2_m30.jpg
View Profile WWW Top+Secret Top+Secret   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: Simulate a Direct Conversion Mixer with Eldo-RF and ADMS
Reply #6 - Jul 24th, 2008, 8:21pm
 
Different from IM3, there are many types in IM2 definition.
See the following.
http://www.designers-guide.org/Forum/YaBB.pl?num=1193566207

For example, self mixing of RF input, Half-IF, proximity of two tones in RF, etc.
Your Verilog-A is not proper for any type of IM2 which causes inband interference.

The following is modified Verilog-A code for RF self mixing or RF two tones in close proximity.
But strictly speaking, this implementation is not so proper, you have to scale and limit IM2 implementation.
Also you can't express Half-IF with this implementation.
Anyway you have to build your own mathematical formulation to model IM2 issue you concern.

"trumpeu_iq_down_mixer.va"
// trumpeu Demodulator IQ
`include "discipline.h"
`include "constants.h"

module trumpeu_iq_down_mixer(rf_in, lo_i_in, lo_q_in, if_i_out, if_q_out);
inout rf_in, lo_i_in, lo_q_in;
output if_i_out, if_q_out;
electrical rf_in, lo_i_in, lo_q_in;
electrical if_i_out, if_q_out;

parameter real rin = 50;       //input impedance
parameter real rout= 50;       //output impedance
parameter real ganho_dB = 10;  //Gain in dB
parameter real iip3_dBm = -10; //third order intercept point
parameter real iip2_dBm = 2;   //second order intercept point
   
real ga, gb, gc, Aiip3, Aiip2, vin, vin2, vout;

analog begin
  @(initial_step) begin //Parameters conversion
     ga = pow(10, ganho_dB / 20.0);  //Gain conversion
     Aiip3 = sqrt(pow(10, iip3_dBm / 10.0) * 2 * rout * 0.001);      
     gc = (4.0 / 3.0) * ga/(Aiip3*Aiip3);                  
     Aiip2 = sqrt(pow(10, iip2_dBm / 10.0) * 2 * rout * 0.001);
     gb = ga / Aiip2;
  end // initial_step

  I(rf_in) <+ V(rf_in) / rin;
  I(lo_i_in) <+ V(lo_i_in) / rin;
  I(lo_q_in) <+ V(lo_q_in) / rin;
         
  vin = V(rf_in);
  vin2 = vin * vin;
  vout = (ga - gc*vin2) * vin;
         
  V(if_i_out) <+ vout * V(lo_i_in) + gb*vin2;
  V(if_q_out) <+ vout * V(lo_q_in) + gb*vin2;
end // analog

endmodule
Back to top
 
« Last Edit: Jul 25th, 2008, 4:25am by pancho_hideboo »  
View Profile WWW Top+Secret Top+Secret   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: Simulate a Direct Conversion Mixer with Eldo-RF and ADMS
Reply #7 - Jul 24th, 2008, 8:25pm
 
The following is Agilent ADS netlist I used.
Hybrid style netlist of Agilent ADS and Cadence Spectre Syntax.

"test_trumpeu_iq_down_mixer.ads"
simulator lang=ads
Options ResourceUsage=yes UseNutmegFormat=no \
TopDesignName="./data/test_trumpeu_iq_down_mixer.ds"

define My_QAM16src( Vout )
  parameters  Carrier_freq=1 GHz  SymbolRate=1 MHz  \
              Pout_dBm=0 _dBm  Rout=50 Ohm
  num_states=16
  Comp_Gain=2
  SF=Comp_Gain/2.236
  UniformDist=_uniform(-0.5, num_states-0.5)
  Vcontrol=_randvar(UniformDist, int(time*SymbolRate))

  V_Source:SRC3  Vstate_in 0 Type="V_DC" Vdc=Vcontrol SaveCurrent=0
  V_Source:SRC4  Vin 0 Type="V_1Tone" V[1]=dbmtov(Pout_dBm, Rout)/2 \
           Freq[1]=Carrier_freq  Vac=polar(1,0) V SaveCurrent=0

  #uselib "sml" , "N_StateMod"
  N_StateMod:MOD1  Vin Vout Vstate_in \
    MaxStates=num_states Fnom=Carrier_freq Rout=Rout \
    StateArray=scalearray( SF, list( \
      1, 3, 2-j, 1-j*2, -j*3, -1-j*2, -2-j, -3, \
      -2+j, -1+j*2, j*3, 1+j*2, 2+j, j, -1, -j) )
end My_QAM16src

simulator lang=spectre
global 0
ahdl_include "./trumpeu_iq_down_mixer.va"

parameters RF_freq=1G
parameters Tsymb=50n
parameters Rsymb=1/Tsymb
parameters Samples_per_Symbol=10
parameters Tstep=Tsymb/Samples_per_Symbol
parameters numSymbols=256
parameters Tstop=numSymbols*Tsymb
parameters ganho_dB=72
parameters iip3_dBm=-10
parameters iip2_dBm=10

I0 (rf_in) My_QAM16src
+  Carrier_freq=RF_freq SymbolRate=Rsymb Pout_dBm=10-ganho_dB Rout=50

I1 (rf_in lo_i_in lo_q_in if_i_out if_q_out) trumpeu_iq_down_mixer
+  iip3_dBm=iip3_dBm  iip2_dBm=iip2_dBm  ganho_dB=ganho_dB

PORT_LO_I (lo_i_in 0) port num=1 r=50 type=sine freq=RF_freq
+ dbm=10 sinephase=0

PORT_LO_Q (lo_q_in 0) port num=2 r=50 type=sine freq=RF_freq
+ dbm=10 sinephase=90


simulator lang=ads
HB:Env1 MaxOrder=4 Freq[1]=RF_freq Order[1]=3 FundOversample=2 \
Restart=no UseGear=no EnvIntegOrder=1 EnvBandwidth=1 \
EnvWarnPoorFit=yes EnvUsePoorFit=yes  StatusLevel=2 \
SweepVar="time" SweepPlan="Env1_stim" OutputPlan="Env1_Output"
SweepPlan: Env1_stim Stop=Tstop Step=Tstep


Tran:Env1_tran HB_Sol=1 SteadyState=1 \
Freq[1]=RF_freq Order[1]=3 StatusLevel=3 \
OutputPlan="Env1_Output"

Component:tahb_Env1 Module="ATAHB" Type="ModelExtractor" \
Tran_Analysis="Env1_tran" HB_Analysis="Env1"

OutputPlan:Env1_Output \
     Type="Output" \
     UseNodeNestLevel=yes \
     NodeNestLevel=0 \
     UseEquationNestLevel=yes \
     EquationNestLevel=0 \
     UseSavedEquationNestLevel=yes \
     SavedEquationNestLevel=0 \
     SavedEquationName[1]="Rsymb" \
     SavedEquationName[2]="Tstep" \
     SavedEquationName[3]="Tstop" \
     SavedEquationName[4]="Tsymb" \
     SavedEquationName[5]="ganho_dB" \
     SavedEquationName[6]="iip2_dBm" \
     SavedEquationName[7]="iip3_dBm"
Back to top
 
« Last Edit: Jul 25th, 2008, 12:33am by pancho_hideboo »  
View Profile WWW Top+Secret Top+Secret   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.