# How to force the output to be in terms of a specific function?

I have a rectangular function rect[t], which is a window function with values of $$1$$ in the interval $$(-\frac{1}{2},\frac{1}{2})$$:-

rect[t_] := 1/2 (Sign[1/2 - t] + Sign[1/2 + t]);

Now I have some functions (most of them are terms being involved in the Fourier transformation) to be simplified, and I want the output to be in terms of rect[t].

For example, I have this to be simplified

1/2 (-Sign[1/2 + (2 - t)/2] - Sign[1/2 + 1/2 (-2 + t)]) + 1/2 (Sign[1/2 - t/10] + Sign[1/2 + t/10])

I want rect[(t - 4)/2] + rect[(t + 2)/6] as output. What should I do?

Many thanks!

• I guess you don't know about UnitBox[] yet? Or HeavisidePi[], for that matter. – J. M.'s technical difficulties Oct 9 '18 at 20:54
• Thanks. I was not aware of UnitBox[] and HeavisidePi[]. But my question remains: how can I get HeavisidePi[(t - 4)/2] + HeavisidePi[(t + 2)/6] (or UnitBox) as output? – H42 Oct 11 '18 at 15:37