In a circuit a comparator is used to convert a sinusoidal signal to a square wave. The input signal however is not a clean sine wave, but has some noise added to it.

The comparator is supposed to be ideal and has a hysteresis which is much larger than the noise signal, thus there is no ringing at the zero crossings of the sine wave.

Yet due to the noise on the input signal, the comparator switches slightly earlier or later as it would for a clean sine wave, hence the produced square wave has some phase noise.

The plot below illustrates this behavior: the blue curve is the noisy input sine wave and the yellow curve is the square wave generated by the comparator. The red lines show the positive and negative hysteresis threshold values.

Given the spectral density of the noise on the input signal, how can I calculate the phase noise of the square wave?

I would like to do a proper analysis on this, but could not find any resources on the topic yet. Any help is much appreciated!

CLARIFICATION: I would like to analyze the phase noise produced by the given circuit and am NOT asking on how the reduce the noise!

## Best Answer

The noise is sampled only once per zero crossing, or twice per cycle of the 1 MHz signal. Therefore, as long as the bandwidth of the noise is significantly wider than 1 MHz, its spectrum is folded many times into the 1 MHz bandwidth of the sampled signal, and you can treat the PSD of the phase noise as essentially flat within that bandwidth.

The amplitude of the output phase noise is related to the amplitude of the input signal noise by the slope of the sine wave (in V/µs) at the comparator threshold voltages. Analysis is simpler if the thresholds are symmetric around the mean voltage of the sinewave, giving the same slope for both. The amplitude of the phase noise (in µs) is simply the noise voltage divided by the slope, in whatever units you want to use, such as the RMS value of noise that has a Gaussian distribution. In other words, the PDF of the phase noise is the same as the PDF of the original voltage noise (after scaling).