Hi all,

i designed a latched comparator and performed a simulation like the one described in the paper 'A Methology for the Offset-simulation of comparators'

http://www.designers-guide.org/Analysis/comparator.pdf from this website.

No I have some questions:

1. During the post-analysis in Matlab (code is at the bottom of this post) one defines

**Code:**% select values within -2.5 .. 2.5 sigma
i=find(v>-2.5 & v < 2.5)

Why choose sigma = 2.5? At the end one defines

**Code:**sigma = 1/p(1)

This should be the sigma_offset. This value changes if I use another value than 2.5 within the find function. I'm now not sure why he took 2.5 sigma.

2. My result gives me a mu of 30mV and a sigma of 30mV (when calculated like described). Is this interpretation correct:

My threshold is now: threshold_ideal+mu, but how do i interpret this sigma?

3. Does anyone know any material/website about how get sigma and mu from the polynomial coefficients?

Thanks for your help!

-----

complete code:

**Code:**% it is assumed that the simulation results are provided
% in the matrix "ydata" and the array "xdata"
% (1) ni/N, Figure 2
y = sum(ydata)/length(ydata);
plot(xdata, y)
% (2) inverse erf for rising slope only
% y(1:21) is this case contains the data
% for the rising slope
v = sqrt(2)∗erfinv(y(1:21)∗2−1);
% select values within −2.5 ... 2.5 sigma
i=find(v>−2.5 & v<2.5)
% fit line through selected values
% Figure 5
[p,s]=polyfit(xdata(i), v(i), 1);
plot(xdata(i), v(i), xdata(i), polyval(p,x(i)))
% (4) compute mu and sigma
sigma = 1/p(1);
mu = −p(2)/p(1);