Rectangular smoothing function