# adding u(t) and r(t) to create a signal

I previously asked this question in the maths community not realising that this stack exchange community existed. I have searched online extensively and haven't been able to find an explanation to how this works and would really appreciate some input.

I'm studying this signals and systems text book and I can't figure out the logic behind how $u(t)$ and $r(t)$ can be added together to form some signals.

$$u(t) \triangleq \begin{cases} 0, & \text{if }t<0 \\ 1, & \text{if }t\ge0 \end{cases}$$



\begin{align} r(t) & \triangleq \begin{cases} 0, & \text{if }t<0 \\ t, & \text{if }t\ge0 \end{cases} \\ & = t \ u(t) \\ \end{align}



Basically, an example in the book gives this signal:

So the book says that it can be described by this equation: $$x(t) = u(t)-r(t-1)+2r(t-2)-r(t-3)+u(t-4)-2u(t-5)$$

It states that the sum of the ramps $-r(t-1)+2r(t-2)$ goes upward with the slope equal to one starting at $t=2$. I can't understand how this works geometrically and haven't been able to find anything that has helped. Does anyone know how this type of modelling is done?

I'm not sure I understand the delta-equals notation, but I'll assume it means definition.

It's important to understand that you're doing a variable substitution here. In the strictest sense, the $t$ in $u(t-1)$ is not the same $t$ as in $u(t)$. It may be easier for you to understand if you write your definitions as functions of $z$ instead of $t$:

$$u(z) \triangleq \begin{cases} 0, & \text{if }z<0 \\ 1, & \text{if }z\ge0 \end{cases}$$

\begin{align} r(z) & \triangleq \begin{cases} 0, & \text{if }z<0 \\ z, & \text{if }z\ge0 \end{cases} \\ & = z \ u(z) \\ \end{align}

So, $z=t$ in $u(t)$ and $z=t-1$ in $r(t-1)$, etc. You're changing a function of $z$ into a function of $t$.

The two functions you're dealing with have a breakpoint in them where the function changes behavior. In both cases it happens when $z=0$. So, looking at $u(z)$ for example, $u(z)=0$ for all values of $z$ less than zero and $u(z)=1$ for $z=0$ and all values greater than zero-- just saying what the function says, but in words.

When I use $u(t)$, I am substituting $z=t$ so $u(t)=0$ for all times before $t=0$, and $u(t)=1$ from time $t=0$ onward.

Now think about what's happening in the function argument with all the $(t-1)$, $(t-2)$ values... If you were to look at $u(t-4)$, then, it has the effect of shifting the entire function to the right in time. In this case: $$u(t-4) = \begin{cases} 0, & \text{if }t-4<0 \\ 1, & \text{if }t-4\ge0 \end{cases}$$ or, rearranging the conditions a bit: $$u(t-4) = \begin{cases} 0, & \text{if }t<4 \\ 1, & \text{if }t\ge4 \end{cases}$$ so you have a step function that is zero for all times before $t=4$, and one for times $t=4$ onward.

With the $r(z)$ function, with $z=t-2$ you substitute for $z$ in all places, so you have: \begin{align} r(t-2) & = \begin{cases} 0, & \text{if }t<2 \\ t-2, & \text{if }t\ge 2 \end{cases} \\ & = (t-2) \cdot u(t-2) \\ \end{align} which is zero for all times before $t=2$ and then a line starting at $(t=2,x(t)=0)$ with a slope of positive 1 and a y-intercept of -2.

The coefficients have the effect of changing the slope and corresponding y-intercept but the t-intercept remains the same. $2\cdot r(t-2)$ has a slope of 2 and a y-intercept of -4 but still crosses the $t$ axis at $t=2$.

The x(t) function is a linear combination of such functions, so you must add up the values at each point. The easiest way to see this on graph paper would be to draw each term separately one above the other and then add them vertically.

With the two components you you've highlighted, $−r(t−1)+2\cdot r(t−2)$: There is a slope of zero before $t=1$ because $u(t)$ is zero slope. The first term starts a ramp of slope of -1 starting at $t=1$ and the second term adds to that a ramp of slope +2 starting at $t=2$. Where those two terms overlap (everywhere from $t=2$ and to the right) the combined slope of those terms is +1.

• Yeah the delta equals does mean that. After reading your answer I drew them all vertically and saw that by performing arithmetic to get the resulting values of the signal at each point results in the signal shown.The only thing that is still confusing for me is how the final two terms in the equation u(t-4) & -2u(t-5) produce that value of two between 4 & 5 but zero elsewhere? – burton01 Jan 7 '16 at 23:22
• Don't worry I finally see how it works. the adding of the u(t-4) to the hitherto generated function with a slope of zero at x(t)=1 results in a boosted step signal which is then negated from 5 onwards by the term 2u(t-5). I didn't realise the chronological importance of this type of modelling until now. Thanks for your help. – burton01 Jan 7 '16 at 23:38
• I'd think of it less as "chronological" and more as separating a function into a set of components. All components exist for all times $t$. This isn't very different from how principal component analysis works, which is used for "seasonal adjustments" in economic data among other things, or how a Fourier transform works, which is a sum of sinusoids of different frequencies, amplitudes and time offsets. – Omegaman Jan 8 '16 at 1:55
• Yeah I understand. By chronological I more so meant the method you recommended to see how the final signal is constructed. I understand that it is important to choose functions which will not negate the signal that has been constructed but only tweak it beyond a certain point. – burton01 Jan 8 '16 at 2:16