1
$\begingroup$

I am trying to calculate the convolution of two signals $x(t)$ and $h(t)$:

enter image description here

enter image description here

enter image description here

I used MatLab to calculate and plot the integrals for the convolution using the following code (I know there is conv() though):

syms t r
f1 = r*(1-(t-r));
f2 = (2-r)*(1-(t-r));
i1 = int(f1,r,0,t)
i2 = int(f2,r,0,t)
i3 = int(f2,r,t-1,2)
t1=0:0.1:1;
t2=1:0.1:2;
t3=2:0.1:3;
y1 = -(t1.^2 .*(t1 - 3))/6;
y2 = (t2 .*(t2.^2 - 9*t2 + 12))/6;
y3 = -(t3 - 3).^3/6;
plot(t1,y1,t2,y2,t3,y3)

While that should be correct based on the formula for the convolution, the result seems a little bit strange...

enter image description here

Could the convolution be discontinious? And if no, what is going wrong with the integrals?

Thanks in advance.

  • 1
    [This post](http://mathoverflow.net/questions/35803/discontinuous-convolutions) makes it seem like the answer is yes (even more shockingly, it sounds like it could even be continuous nowhere).2017-01-07
  • 1
    How is $x$ defined for $t \notin (0,1) \cup (1,2)$? How do you define the convolution with a non integrable function?2017-01-07
  • 0
    Outside this range, $x$ is 0.2017-01-07
  • 0
    Same goes for $h$2017-01-07
  • 0
    Looking at your code it seems that you plotted something has nothing to deal with $x(t),h(t)$.2017-01-07
  • 0
    What do you mean the same goes for $h$? Do you mean $h$ is zero for $t \notin (0,1) \cup (1,2)$? If that is the case, the convolution must be continuous.2017-01-08
  • 0
    $h$ is zero just for t∉(0,1)2017-01-08

1 Answers 1

2

It is straightforward, if tedious, to compute $$(x * h)(t) = \begin{cases} 0, & t <0 \\ {3 t^2-t^3 \over 6},& 0 \le t < 1 \\ {2t^3-3t+3 \over 6 }, & 1 \le t < 2 \\ { 21 t - (t^3+3 t^2 +9)\over 6 }, & 2 \le t < 3 \\ 0, & \text{otherwise} \end{cases}$$ and it is straightforward to verify that this is continuous.

enter image description here

  • 0
    @Rahul: Better?2017-01-08
  • 0
    Thank you very much! What was wrong on the process I followed to solve it? f1 and f2 were $x(τ)h(t-τ)$ for the two different branches of $x$. I took their integrals for the 3 different stages and then I plotted them. (in y1,y2 and y3 I copy and pasted the results of int() and changed them so they can use the t1,t2 and t3 matrices)2017-01-08
  • 0
    @KonstantinosKamaropoulos: I think you need a little more care in performing the integrations. You need at least three regions, **depending on your approach**, you need $t \in [0,1]$ with integration bounds $0,t$, then $t \in [1,2]$ with bounds $t-1,t$ (and you may want to split the bounds into $t-1,1$ and $1,t$) and for $t \in [2,3]$ you need bounds $t-1,2$.2017-01-08
  • 0
    Hmm... I don't get it... Even if I change the bounds of the integration the results are still incorect. So there's something wrong with the equations I calculate the integral of.2017-01-08
  • 0
    @KonstantinosKamaropoulos: Sorry, I don't have access to Matlab at present, so cannot help with that.2017-01-08