Adaptive Schmitt trigger tames unruly signals
Editor's Note: And now for something completely different, I submit a circuit of my own to your ruthless scrutiny.
In biomedical instrumentation (for example), we're sometimes faced with very noisy or badly-behaved signals from which we need to derive information. In this example, I needed to "square up" a respiration signal, which can exhibit wide variations in amplitude and frequency, along with a wandering baseline. Presented here is an adaptive "super-Schmitt," with many adjustable parameters, that did an extremely good job of taming the input signal.
The design values here are tweaked for an expected input range of 50mV to 1V P-P and 0.07Hz to 2Hz.
U1 & U2 detect the positive & negative peaks of the input, but unlike typical detectors, include R1 & R2 to provide damping (spike rejection) as required, dependant on the signal characteristics. These networks, in conjunction with R16, determine how quickly the held peaks decay. The P-P amplitude tracked by these detectors (buffered by U3 & U4) is used to both adjust the hysteresis band of the final comparator U6, and to provide a zero-crossing reference.
Hysteresis adjustment is accomplished by operational transconductance amp (OTA) U7. This chip (originally a 3080, but a more modern part like the LM13700 should work too) basically multiplies its differential input voltage by the unipolar bias current (the arrow input) to derive its output current. In this case, by saturating the input (0.7V is enough), the OTA acts more like a polarity reversal switch, which mirrors the bias current to the output, either sourcing or sinking depending on the differential input polarity. The output current develops a voltage across R13 which adds to or subtracts from the input signal depending on the circuit's digital output, thus providing hysteresis.
U5 implements a differential-input current-to-voltage converter for driving the OTA's bias input (which is internally referenced to the negative supply rail).
U6, the final output comparator, compares the input signal ± hysteresis to either the LPF'd midway point between the signal peaks (jumper "A"), or to a low-passed version of the signal itself (jumper "B"). This is chosen based on your signal's characteristics; I found "A" worked best in my application.
The trimmer, R4, sets the quiescent hysteresis and compensates for any amp offsets. D6 puts U7's bias input within the output range of the op-amps I used, and could be removed or modified depending on your op-amps & OTA. Supplies are assumed to be clean & stable.
The astute reader will ask why I didn't do the obvious, and use an OTA in place of the U5 VCCS circuit. Unfortunately, 30 years after the fact, I'm not quite sure. There may have been a reason.
Is this circuit still useful today? I'll claim it is, though like many such circuits, a microcontroller could do a good job too. Take your pick.
Jung, W.G., IC Op-amp Cookbook, section 4.2.4: Bi-directional output VCCS