[Math] Convolution of two DIFFERENT rectangular pulses

convolution

I'm looking for the convolution of $\mathcal{X}_{[0,1/2]}$ and $\mathcal{X}_{[0,1]}$ and I'm having trouble.

$\begin{align}
\int \mathcal{X}_{[0,1]}(s)\mathcal{X}_{[0,1/2]}(t-s)ds = \int_0^{1/2}\mathcal{X}_{[0,1]}(t-s)ds
\end{align}$

Variable sub. $u=t-s, du = -ds$, range becomes $u \in [t-1/2,t]$:

$\begin{align}
\int_{t-1/2}^{t}\mathcal{X}_{[0,1]}(u)du
\end{align}$

I guess here is where my mistake comes in. I feel this should be $t \cdot I\{t\in [0,1]\} – t \cdot I\{t \in [0.5,1.5]\}$. This is not correct, surely…

Best Answer

You can compute the integral $$ f(t) = \int_{t-1/2}^{t}\chi_{[0,1]}(u)du $$ in cases, for different ranges of $t$. I think it's easier (personally) if we manipulate the rectangular pulse function instead of doing the substitution for $u$. I'm assuming that $$ \chi_{[a,b]}(x) = \begin{cases} \hfill 1 \hfill & \text{ if } x\in [a,b] \\ \hfill 0 \hfill & \text{ if } x\notin [a,b] \\ \end{cases}. $$ With this, we can see that \begin{align} \chi_{[0,1]}(t-s) &= \begin{cases} \hfill 1 \hfill & \text{ if } t-s\in [0,1] \\ \hfill 0 \hfill & \text{ if } t-s\notin [0,1] \\ \end{cases} \\ &= \begin{cases} \hfill 1 \hfill & \text{ if } s\in [t-1,t] \\ \hfill 0 \hfill & \text{ if } s\notin [t-1,t] \\ \end{cases} \\ &= \chi_{[t-1,t]}(s). \end{align} So we have, $$ f(t) = \int_{0}^{1/2}\chi_{[0,1]}(t-s)ds = \int_{0}^{1/2}\chi_{[t-1,t]}(s)ds. $$ For $t\leq 0$, $\chi_{[t-1,t]} = 0$ in the range of integration, so $f(t) = 0$.

For $t\in (0,\frac{1}{2}]$, $f(t) = \int_{0}^{t}1 ds = t$.

For $t \in (\frac{1}{2},1)$, $f(t) = \int_{0}^{1/2}1 ds = \frac{1}{2}$.

For $t \in [1,\frac{3}{2})$, $f(t) = \int_{t-1}^{1/2}1 ds = \frac{1}{2} - (t-1) = \frac{3}{2} - t$.

For $t \geq \frac{3}{2}$, $f(t) = 0$.

Visually, the function $f(t)$ looks like a trapezoid. It's the amount of overlap between the two rectangular pulses as you slide them over one another (with the variable $t$). The overlap takes on a constant value of $\frac{1}{2}$ when the small rectangle is completely inside the larger rectangle.