Let x1 ≤ x2, ≤ … ≤ xn be the n ordered data points, with corresponding intensity measurements y1 ≤ y2 ≤ … ≤yn.
Let w ≥ 0 be the window size, which defines the neighborhood about the data point.
for i = 1 to n do
Let l = max(l,i − w) be the left boundary of the window.
Let r = min(n,i + w) be the right boundary of the window.
-
Let f(·) be the smoothing function. For the mean, this would be
and for the median this would be
where [·] denotes the floor function.
Compute the estimate ŷj = f(xj).
end for
|