&SIGNAL: WRITE-SIGNAL
By default, the signals are written in a Spice readable format as
a Piece Wise Linear (PWL) input signal. The alternative is the
Sceptre format, i.e. a comma between time and current but neither
a heading nor a closing line.
In both cases, the file contains records indicating the wires
on which the signal was induced and the number of records that
have been written out.
Other formats can be added - please contact the author.
Enables the user to write selectively a part of the signal to
a dataset.
The condition is an expression in terms of the following
variables:
SAMPLE: the sample number, 1 to MXLIST
SIGNAL: in case of an unprocessed signal, the current in microAmp
TIME: the time corresponding to the sample
The condition must evaluate to a logical.
The condition is remembered, and re-used, by default from one
call to the next - the initial default is 'True'.
Examples:
wr-if 'time>0.5&time<1'
wr-if 'signal<-0.02'
Call threshold_crossing(1,-0.02,`falling,plot`,n1,t1_fall)
Call threshold_crossing(1,-0.02,`rising,plot`,n2,t1_rise)
If 'n1<1 | n2<1' Then
Say "Didn't find both a falling and a rising edge."
Elseif 't1_fall > t1_rise' Then
Say "Rising edge precedes falling edge."
Else
write-signal dataset signal.list ...
write-if 'time>{t1_fall}&time<{t1_rise}'
Say "Writing out the signal for {t1_fall} < t < {t1_rise}"
Endif
The first 2 examples are simple applications of the write
condition: writing out only the signal within a fixed time
range and writing out only the portions of the signal that
are below a threshold of -0.02 microAmp.
The 3rd example illustrates how one can obtain the times at
which the signal passes a threshold in a given direction and
to write out the signal between the rising and falling edges.
The dataset name. The name should be enclosed in single quotes if it
contains any of the following: blank, comma, colon, double quote,
equal sign. This means in practice that the quotes are required on
a Vax for all dataset access outside the home disk. On VM/CMS, the
blanks between file-name and file-type (and perhaps file-mode) may
be replaced by dots, thus avoiding the need to add the quotes. On
Unix systems, the name should be surrounded by double quotes so as
to avoid case conversion of the file name.
An identification string of at most 8 characters. This string is used
by the various dataset commands and it is also needed if you keep
more than one object (member) of the same type (cell, gas, track etc)
in the same dataset.
A string of at most 29 characters that serves as a comment helping
you to recognise a member in a dataset.
By default, the time is written to the dataset in units of micro
second and the current in micro Ampere. You can change this via the
UNITS keyword followed by the SI units you wish:
--------------------------------------------------------------------
Keyword Meaning Keyword Meaning
--------------------------------------------------------------------
KILO-AMPERE 10^3 A
SECOND sec AMPERE A
MILLI-SECOND 10^-3 sec MILLI-AMPERE 10^-3 A
MICRO-SECOND 10^-6 sec MICRO-AMPERE 10^-6 A
NANO-SECOND 10^-9 sec NANO-AMPERE 10^-9 A
PICO-SECOND 10^-12 sec PICO-AMPERE 10^-12 A
FEMTO-SECOND 10^-15 sec FEMTO-AMPERE 10^-15 A
ATTO-SECOND 10^-18 sec ATTO-AMPERE 10^-18 A
--------------------------------------------------------------------
Some commonly abbreviations of these units are recognised (e.g. nsec).
Keyword index.
Formatted on 10/11/98.