Convolution of two triangular functions

In summary: So now I have to seperate my h(tau+t) function into two different parts, 1. when the front peak is bigger than -1 but smaller than 0 and 2. when the front peak is bigger than 0 but smaller than 1.But now I don't know how to split it into two different parts, because I don't know how to deal with the (1-\tau) function.Please help me with your thoughts!In summary, the convolution of two triangular pulses can be calculated by first rewriting one of the functions as h(-t+t) and then splitting the problem into several terms using the non-negative part function. Each term can then be integrated over a specific range to get the final solution
  • #1
Lindsayyyy
219
0
Hi everyone, I want to calculate the convolution of two triangluar pulses

Homework Statement


both functions are given by

[tex] x(t)=\left\{\begin{array}{ll} t+1, & -1 \leq t \leq 0 \\
1-t, & 0 \leq t \leq 1 \end{array}\right. [/tex]

and I rewrote the other as h(-t+t)

Homework Equations



convolution integral



The Attempt at a Solution



So first of all I mirrored my function h(-tau) and then added +t so I have h(-tau+t)

Whenthe front (right) side of my h(-tau+t) is smaller than -1 I have no overlap [1+t<-1] so my integral is zero.
Now I'm not sure about the 2nd part. I think the second part is the following:
when the front of my h(-tau+t) is bigger than -1 but smaller than zero, then these conditions lead to:
1+t>-1 and 1+t<0 so my integration limits are from -1 to 1+t is that correct?

Thanks for your help in advance

Regards Lindsay
 
Physics news on Phys.org
  • #2
Lindsayyyy said:
Hi everyone, I want to calculate the convolution of two triangluar pulses

Homework Statement


both functions are given by

[tex] x(t)=\left\{\begin{array}{ll} t+1, & -1 \leq t \leq 0 \\
1-t, & 0 \leq t \leq 1 \end{array}\right. [/tex]

and I rewrote the other as h(-t+t)

Homework Equations



convolution integral



The Attempt at a Solution



So first of all I mirrored my function h(-tau) and then added +t so I have h(-tau+t)

Whenthe front (right) side of my h(-tau+t) is smaller than -1 I have no overlap [1+t<-1] so my integral is zero.
Now I'm not sure about the 2nd part. I think the second part is the following:
when the front of my h(-tau+t) is bigger than -1 but smaller than zero, then these conditions lead to:
1+t>-1 and 1+t<0 so my integration limits are from -1 to 1+t is that correct?

Thanks for your help in advance

Regards Lindsay

If ##w_{+}## denotes the non-negative part of a real number ##w## (that is,
[tex] w_{+} = \begin{cases} w &\text{ if } w \geq 0\\
0 & \text{ if } w < 0
\end{cases} [/tex]
then you can write your function as ##x(t) = (t+1)_{+} - 2 t_{+} + (t-1)_{+}.## This allows you to split up ##x(\tau) x( t-\tau)## into several terms, each of which is reasonably simple to analyze and itegrate over ##\tau \in (-\infty, \infty)##.
 
  • #3
I'm not familiar with your technique. We used to solve it by using different sections. Is my approach wrong ?
 
  • #4
Lindsayyyy said:
I'm not familiar with your technique. We used to solve it by using different sections. Is my approach wrong ?

It is not "my" technique; it is a standard technique, used when dealing with things like splines, etc. It is more-or-less equivalent to what you suggest, but I think it is a lot easier, albeit longer. For example, it is a lot easier to deal with individual terms like
[tex]T_1 = \int_{-\infty}^{\infty} (\tau +1)_{+} \cdot (t - \tau + 1)_{+} \: d \tau [/tex]
than to deal all at once with the total problem. Of course, you still need to split things up into regions, but now each term needs only two regions. For example, in the above we must have ##\tau \geq -1## from the first factor and ##t - \tau \geq -1## from the second factor. So if ##t \leq -2##, both factors are zero for all ##\tau \geq -1##, and so ##T_1 = 0##. If ##t > -2## the ##\tau## integration runs from ##-1## to ##t+1##, so ##T_1 = \int_{-1}^{t+1} (\tau+1)(t-\tau+1) \, d\tau = (t+2)^3/6##. Altogether we have
[tex] T_1 = \frac{1}{6} (t+2)_{+}^3.[/tex]
You can deal with the other 8 terms in a similar way.

OK, it is lengthy, but not excessively difficult.

BTW: a very much easier way than both or ours would be to use Laplace transforms. These essentailly allow one to write the answer almost "by inspection"---of course, after becoming comfortable with Laplace transforms.
 
  • #5
ok thanks, I don't know if you misunderstood my first post or if I misunderstood you. I never planned to the integration in one step. I wanted to split the integration into different sections (I think there are four).
 
  • #6
Lindsayyyy said:

The Attempt at a Solution



So first of all I mirrored my function h(-tau) and then added +t so I have h(-tau+t)

Whenthe front (right) side of my h(-tau+t) is smaller than -1 I have no overlap [1+t<-1] so my integral is zero.
Now I'm not sure about the 2nd part. I think the second part is the following:
when the front of my h(-tau+t) is bigger than -1 but smaller than zero, then these conditions lead to:
1+t>-1 and 1+t<0 so my integration limits are from -1 to 1+t is that correct?

Thanks for your help in advance

Regards Lindsay
The limits are fine, but I'm not sure if your reasoning to get there is correct. Is this what you were thinking? The leading "edge" of ##h(t-\tau)## is at ##\tau=t+1##. When it's between ##\tau=-1## and ##\tau=0##, you have the simple overlap of the two regions. This is the condition -1<1+t<0. When this condition holds, then the overlap is from ##\tau=-1## to ##\tau=1+t##, which you can see from a sketch.
 
  • #7
Ok, after many failed attempts I need your help, I don't understand it.

I know that my h(-tau)=h(tau)

so my h(-tau+t)=h(tau+t)

[tex] h(\tau+t)=\left\{\begin{array}{ll} 1+\tau+t, & -1 \leq t \leq 0 \\
1-\tau+t, & 0 \leq t \leq 1 \end{array}\right. [/tex]

and my "static" function is

[tex]x(\tau)=\left\{\begin{array}{ll} 1+\tau, & -1 \leq t \leq 0 \\
1-\tau, & 0 \leq t \leq 1 \end{array}\right. [/tex]

Now I'm not sure how to the convolution. I don't know how to find my different areas (I tried several possibilities). I'm not sure between the two different possibilities:

1.

The first attempt I did was that I said: The front peak of my h(tau+t) function which is 1+t is bigger than -1 but smaller than 0, the integral would like like:

[tex] \int \limits_{-1}^{1+t} (1-\tau+t)(1+\tau)d\tau [/tex]

The second integral is:

[tex] \int \limits_{-1}^{0} (1-\tau+t)(1+\tau)d\tau + \int \limits_{0}^{1+t} (1-\tau+t)(1-\tau)d\tau [/tex]

But the solution I get makes no sense.

2.

The other possibility was the following: the fron peak of h(tau+t) is bigger than -1 but smaller than 1, this leads to

[tex] \int \limits_{-1}^{1+t} (1-\tau+t)(1+\tau)d\tau [/tex]

and afterwards the peak on the left (-1+t) is bigger than -1 but smaller than 1, this leads to

[tex] \int \limits_{-1+t}^{1} (1+\tau+t)(1-\tau)d\tau [/tex]

I don't know, both solutions (I solved it with wolfram) don't make sense to me. Where is my mistake?

Thanks for help everyone
 
  • #8
Lindsayyyy said:
Ok, after many failed attempts I need your help, I don't understand it.

I know that my h(-tau)=h(tau)

so my h(-tau+t)=h(tau+t)

[tex] h(\tau+t)=\left\{\begin{array}{ll} 1+\tau+t, & -1 \leq t \leq 0 \\
1-\tau+t, & 0 \leq t \leq 1 \end{array}\right. [/tex]

and my "static" function is

[tex]x(\tau)=\left\{\begin{array}{ll} 1+\tau, & -1 \leq t \leq 0 \\
1-\tau, & 0 \leq t \leq 1 \end{array}\right. [/tex]

Now I'm not sure how to the convolution. I don't know how to find my different areas (I tried several possibilities). I'm not sure between the two different possibilities:

1.

The first attempt I did was that I said: The front peak of my h(tau+t) function which is 1+t is bigger than -1 but smaller than 0, the integral would like like:

[tex] \int \limits_{-1}^{1+t} (1-\tau+t)(1+\tau)d\tau [/tex]

The second integral is:

[tex] \int \limits_{-1}^{0} (1-\tau+t)(1+\tau)d\tau + \int \limits_{0}^{1+t} (1-\tau+t)(1-\tau)d\tau [/tex]

But the solution I get makes no sense.

2.

The other possibility was the following: the fron peak of h(tau+t) is bigger than -1 but smaller than 1, this leads to

[tex] \int \limits_{-1}^{1+t} (1-\tau+t)(1+\tau)d\tau [/tex]

and afterwards the peak on the left (-1+t) is bigger than -1 but smaller than 1, this leads to

[tex] \int \limits_{-1+t}^{1} (1+\tau+t)(1-\tau)d\tau [/tex]

I don't know, both solutions (I solved it with wolfram) don't make sense to me. Where is my mistake?

Thanks for help everyone

Your first line is wrong. If ##h(\tau) = h(-\tau)## for all ##\tau##, then ##h(-\tau + t) = h(\tau - t)## (unless, maybe, you meant ##h(-(\tau + t))## but carelessly omitted the very important parentheses).

I have already told you how to do the question, but you seem to be determined to do it another way---with no luck so far.
 
  • #9
Thanks for your help. Well, I don't understand how you explained it to me, that's why I didn't use it, we learned it in a different way than you told me and as you see, I have much trouble even with the way I learned it :( .
Why is h(tau+t)=h(-tau+t) wrong? I thought when h(-tau)=h(t) then I just have to add a t in order to move the triangle

edit: I would give your explanation a shot, but I don't understand it, sorry. It's not like I don't want to hear it, but I thought for the beginning it's easier the way I know it. But your way looks actually easier if you understood the problem. So I wouldn't mind if you'd explain it to me.

It actually starts with the w+ I don't know what you mean with "non negative part of a real number"
Or if you have a good link where I can read about the technique you mentioned, I'd also take that. I need to understand this problem
 
Last edited:
  • #10
Lindsayyyy said:
Why is h(tau+t)=h(-tau+t) wrong?
Because ##\tau+t \ne -\tau+t##. It generally only holds if ##\tau=0##. Your ##h## is an even function, so you can write ##h(t-\tau) = h[-(t-\tau)] = h(\tau-t)##. I don't see how that really helps though.
 
  • #11
Ok, I know my problem now, I don't know which values of h and x get multiplied. I uploaded a picture.

When I convolve do I just multiply the values which are above each other at t (in this picture the yellow line) or do I have to multiply every value (like I marked the two orange ones).


Thanks for your help
 

Attachments

  • kk.png
    kk.png
    4.2 KB · Views: 2,086
  • #12
Lindsayyyy said:
Ok, I know my problem now, I don't know which values of h and x get multiplied. I uploaded a picture.

When I convolve do I just multiply the values which are above each other at t (in this picture the yellow line) or do I have to multiply every value (like I marked the two orange ones).


Thanks for your help

As I have already indicated, you are trying to go too far too fast. You need to split things up into separate terms and look at those in detail. Here we go, one last time (slightly modifying and shortening what I said before).

First some notation: let ##1_{A}(.)## denote the indicator function of a set ##A##; that is,
[tex] 1_A(w) = \begin{cases} 1 & \text{ if } w \in A\\
0 & \text{ if } w \not\in A \end{cases}[/tex]
In this notation we have ##h(t) = (t+1)\, 1_{(-1,0)}(t)+ (1-t)\, 1_{(0,1)}(t)##. Since each h factor has two terms, their product ##h(s) h(t-s)## (using ##s## instead of ##\tau##) consists of four terms:
[tex] h(s) h(t-s) = T_1(s,t)+T_2(s,t) +T_3(s,t)+T_4(s,t) [/tex]
where
[tex] T_1(s,t) = (s+1)(t-s+1) \, 1_{(-1,0)}(s) \, 1_{(-1,0)}(t-s)\\
T_2(s,t) = (s+1)(1-t+s) \, 1_{(-1,0)}(s) \, 1_{(0,1)}(t-s)\\
T_3(s,t) = (1-s)(t-s+1) \, 1_{(0,1)}(s) \, 1_{(-1,0)}(t-s)\\
T_4(s,t) = (1-s) (1-t+s) \, 1_{(0,1)}(s) \, 1_{(0,1)}(t-s)
[/tex]
Now let's compute ##H_1(t) = \int_{-\infty}^{\infty} T_1(s,t) \, ds##.

The integrand ##T_1## is nonzero in the region
[tex] R_1 = \{ (s,t): -1 \leq s \leq 0, -1 \leq t-s \leq 0 \} [/tex]
in ##(s,t)##-space. Sketch this region; you need to do it for yourself, because I can't figure out how to attach a drawing easily---nor do I really want to. Anyway, if you do sketch the region ##R_1## you will see that there are two sub-regions in which the limits of the ##s## integration are different. This gives
[tex] H_1(t) = 1_{(-2,-1)}(t) \, \int_{s=-1}^{t+1} (s+1)(t-s+1) \, ds
+ 1_{(-1,0)}(t) \, \int_{s=t}^0 (s+1)(t-s+1) \, ds [/tex]
This gives
[tex] H_1(t) = 1_{(-2,-1)}(t) \: \frac{1}{6}(t+2)^3
-1_{(-1,0)}(t) \: \left( \frac{1}{6} t^3 + t^2 + t \right)[/tex]

The three other integrals can be computed similarly. Some terms will combine, so you will end up with 4 sub-formulas altogether, one for each t-interval (-2,-1), (-1,0), (0,1) and (1,2).
 
Last edited:
  • #13
Lindsayyyy said:
Ok, I know my problem now, I don't know which values of h and x get multiplied. I uploaded a picture.

When I convolve do I just multiply the values which are above each other at t (in this picture the yellow line) or do I have to multiply every value (like I marked the two orange ones).
The horizontal axis is ##\tau##, not ##t##. The value of ##t## specifies how much you shift the function along the ##\tau## axis. Either the blue or red graph is not correct. One should be centered around ##\tau=0##. It looks like you shifted both x and h.

Ignoring that detail for now, you should realize that the green curve represents the integrand as a function of ##\tau##, so the integral represents the area under curve. That would be the value of the convolution for a given value of ##t##.
 
  • #14
Thanks to both to you, I have to go to the university soon, I'll take a closer look at yours then Ray.

@Vela, I should have mentioned, that I found this Applet online, that's why both triangle looks shifted. But it's not clear to me where I have to multiply the functions.
 
  • #15
Well, I'm too stupid to understand your approach Ray Vickson, thanks anyways.

I calculated my first integral now and come to the same solution you go Ray

[tex] \int \limits_{-1}^{1+t} (1-\tau+t)(1+\tau) d\tau = \frac 1 6 (t+2)^3[/tex]

but I have difficulties in the interval where t is bigger than -1 but smaller than 0

I got:

[tex] \int (1+\tau+t)(1+\tau) d\tau + \int (1-\tau+t)(1+\tau) d\tau + \int\limits_{0}^{1+t} (1-\tau+t)(1-\tau) d\tau [/tex]

I left out the first 4 limits for the first 2 integrals because I don't know them, I tried everything but I failed. I know that the whole integral has to be the value 1/6 when I solved it for t=-1 but I don't get it. Where's the mistake?

I'm literally sitting here for four hours and I'm stupid to solve this problem.
Thanks for your help guys
 
  • #16
Let's try calculate the convolution
$$\int_{-\infty}^\infty x(\tau)h(t-\tau)\,d\tau$$ for a specific value of ##t##, say, ##t=-3/4##. I've attached a plot of ##x(\tau)## and ##h(t-\tau)## for t=-3/4. You can see that ##x(\tau)## divides the number line into four regions: (-∞,-1), (-1,0), (0,1), and (1,∞). Similarly, ##h(\tau)## divides the number line into four regions: (-∞, -7/4), (-7/4, -3/4), (-3/4, 1/4), and (1/4, ∞). On the second image, I plotted the points corresponding to the interval boundaries. The blue dots correspond to the intervals for ##x##, and the red dots, to intervals for ##h##. You can see the points split the number line into of seven different intervals.

For ##\tau<-1## and ##\tau>1/4##, ##x(\tau)=0## or ##h(\tau)=0##, so the integrand is 0. That takes care of four out of the seven intervals.

For ##-1 < \tau < -3/4##, ##x(\tau) = 1+\tau##. The argument of ##h##, ##-3/4-\tau##, will be positive, so ##h(-3/4-\tau) = 1-(-3/4-\tau) = 7/4+\tau##. So the first integral will be
$$\int_{-1}^{-3/4} (1+\tau)(7/4+\tau)\,d\tau.$$
For ##-3/4 < \tau < 0##, ##x(\tau)## still equals ##1+\tau##. The argument of ##h##, however, is now negative, so ##h(-3/4-\tau) = 1+(-3/4-\tau) = 1/4-\tau##. The next integral will be
$$\int_{-3/4}^{0} (1+\tau)(1/4-\tau)\,d\tau.$$
Finally, we have to consider ##0<\tau<1/4##. In this case, ##x(\tau) = 1-\tau## and ##h(-3/4-\tau) = 1+(-3/4-\tau) = 1/4-\tau##, and you get
$$\int_{0}^{1/4} (1-\tau)(1/4-\tau)\,d\tau.$$ Putting it all together, you have
$$\int_{-\infty}^\infty x(\tau)h(-3/4-\tau)\,d\tau = \int_{-1}^{-3/4} (1+\tau)(7/4+\tau)\,d\tau + \int_{-3/4}^{0} (1+\tau)(1/4-\tau)\,d\tau + \int_{0}^{1/4} (1-\tau)(1/4-\tau)\,d\tau.$$
This was for a specific value of ##t##. You need to generalize this for any value of ##t##. You'll want to consider two cases: ##-1<t<0## and ##0<t<1##. For other values of ##t##, the convolution is 0.
 

Attachments

  • plot.pdf
    33.9 KB · Views: 469
  • line.pdf
    32.1 KB · Views: 435
  • #17
Ok thanks, I try it tomorrow, I tried it now, but I can't concentrate anymore. Thank you very much.
 

Related to Convolution of two triangular functions

1. What is the definition of convolution of two triangular functions?

The convolution of two triangular functions is a mathematical operation that combines the information from two triangular functions to create a new function. It involves the integration of the product of the two functions over a specified range.

2. How is the convolution of two triangular functions calculated?

The convolution of two triangular functions can be calculated using the convolution integral formula, which involves integrating the product of the two functions over the range of the variable of interest. This integral can also be solved using graphical methods.

3. What is the significance of convolution of two triangular functions in signal processing?

Convolution of two triangular functions is a fundamental operation in signal processing. It is used to model the response of a linear system to an input signal, and is also used in filtering, smoothing, and deconvolution of signals.

4. Can the convolution of two triangular functions be visualized?

Yes, the convolution of two triangular functions can be visualized using graphical methods. The resulting function is a smooth curve that is a combination of the two original triangular functions.

5. Are there any real-world applications of convolution of two triangular functions?

Yes, convolution of two triangular functions has several real-world applications, such as in digital image processing, audio and video processing, and in the analysis of time series data. It is also used in fields such as engineering, physics, and economics.

Similar threads

Replies
1
Views
746
Replies
11
Views
6K
Replies
2
Views
1K
Replies
1
Views
1K
Replies
4
Views
2K
Replies
2
Views
3K
Replies
23
Views
3K
Replies
1
Views
1K
Back
Top