# Convolution correct?

I want to convolve two square functions (literally square pulses). In my opinion following calculation is correct, but my teacher said, it isn't (I did not yet have the time to speak to him again). Is my teacher wrong or am I missing something?

Since I have to express the functions with a dummy variable, flip and shift one I get the following:

So far, so good .. When I write down the integral now it looks like $\int_0^t 2*1 dT$ From this I'm implying that the convolution y(t) goes from 0 to 4 while t < 2. Doing this for every section this results in:

I can't find an error, I hope someone can tell me whether this is right or wrong.

-
Ok, I could just add 2 hyperlinks in my main post here the functions: 1.) i.imgur.com/jN1tI.png 2.) i.imgur.com/mY8Qf.png My teacher said casually that he thinks the convolution has a maximum of 2, not 4. –  Marco Jun 3 '12 at 18:10
Ah, when you said square functions I didn't realize you literally meant a square. Thanks for the clarification. –  chris Jun 3 '12 at 18:13
Oh, yes, I realize that this is misleading, i'm editing –  Marco Jun 3 '12 at 18:14

It looks correct to me.

I am assuming that $x(t) = 2 \cdot 1_{[0,2]}(t)$, $h(t) = 1_{[0,4]}(t)$. Then we have $(x * h)(t) = 2 \int 1_{[0,2]}(\tau) 1_{[0,4]}(t-\tau) \, d \tau = 2 \int 1_{[0,2]}(\tau) 1_{[t-4,t]}(\tau) \, d\tau = 2 \int 1_{[0,2]\cap [t-4,t]}(\tau) d\tau$, from which we get $(x * h)(t) = 2 m([0,2]\cap [t-4,t])$, where $m(\cdot)$ is the length of the interval.

There are five intervals to consider when evaluating the convolution:

$t\in (-\infty,0)$: $(x * h)(t) = 0$.

$t \in [0,2)$: $(x * h)(t) = 2t$.

$t \in [2,4]$: $(x * h)(t) = 4$.

$t \in (4,6]$: $(x * h)(t) = 12-2t$.

$t \in (6, \infty)$: $(x * h)(t) = 0$.

This is the same as your graph.

-
Thank you, I will talk to my teacher tomorrow and see what he says. –  Marco Jun 3 '12 at 20:41