A Schmitt trigger is a regenerative comparator that has two threshold voltages, one for the positive-going edge and the other for the negative-going edge of the input signal. It is used to convert a noisy signal into a clean digital signal or to generate a square wave.