2023-01-04T08:04:01.000-0500

Eldo

Is it possible to make a measurement for each periods ? And plot it directly with Eldo ?

Attachments: | avg_period.tcl (280 bytes) tran_oscillator.cir (1 KB) |

proc

myxup =

myavg=\[\]

for i in range(0,length(myxup)-1) : xtmp=myxup\[i\]\;

wf1 = datatowf(myavg)

return wf1

}

The TCL code defines a procedure called "avg_period" that needs 2 waves as argument. The first one (wave0) is the reference to define the window for average computation. This wave could be the output of the oscillator for instance.

Then a "for" loop is used to compute the average value of wave1 (that could be the current of a source if wanted to extract the consumption of the oscillator) by specifying the computation window based on "myxup" previously extracted. For all X values, average on Wave1 is computed between x(i) and x(i+1).

[xtmp,ytmp] is added in "myavg".

And finally this vector is converted in wave "wf1" with datatowf function.

Note: language used in Waveform Calculator is Python so the

This TCL procedure is called in Eldo with

.TCL_WAVE TRAN AVG_CONSO=avg_period(v(1,3),i(v2))

Netlist: tran_oscillator.cir

Tcl procedure: avg_period.tcl