## Discrete-Time Function

Simplificatation, evaluation, linear equations, linear graphs, linear inequalities, basic word problems, etc.
Posts: 3
Joined: Tue Oct 06, 2015 9:01 am
Contact:

### Discrete-Time Function

Consider: f(x(n)) = y(n) = n*x(n)

View f as a black box that takes as input some function x(n) and gives as output y(n).

And consider that: x(n) is 1 for n = 0,1,2,3 and 0 everywhere else.

Then f(x(n)) = y(n) is for n = -5 to 5: 0 0 0 0 0 0 1 2 3 0 0

Am I right?

PS: this is not all, but I am just preparing the ground

little_dragon
Posts: 226
Joined: Mon Dec 08, 2008 5:18 pm
Contact:

### Re: Discrete-Time Function

this is not all, but I am just preparing the ground
what does this mean?
Consider: f(x(n)) = y(n) = n*x(n)

View f as a black box that takes as input some function x(n) and gives as output y(n).

And consider that: x(n) is 1 for n = 0,1,2,3 and 0 everywhere else.

Then f(x(n)) = y(n) is for n = -5 to 5: 0 0 0 0 0 0 1 2 3 0 0

Am I right?
which part is u & which part is the orig Q?
if "then" starts u & if Q said to get values for f for n=-5 to n=5:
i think ur ans is rite

Posts: 3
Joined: Tue Oct 06, 2015 9:01 am
Contact:

### Re: Discrete-Time Function

Now.

I can write x(n) = u(n) - u(n-4), where u(n) is the unit step function. Thus:

f(x(n)) = f(u(n)-u(n-4)) = f(u(n)) - f(u(n-4)) = nu(n) - (n-4)u(n-4).

And this function, plotted with wolfram alpha (x*unitstep(x)-(x-4)*unitstep(x-4)) gives the following result:
0 0 0 0 0 0 1 2 3 4 4 4 4 ....

So, this is my confusion. I see a different result. What am I doing wrong? That is a linear function and superposition principle applies.

If, on the other hand, I am writing:
f(x(n)) = n*x(n) = n*(u(n)-u(n-4))
it gives the same result as in the beginning.

FWT
Posts: 153
Joined: Sat Feb 28, 2009 8:53 pm

### Re: Discrete-Time Function

I can write x(n) = u(n) - u(n-4), where u(n) is the unit step function.
This this right?

n = -5: u(-5) - u(-5 - 4) = u(-5) - u(-9) = 0 - 0 = 0
thru:
n = -1: u(-1) - u(-1 - 4) = u(-1) - u(-5) = 0 - 0 = 0

These are right, but:

n = 0: u(0) - u(0 - 4) = u(0) - u(-4) = 1/2 - 0 = 1/2
n = 1: u(1) - u(1 - 4) = u(1) - u(-3) = 1 - 0 = 1
n = 2: u(2) - u(2 - 4) = u(2) - u(-2) = 1 - 0 = 1
n = 3: u(3) - u(3 - 4) = u(3) - u(-1) = 1 - 0 = 1
n = 4: u(4) - u(4 - 4) = u(4) - u(0) = 1 - 1/2 = 1/2

Did you define u(0) to be 1 instead of 1/2?
Thus:

f(x(n)) = f(u(n)-u(n-4)) = f(u(n)) - f(u(n-4)) = nu(n) - (n-4)u(n-4).
Is this the same? You started with

$x(n)\, =\, \begin{cases}0&\mbox{ for }\, n\, \neq\, 0,\, 1,\, 2,\, 3\\1&\mbox{ for }\, n\, =\, 0,\, 1,\, 2,\, 3 \end{cases}$

Then

$f(x(n))\, =\, n\,\times\, x(n)\, =\, \begin{cases}n\times 0\, =\, 0&\mbox{ for }\, n\, \neq\, 0,\, 1,\, 2,\, 3\\n\times 1\, =\, n&\mbox{ for }\, n\, =\, 0,\, 1,\, 2,\, 3 \end{cases}$

IOW, your formula is supposed to be f(x(n)) = n*x(n) = n*[u(n) - u(n - 4)] = n*u(n) - n*u(n - 4). But somehow you got the last term to be (n - 4)*u(n - 4). Shouldn't that first "n - 4" be just "n"?

Posts: 3
Joined: Tue Oct 06, 2015 9:01 am
Contact:

### Re: Discrete-Time Function

Yes. Is just n.

I study linear, time-invariant systems and I made a confusion between the mathematical model that describes the system and the relationship between the input and the output that might arise from such model (for ex, from a linear ODE).

In this case, f(x(n)) = nx(n) is linear but not time-invariant.