# Unit step function and Ramp function Can I express this signal only with unit step function?
Because I've been told that this signals needs ramp function to be expressed, is that true?
And to be honest, I don't know what the ramp function is.
y =(-t - 2)*(u(t + 2) - u(t)) + 2*t*(u(t) - u(t - 1)) + 2*(u(t) - u(t)) + (5 - t)*(u(t - 3) - u(t - 4))
is this form right?

This looks like homework.

The initial part of your expression is correct but there are some errors later on. You say you don't know what a ramp is, so I don't know how you've got as this far with it but, anyway, the procedure for solution is:

1. At $\small t=-2$, a ramp with a slope of $\small -1$ begins. Your solution for this part is correct: $\small f(t)=(-t-2)u(t+2)$

2. At $\small t=0$, three things happen: the initial ramp is halted; the signal steps up by 2 units to the origin; and a new ramp with a slope of 2 begins. These three things can be combined into a single ramp, with appropriate slope, plus a step, $\small 2u(t)$

3. At t=1, ...

4. At t=3, ...

5. At t=4, ...

• Thank you sir... is this the right answer??: -r(t+2)+r(t)+2u(t) +2r(t)-2(t-1) -r(t-3)+r(t+4)-u(t) – Mohammad Asmar Feb 15 '16 at 19:21
• No. (-t-2) is a ramp of slope -1 and with vertical axis intercept of -2. But it needs to be forced to zero for t<-2, and for this you need to multiply by the unit step function (or more correctly the Heaviside function), u(t+2). This step function is zero for t<-2 and unity for t>-2. Hence the first part of the graph from t=-2 to t=0 is: (-t-2) u(t+2). Now you need to construct the remainder of the function. – Chu Feb 15 '16 at 23:18
• Note, the $\small 0\rightarrow 1$ transition for a unit step function u(x) occurs where the argument, x=0. Thus, a unit step u(t-a) is zero for $\small t<a$ and unity for $\small t \ge a$. Some other examples: the 0 to 1 transition for u(t-4) is at t=4; the transition for u(t+9) is at t=-9 – Chu Feb 15 '16 at 23:31

A ramp function is just a linear y = x for x>=0.

So I think your function cannot be expressed only with step functions because it has ramp parts

If you are allowed to use integration, then yes, you can represent it only with a combination of unit steps.

Take the derivative of that function, and you will see how a sum of unit steps can be combined to create its derivative. Then integrate that, and add more unit steps until the constant sections are correct.

If you cannot integrate, then yes, you need a sum of ramps and unit steps (I don't think you can do it with only ramps, perhaps someone can correct me if this is not the case?). Had you Googled "ramp function", you would find this, which is pretty much all you need to know.