zf3177
Newbie level 4
- Joined
- Nov 12, 2015
- Messages
- 7
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 120
Simply drive DUT by Iin or Iin_plus and Iin_minus.
Then measure Iout+j*Qout or (Iout_plus-Iout_minus)+j*(Qout_plus-Qout_minus).
Here you should use PSS/PAC
https://www.designers-guide.org/Modeling/modeling-rf-systems.pdf
Spectre is no more than classic Spice type simulator, so Spectre never can treat complex signal by only one wire and you can nevere realize "j" in Cadence Spectre.In order to measure the expression you had provided "(Iout_plus-Iout_minus)+j*(Qout_plus-Qout_minus)", how to realize "j" in spectre?
procedure( bb_ac_probe(wfI, wfQ)
let( (I_p, I_n, Q_p, Q_n, p, n, xvec_p, yvec_p, xvec_n, yvec_n, i, nlen)
I_p = wfI
I_n = flip( conjugate(I_p) )
Q_p = wfQ
Q_n = flip( conjugate(Q_p) )
p = I_p + complex(0.0, 1.0)*Q_p
n = I_n + complex(0.0, 1.0)*Q_n
xvec_p = drGetWaveformXVec(p)
yvec_p = drGetWaveformYVec(p)
xvec_n = drGetWaveformXVec(n)
yvec_n = drGetWaveformYVec(n)
nlen = drVectorLength(xvec_n)
for(i, 1, nlen-1
drAddElem( xvec_n, drGetElem(xvec_p, i) )
drAddElem( yvec_n, drGetElem(yvec_p, i) )
); for
drCreateWaveform(xvec_n, yvec_n)
); let
); procedure
"Rapid IP3" is very suspicious.The above words are quote from the method of Measuring IP3 with Rapid IP3 in cadence help document.
If you want to evaluate Gain, use conventional AC analysis.And I don't know how to use it in the test of my complex filter.
No.May be I should find the way to measure fully differential amplifier as reference?
Spectre is no more than classic Spice type simulator, so Spectre never can treat complex signal by only one wire and you can nevere realize "j" in Cadence Spectre.
Instead, complex signal is treated by two wires, Isig and Qsig.
Then you can construct complex signal Isig + j*Qsig as Post Processing.
The following is a example Skill Function which create complex signal over negative to positive frequency from only positive frequency data.
Negative frequency data can be constructed from positive frequecncy data, since I(-freq)=conj(I(freq)) and Q(-freq)=conj(Q(freq)).
Code:procedure( bb_ac_probe(wfI, wfQ) let( (I_p, I_n, Q_p, Q_n, p, n, xvec_p, yvec_p, xvec_n, yvec_n, i, nlen) I_p = wfI I_n = flip( conjugate(I_p) ) Q_p = wfQ Q_n = flip( conjugate(Q_p) ) p = I_p + complex(0.0, 1.0)*Q_p n = I_n + complex(0.0, 1.0)*Q_n xvec_p = drGetWaveformXVec(p) yvec_p = drGetWaveformYVec(p) xvec_n = drGetWaveformXVec(n) yvec_n = drGetWaveformYVec(n) nlen = drVectorLength(xvec_n) for(i, 1, nlen-1 drAddElem( xvec_n, drGetElem(xvec_p, i) ) drAddElem( yvec_n, drGetElem(yvec_p, i) ) ); for drCreateWaveform(xvec_n, yvec_n) ); let ); procedure
"Rapid IP3" is very suspicious.
Even Cadence don't push advertisement of "Rapid IP3" recently.
If you want to evaluate Gain, use conventional AC analysis.
If you want to evaluate IP3, use PSS/PAC analysis where one signal is large signal for PSS and the other signal is small signal for PAC.
https://www.designers-guide.org/Analysis/intercept-point.pdf
No.
Whether Single-ended or Differential has no relation to complex signal at all.
If you would like to treat differential signal as single-ended signal, use ideal balun.
https://www.designers-guide.org/Analysis/diff.pdf
Even if you use four baluns, input signals are consisted from two signals(Iin and Qin), also output signal are consisted from two signals(Iout and Qout).
Direct Plot of Cadence ADE can not be useful for complex signal.
You have to write your own OCEAN(SKILL) functions to do post processing for complex signal such as I+j*Q.
procedure( bb_ac_probe(wfI, wfQ)
let( (I_p, I_n, Q_p, Q_n, p, n, xvec_p, yvec_p, xvec_n, yvec_n, i, nlen)
I_p = wfI
I_n = flip( conjugate(I_p) )
Q_p = wfQ
Q_n = flip( conjugate(Q_p) )
p = I_p + complex(0.0, 1.0)*Q_p
n = I_n + complex(0.0, 1.0)*Q_n
xvec_p = drGetWaveformXVec(p)
yvec_p = drGetWaveformYVec(p)
xvec_n = drGetWaveformXVec(n)
yvec_n = drGetWaveformYVec(n)
nlen = drVectorLength(xvec_n)
for(i, 1, nlen-1
drAddElem( xvec_n, drGetElem(xvec_p, i) )
drAddElem( yvec_n, drGetElem(yvec_p, i) )
); for
drCreateWaveform(xvec_n, yvec_n)
); let
); procedure
save_path=/home/username/Desktop/Polyphase_test_result/
simulator( 'spectre )
design( "/home/username/simulation/tt_polyphase/spectre/schematic/netlist/netlist")
resultsDir(save_path)
modelFile(
'("/home/username/Desktop/models/allModels" "")
)
analysis('dc ?saveOppoint t )
envOption(
'analysisOrder list("dc")
)
temp( 27 )
run()
It is simple math.So, can't we simulate complex filters by only use Isig or Qsig?
If you are not familiar with Ocean/Skill language, use your favorite language for post processing.But I am not familiar with Ocean/Skill language, I had searched some document about how to programming and use this language to simulation there still some problem need you for help.
Thanks for explain the problem with above equations!It is simple math.
H = Hi + j*Hq
A = Iin + j*Qin
B = Iout + j*Qout
Hi, Hq, Iin, Qin, Iout and Qout are all complex value for AC and PAC analysis.
B = H * A = (Hi*Iin - Hq*Qin) + j*(Hi*Qin + Hq*Iin)
Iout = Hi*Iin - Hq*Qin
Qout = Hi*Qin + Hq*Iin
When Qin=-j*Iin(mag of Iin and Qin=1, phase of Iin=0deg, phase of Qin=-90deg), Iout=(Hi+j*Hq)*Iin. Qout=(Hi+j*Hq)*Qin
So H=Iout/Iin=Qout/Qin.
If you are not familiar with Ocean/Skill language, use your favorite language for post processing.
For example, you can use MATLAB directly to do post post processing PSF data of Cadence Spectre results.
https://www.lumerink.com/courses/ECE697A/docs/Cadence+Spectre+Matlab+Toolbox.pdf
Imagine actual measurement using actual instruments, not EDA Tool Play.will you please provided some complex filter testbench or codes?
Yes.AC response simulation:
According the equation you had mentioned.To test either Isig or Qsig we can get the Gain and Phase in complex filter just set the input Iin Qin in certain value.
Correct. However, use "vosurce", neither "psin" nor "port".IIP3 or SFDR simulation:
This kind of simulations must insert the instance in spectre like "psin" to obtain HB or PAC/PSS simulation
Still you can not understand complex signal at all.and I don't know how to deal with complex filter with 4 ports.
Wrong.As the "psin" has insert instead of ac signals,The equation "H=Iout/Iin=Qout/Qin" is no longer estabilished
Little correct.then we need Skill language & Matlab to contruct a complex expression for process the simulation data, is that right?
I just designed a active-RC complex filter based on TT biquad
For my filter center freqency=5.9MHz Bandwidth=4Mhz
Can you understand very basic concept surely ?zf3177 said:power(dBm) is better...pancho_hideboo said:What scheme do you want to use as IP3 definition, voltage(dBV) or power(dBm) ?
I don't think your circuit can work when you use 50ohm load.I think the reference impedance you refered is 50ohm or the impedance to drive next stage?
You can not understand IP3 at all.zf3177 said:freq1 freq2 I want to set:freq1=4.5MHz freq2=6.5Mhz and these two freq are all in band.pancho_hideboo said:What frequency do you use as two input frequency for IP3 evaluation ?
fin_1 amd fin_2 ?
Why far less than 4MHz/3?So delta_f between freq1 and freq2 has to be far less than 4MHz/3=1333kHz
The netlist followed your requirment as follow include AC response analysis statements.For PAC or PSS simualte..I don't know how to do..Again show your netlist regarding signal source definitions and analysis statements.
simulator lang=spectre
global 0 vdd!
include "/home/username/Desktop/models/allModels"
// Library name: FDRFC
// Cell name: FDRFC_Circuit_synbol
// View name: schematic
subckt FDRFC_Circuit_synbol GND VDD Vcmfb Vin\+ Vin\- Vout\+ Vout\-
ends FDRFC_Circuit_synbol
// End of subcircuit definition.
// Library name: FDRFC
// Cell name: vcmfb_circuits_symbol
// View name: schematic
subckt vcmfb_circuits_symbol GND VDD Vcmfb Vout\+ Vout\- Vref
ends vcmfb_circuits_symbol
// End of subcircuit definition.
// Library name: FDRFC
// Cell name: FDRFC_ALL
// View name: schematic
subckt FDRFC_ALL GND VDD Vin\+ Vin\- Vout\+ Vout\- Vref
I0 (GND VDD net17 Vin\+ Vin\- Vout\+ Vout\-) FDRFC_Circuit_synbol
I1 (GND VDD net17 Vout\+ Vout\- Vref) vcmfb_circuits_symbol
ends FDRFC_ALL
// End of subcircuit definition.
// Library name: two_stage_opamp
// Cell name: tt_polyphase_6Mhz
// View name: schematic
RQT8 (net28 net070) resistor r=2.6K
RQT7 (net26 net071) resistor r=2.6K
RQT6 (net27 net073) resistor r=2.6K
RQT5 (net25 net072) resistor r=2.6K
RQT2 (net049 net066) resistor r=2.6K
RQT1 (net037 net067) resistor r=2.6K
RQT4 (net047 net068) resistor r=2.6K
RQT3 (net048 net050) resistor r=2.6K
RC8 (net28 Iout_m) resistor r=26.525K
RC7 (net26 Iout_p) resistor r=22K
RC6 (net25 Qout_m) resistor r=22K
RC5 (net27 Qout_p) resistor r=22K
RC4 (net047 net22) resistor r=22K
RC3 (net048 net17) resistor r=22K
RC2 (net037 net24) resistor r=22K
RC1 (net049 net19) resistor r=22K
RW8 (net047 Qout_p) resistor r=90K
RW5 (net048 Qout_m) resistor r=90K
RW6 (net19 net26) resistor r=90K
RW7 (net24 net28) resistor r=90K
RQ4 (net047 net24) resistor r=200K
RQ3 (net048 net19) resistor r=200K
RI3 (Qin_p net048) resistor r=80K
RI4 (Qin_m net047) resistor r=80K
RW4 (net049 Iout_p) resistor r=90K
RW1 (net037 Iout_m) resistor r=90K
RQ2 (net049 net22) resistor r=200K
RQ1 (net037 net17) resistor r=200K
RI1 (Iin_p net037) resistor r=80K
RI2 (Iin_m net049) resistor r=80K
RW3 (net22 net27) resistor r=90K
RW2 (net17 net25) resistor r=90K
V6 (vref 0) vsource dc=900m type=dc
V4 (vdd! 0) vsource dc=1.8 type=dc
V2 (Qin_p 0) vsource dc=900m mag=1 phase=90 type=sine
V3 (Qin_m 0) vsource dc=900m mag=1 phase=270 type=sine
V11 (Iin_p 0) vsource dc=900m mag=1 phase=0 type=sine
V9 (Iin_m 0) vsource dc=900m mag=1 phase=180 type=sine
I143 (0 vdd! net048 net047 net24 net19 vref) FDRFC_ALL
I133 (0 vdd! net037 net049 net22 net17 vref) FDRFC_ALL
I138 (0 vdd! net25 net27 Iout_m Iout_p vref) FDRFC_ALL
I140 (0 vdd! net26 net28 Qout_m Qout_p vref) FDRFC_ALL
CF8 (Qout_m net070) capacitor c=1p
CF7 (Qout_p net071) capacitor c=1p
CF4 (net24 net068) capacitor c=1p
CF3 (net19 net050) capacitor c=1p
CF6 (Iout_m net073) capacitor c=1p
CF5 (Iout_p net072) capacitor c=1p
CF2 (net22 net066) capacitor c=1p
CF1 (net17 net067) capacitor c=1p
simulatorOptions options reltol=1e-3 vabstol=1e-6 iabstol=1e-12 temp=27 \
tnom=27 scalem=1.0 scale=1.0 gmin=1e-12 rforce=1 maxnotes=5 maxwarns=5 \
digits=5 cols=80 pivrel=1e-3 sensfile="../psf/sens.output" \
checklimitdest=psf
ac ac start=-10M stop=10M annotate=status
modelParameter info what=models where=rawfile
element info what=inst where=rawfile
outputParameter info what=output where=rawfile
designParamVals info what=parameters where=rawfile
primitives info what=primitives where=rawfile
subckts info what=subckts where=rawfile
saveOptions options save=allpub
I don't know test IIP3 must use reference impedance as I had read carefully the document you had provided, may be I had missed something.What value do you use as reference impedance ?
The circuit I had made and read many papers as reference..much of them use IIP3 as a parameter to test linearit, even in lower frequency.I don't think Gain and IP3 based on power definition are useful for active filter operated around 5MHz.
To keep IM3_L and IM3_U inside bandwidth of your filter.Why far less than 4MHz/3?
No.The input signal source impedance are't decided by simulation method?
I use IP3 defined by voltage(dBV).much of them use IIP3 as a parameter to test linearit, even in lower frequency.
Of course I knowAgain can you really understand power and voltage ?
I prefer use source impedance 50ohm and next stage input impedance is infinite (gate of the nmos as input stage) so how to get Rload?If you prefer IP3 defined by power(dBm), use "port" instead of "vsource" as input signals and place resistive loads for outputs.
I can not think so.Of course I know
I can not understand what you want to mean at all.But if receiver have mismatch impedance,but only the LNA has 50ohm(match impedance)input impedance
I can not understand what you want to mean at all.start using voltages/currents/impedances instead of powers is more suitable, right?
See product data sheet, many IP3 are defined by voltage.And according to your reply..it makes no sense to calc IIP3 without know the source/load impedance. Why so many paper displayed there IIP3 without showed there previous/next stage? I don't think they made a whole receiver chian..or simply set source/load impedance as 50 ohm?
Power Source Drive and observation of output voltage.I prefer use source impedance 50ohm and next stage input impedance is infinite (gate of the nmos as input stage) so how to get Rload?
I had seen your posted in many years before and read carefully.Can you understand difference between Power Source Drive and Voltage Source Drive ?
As direct method, assume port impedances(=reference impedances), R01 and R02 are all real.
Available power of port1 is Pa=(|E|/2)2/R01
Power delivered to port2 is Pload=|V2|2/R02
|S21|^2=Pload/Pa=(2*|V2/E|)2*R01/R02
S21=(2*V2/E)*sqrt(R01/R02)=(V2/(E/2))*sqrt(R01/R02)
Here "E" is an open circuit voltage of port1. And E/2 is not equal to V1 generally.
S21 is different from conventional voltage gain V2/V1 even if R01 is equal to R02.
Also |S21|^2 is different from conventional power gain Pload/Pin.
Before going to complex filter, learn very basic concept surely.
The traditional approach to measuring a two-tone nth-order IMD intercept point, IPn, begins by applying two sinusoids to the circuit’s input at f1 and f2. Make the amplitude of the two sinusoids the same, and increase their power while plotting the power at the output in a fundamental (either f1 or f2) and in an nth-order intermodulation product (for IP3 use either 2f1 – f2 or 2f2 – f1)
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?