Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Frequency measure statement in transient simulation

26 views
Skip to first unread message

Bendt Sorensen

unread,
Oct 10, 2024, 8:04:12 AM10/10/24
to xyce-users
Hi,
I have been trying to understand the frequency measure statement in transient simulation
and I am getting some strange results. Any idea what I am doing wrong?

** Trasnlated using xdm 2.6.0 on Aug_14_2024_10_10_55_AM
** from C:\Users\bendt\AppData\Local\Temp\_MEI865802\pspice.xml
** to C:\Users\bendt\AppData\Local\Temp\_MEI865802\xyce.xml
vin  in 0 pulse(0 5 10n 5n 5n 25n 50n)
vmid  mid 0 1.65
vctrl ctrl 0
rmid mid 0 100k
rin in 0 100k
rout out 0 100k
rvbg vbg 0 100k
b1 vbg 0 v={table{temp}=(-10,1.00890)(0,1.00901)(10,1.00907)(20,1.00910)(30,1.00910)(40,1.00908)(50,1.00904)}
*
.measure tran oscf400 freq v(out) on=1.65 off=1.65 from=0 to=400n
.measure tran oscf200 freq v(out) on=1.65 off=1.65 from=0 to=200n
.measure tran oscf100 freq v(out) on=1.65 off=1.65 from=0 to=100n
.measure tran oscper when v(out)=1.65 rise=1
BVCO out 0 V={1.65+1.65*sin(6.28*48e6*v(vbg)*TIME)}
.MODEL diode D IS=10u N=0.001 LEVEL=2
.TRAN 10n 0.4u
.print tran v(out)  v(vbg) v(mid)
.END

 ***** Measure Functions *****

OSCF400 = 4.750000e+07
Measure Start Time= 0.000000e+00        Measure End Time= 4.000000e-07

OSCF200 = 4.750552e+07
Measure Start Time= 0.000000e+00        Measure End Time= 2.000000e-07

OSCF100 = 4.506207e+07
Measure Start Time= 0.000000e+00        Measure End Time= 1.000000e-07

OSCPER = 2.066390e-08 ~ 1/2.066390e-08 = 48.39357527 MHz
Measure Start Time= 0.000000e+00        Measure End Time= 4.000000e-07

** Setting the parameter minval=0.01 for the frequency measure statements I obtain:

 ***** Measure Functions *****

OSCF400 = 4.875000e+07
Measure Start Time= 0.000000e+00        Measure End Time= 4.000000e-07

OSCF200 = 4.956678e+07
Measure Start Time= 0.000000e+00        Measure End Time= 2.000000e-07

OSCF100 = 4.461000e+07
Measure Start Time= 0.000000e+00        Measure End Time= 1.000000e-07

OSCPER = 2.066390e-08
Measure Start Time= 0.000000e+00        Measure End Time= 4.000000e-07

xyce-users

unread,
Oct 10, 2024, 6:03:56 PM10/10/24
to xyce-users

The MEASURE FREQ method just does cycle counting over a specified time span to estimate frequency.  Thus for it to be accurate, Xyce needs to clearly be able to identify an ON and OFF part of a signal.

Since the off and on values in your example are the same "on=1.65 off=1.65" Xyce is using a tolerance value called MINVAL (see the Xyce Reference guide page 57) to separate off and on.  This looks like it causing some under counting in the MEASURE FREQ method. By making on=1.7 and off 1.4 I get results closer to the 50MHz that it should be:

 ***** Measure Functions *****

OSCF400 = 4.875000e+07
Measure Start Time= 0.000000e+00 Measure End Time= 4.000000e-07

OSCF200 = 5.000580e+07

Measure Start Time= 0.000000e+00 Measure End Time= 2.000000e-07

OSCF100 = 5.006897e+07

Measure Start Time= 0.000000e+00 Measure End Time= 1.000000e-07

OSCPER = 9.964783e-11

Measure Start Time= 0.000000e+00 Measure End Time= 4.000000e-07

I would think that the measure over the longer time span would be the most accurate but the simulation begins and ends on a "ON" part of the pulse.  So the OSCF400 measure is missing a cycle and only counting 19 out of the 20 pulses that are in the simulation.  Knowing that the last cycle is missed, I can make the on/off setting for the measure to be on=1.7 off=3.1 and then I'm counting just the rise and top part of the signal.  With that I get a much better OSCF400 

OSCF400 = 5.000000e+07

Measure Start Time= 0.000000e+00 Measure End Time= 4.000000e-07

OSCF200 = 5.000580e+07

Measure Start Time= 0.000000e+00 Measure End Time= 2.000000e-07

OSCF100 = 5.006897e+07

Measure Start Time= 0.000000e+00 Measure End Time= 1.000000e-07

OSCPER = 9.964783e-11

Measure Start Time= 0.000000e+00 Measure End Time= 4.000000e-07


Good luck,
Rich
Reply all
Reply to author
Forward
0 new messages