PT1-Element#
The signal samples
of a signal trace can be
processed with the transfer function of a time-discrete PT1-element over a number
of signal samples
or with a smoothing factor, and a proportional
gain.
Sample Based Smoothing#
You can smooth the signal samples
with a PT1-element by calling
the method pt1()
, and define the time constant \(\tau\) of
the PT1-element by the number of signal samples.
A new Trace
instance labeled with the performed transformation
'pt1'
is returned.
>>> # smooth the signal samples sample based [.., 1:transparent, ..]
>>> Trace('Signal', [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]).pt1(ratio=2, gain=1)
Trace(label='Signal:pt1',
samples=[0.0, 0.5, 0.75, 0.875, 0.9375, 0.96875, 0.984375,
0.9921875, 0.99609375, 0.998046875, 0.9990234375])
>>> Trace('Signal', [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]).pt1(2)
Trace(label='Signal:pt1',
samples=[0.0, 0.5, 0.75, 0.875, 0.9375, 0.96875, 0.984375,
0.9921875, 0.99609375, 0.998046875, 0.9990234375])
(Source code, html)
Factor Based Smoothing#
You can smooth the signal samples
with a PT1-element by calling
the method pt1()
, and define the inverted time constant
\(\frac{1}{\tau}\) of the PT1-element with a smoothing factor between
0.0
and 1.0
.
A new Trace
instance labeled with the performed transformation
'pt1'
is returned.
>>> # smooth the signal samples factor based [0.0:freeze..1.0:transparent]
>>> Trace('Signal', [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]).pt1(ratio=0.5, gain=1)
Trace(label='Signal:pt1',
samples=[0.0, 0.5, 0.75, 0.875, 0.9375, 0.96875, 0.984375,
0.9921875, 0.99609375, 0.998046875, 0.9990234375])
>>> Trace('Signal', [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]).pt1(0.5)
Trace(label='Signal:pt1',
samples=[0.0, 0.5, 0.75, 0.875, 0.9375, 0.96875, 0.984375,
0.9921875, 0.99609375, 0.998046875, 0.9990234375])
(Source code, html)