The rectangle function Π is 0 everywhere except on [−1/2,1/2], where it is 1; namely, Π(x)=θ(x+1/2)−θ(x−1/2) where θ is the Heaviside function. The rectangle function is a special case of boxcar function (see section 15.2.1) for a=−1/2 and b=1/2.
Example.
Input:
Output:
θ | ⎛ ⎜ ⎜ ⎝ |
| + |
| ⎞ ⎟ ⎟ ⎠ | −θ | ⎛ ⎜ ⎜ ⎝ |
| − |
| ⎞ ⎟ ⎟ ⎠ |
To compute the convolution of the rectangle function with itself, you
can use the convolution theorem.
Input:
Output:
−2 x θ | ⎛ ⎝ | x | ⎞ ⎠ | +x θ | ⎛ ⎝ | x+1 | ⎞ ⎠ | +x θ | ⎛ ⎝ | x−1 | ⎞ ⎠ | +θ | ⎛ ⎝ | x+1 | ⎞ ⎠ | −θ | ⎛ ⎝ | x−1 | ⎞ ⎠ |
This result is the triangle function tri(x) (see section 15.2.3).