compare block.
[sim,y] = ld_compare(sim, events, in, thr)
thr - constant
in * - signal
y *
If in > thr: y = 1; else y = -1
Please note: returns -1 for in == 0