How to convolve two stair-case functions?

94 Views Asked by At

For the life of me, I haven't been able to grasp convolution for functions with multiple pieces. For example,

$$ h(\lambda) = \left\{ \begin{array}{l l} 2 & \quad \ 0\leq \lambda < 1\\ -1 & \quad \ 1\leq \lambda \leq2 \end{array} \right.$$ $$ f(\lambda) = \left\{ \begin{array}{} 2 & \quad \ 0\leq \lambda < 1\\ 3 & \quad \ 1\leq \lambda < 2 \\ 1 & \quad \ 2 \leq \lambda \leq 3 \end{array} \right.$$

I know that I have to fold one the functions and shift it. So we take $h(t-\lambda)$.

  • For $0<t<1$, we have $$\int_0^t(2)(2) d\lambda = 4t$$ we get one integral because this is the only overlap and we take from 0 to t, because that is the region they overlap for $0<t<1$.
  • For $1<t<2$, we have $$\int_{0}^{t-1}(-1)(2)+\int_{t-1}^{1}(2)(2)+\int_1^t(2)(3)=4$$ Now for $2<t<3$ I have, $$\int_{t-1}^{2}(-1)(3) + \int_2^t (2)(1)$$ And there is $3<t<4$, I have $$\int_t^3(-1)(1) = -3+t$$

However, I am not sure of my attempt and I would really appreciate it if someone could explain how to convolve such functions and how to handle the integration limits because they are the most confusing. Do we always start from 0?

1

There are 1 best solutions below

0
On BEST ANSWER

Say you have two functions $f = s \chi_{(a,b)}$ and $g = t \chi_{(c,d)}$. Then $$f \ast g (x) = \int_{\mathbb R} f(y) g(x-y) \, dy = st \int_{\mathbb R} \chi_{(a,b)}(y) \chi_{(c,d)}(x-y) \, dy. $$ Here $$ \chi_{(a,b)}(y) \chi_{(c,d)}(x-y) = \chi_{(a,b) \cap (x-d,x-c)}(y), $$ so $$f \ast g (x) = st |(a,b) \cap (x-d,x-c)|.$$

There are formulas you can work out for this expression, but let's consider the simpler case where these intervals have length $1$. Then $b = a+1$, $d = c+1$, and $$ |(a,a+1) \cap (x-c-1,x-c)| = \left\{ \begin{array}{lcl} 0 & if & x < c+a \\ x-c-a & if & c+a \le x \le c + a + 1 \\ 2 - x + c + a & if & c + a + 1 \le c + a + 2 \\ 0 & if & x > c + a + 2\end{array} \right.$$ (this is a tent function).

The convolution is linear in each argument separately, so the convolution of your functions $f$ and $h$ will be a linear combination of tent functions.