All of the designs I have seen for adding hysteresis to a comparator (Schmitt triggers) assume that one of the two inputs to the comparator is set at a fixed reference voltage (typically with a voltage divider between the supply voltage and ground).
Suppose I want to compare one voltage to another, where both input voltages change over time. A simple comparator will do this. But I would like to add hysteresis. In other words, when the difference between the two inputs is within some threshold of 0, the comparator does not switch its output, but if the voltage difference exceed the threshold, the comparator input switches to indicate which value is higher.
How could I design a comparator which compares two variable voltages with hysteresis?