]> sigrok.org Git - pulseview.git/commit
SignalBase: Adjust Schmitt-trigger thresholds
authorSoeren Apel <redacted>
Thu, 29 Jun 2017 17:16:18 +0000 (19:16 +0200)
committerUwe Hermann <redacted>
Wed, 5 Jul 2017 22:37:09 +0000 (00:37 +0200)
commit5e95d3d980490ce37d3ae404998b8c89089391e3
tree39fd740bcea70f85cdbd2a1e9142cd1130f89b85
parent8ebf8079b43ba0aebe9bc5d4d27049b4a91aa22d
SignalBase: Adjust Schmitt-trigger thresholds

Currently, the thresholds are determined by the minimum
and maximum values of a signal. From those, we derive the
high and low thresholds by using a 10% margin to min/max.

However, this approach doesn't work very well when the
measurement includes reset conditions or similar, causing
spikes that raise the min/max significantly.

Example:
sigrok-dumps/i2c/eeprom_24xx/microchip_24lc64/sainsmart_dds120_powerup_scl_sda_analog.sr

This patch changes the thresholds margins to 35%. However,
they are expressed differently: (max-min)/2 is used as the
center line, from which 15% of the amplitude (max-min) is
used as the margin. This way seems a little more intuitive
for me since the percentage given (15) is directly proportional
to the hysteresis.
pv/data/signalbase.cpp