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!

