Simple discrete functions

Thread Starter

jag1972

Joined Feb 25, 2010
71
I am a bit confused with simple discrete functions. A bit worried it may be something easy that I am missing, in which case please be kind.I would appreciate it if someone could help me.
For a simple discrete function like the following where x[n] = {-1,-2, 2, 2, 3}, the -2 being the sample 0 i.e. n=0. I have attached a picture of the function. Now if the function is delayed by 1 sample the function will look like this: y[n]=x[n-1]. The minus denoting a delay of 1 sample.
So for x[n-1], the minus denotes a lag, it’s not used as a subtraction. Therefore the discrete function would look as follows: y[n] = x[n-1] = {-1,-2, 2, 2, 3}, the -1 being sample =0.
When the function is reversed in time, then the sample amplitudes are flipped over with the 0 being the pivot point. The function being: y[n] = x [-n] , the series being {3,2, 2, -2, -1}, -2 being sample 0.
When there is a function which is reversed in time and also has a shifting value, then why does that arithmetic give you the correct sample number e.g.
y[n] = x [-n] , {3,2, 2, -2, -1} -2 is sample 0.
y[n]= x [-n-1] or y[n] = x[-1-n]
Sample number x[-n] substituted x[-n-1] New sample number
-3 -3-1 -4
-2 -2-1 -3
-1 -1-1 -2
0 0-1 -1
1 1-1 0

Why does a time reversed sifting of a discrete function give the correct new sample number when arithmetic is applied but the same does not happen for a function that is simply shifted.
For example y[n] = x[n-1], x[n] = {-1,-2, 2, 2, 3}, -2 is the sample 0.
Sample number x[n] substituted x[n-1] New sample number
-1 -1-1 -2, this should be the new sample 0.
And so on.
 

Attachments

WBahn

Joined Mar 31, 2012
29,979
So for x[n-1], the minus denotes a lag, it’s not used as a subtraction.
Uh...no. It very much is used for subtraction.

When you say

y[n] = x[n-1]

This is what happens.

I want to know y[4], which is equal to x[4-1] or x[3], which is 3. See -- the minus means subtraction.

I'm having a hard time following your description because I can't tell for sure what you mean by "new sample number".

I think where you are getting confused is that you are not composing your functions correctly.

y[n] = x[n-delay]
y[n] = x[(-1)^flip*n]

Think of these as the two operations we are working with - the parameter 'delay' is how much to shift the pattern to the right (i.e., delay it) and if flip is 0, we don't flip the pattern around zero, but if it is 1 we do.

Keeping in mind that 'n' is a dummy variable, we can replace it with any variable we want, as long as we do it on both sides.

So let's start with:

w[m] = x[m-1] (i.e., w[n] is x[n] delayed one step)

Now let's have:

y[n] = w[-n] (i.e., y[n] is w[n] flipped around n=0)

When we compose these, we have:

y[n] = w[(-n)] = x[(-n)-1] = x[-n-1]

The (-n) is the 'm' in the expression for w[m].

But what if we wanted to do the flip first?

w[m] = x[-m] (i.e., w[n] is x[n] flipped about n=0)
y[n] = w[n-1] (i.e., y[n] is w[n] delayed one step)

Now we get:

y[n] = w[(n-1)] = x[-(n-1)] = x[-n+1]

So, you can see that flips and shifts are not commutative - the order in which they are performed matters.
 

Thread Starter

jag1972

Joined Feb 25, 2010
71
Sorry, I still don’t get 100%.
This is an extract from your reply
‘I want to know y[4], which is equal to x[4-1] or x[3], which is 3. See -- the minus means subtraction’.
I thought y[4]=x[5]
If we take an arbitrary discrete sequence: x[n] = [9, 4, 6, 7, 3] where 6 is sample 0 (n=0).
Then if we express the function as: y[n]=x[n] i.e. ‘y’ is a function of ‘ n’
Then y[-2]=9, y[-1]=4,y=[0]=6,y[1]=7 and y[2]=3.
y[n]=x[n-1]
Then y[-2]=4, y[-1]=6,y=[0]=7,y[1]=3 and y[2]=0.
y[n]=x[n+1]
Then y[-2]=0, y[-1]=9,y=[0]=4,y[1]=6 and y[2]=7
Sorry if I am missing something simple .
 

WBahn

Joined Mar 31, 2012
29,979
Sorry, I still don’t get 100%.
This is an extract from your reply
‘I want to know y[4], which is equal to x[4-1] or x[3], which is 3. See -- the minus means subtraction’.
I thought y[4]=x[5]
In the example you are referring to, I said that we have y[n] = x[n-1]. If n=4, the n-1=3, so y[4]=n[3]. The result is that y[n] is the same as x[n] delayed by 1 sample.

If we take an arbitrary discrete sequence: x[n] = [9, 4, 6, 7, 3] where 6 is sample 0 (n=0).
Then if we express the function as: y[n]=x[n] i.e. ‘y’ is a function of ‘ n’
Then y[-2]=9, y[-1]=4,y=[0]=6,y[1]=7 and y[2]=3.
Agreed.

y[n]=x[n-1]
Then y[-2]=4, y[-1]=6,y=[0]=7,y[1]=3 and y[2]=0.
How do you figure this? Plug in a value of n, say n=0. Then you have y[0] = x[-1] which is 4. How do you get 7?

y[n]=x[n+1]
Then y[-2]=0, y[-1]=9,y=[0]=4,y[1]=6 and y[2]=7
Sorry if I am missing something simple .
Same question.
 

Thread Starter

jag1972

Joined Feb 25, 2010
71
I am afraid I am now extremely confused as I thought a 1 sample delay meant looking at next sample to the right by 1.
x[n-1]
1 one sample advance meant looking the sample to the left by 1.
x[n+1], I have made a mistake with my sequence whereby I have not shifted to the left by 1.
Working on my example discrete sequence: y[0]=x[0-1], must equal the amplitude when n = 1
i.e. y[0]=x[0-1] \(\equiv \)y[0]=x[1] which is 7.
 

WBahn

Joined Mar 31, 2012
29,979
Think of a delayed broadcast of a television show.

The original show, x, was broadcast at 2pm but the delayed broadcast, y, is seen at 4pn. That means that someone watching y and 4pm, y(4pm), sees what x broadcast at 2pm, x(2pm). Hence

y(4pm) = x(2pm)

Similarly

y(5pm) = x(3pm)

or

y(5pm) = x(5pm - 2hrs)

and, in general,

y(t) = x(t-2hrs)

Another way to see it is with example sequences (the sequences all start at n=0).

x[n] = n = {0,1,2,3,4,5,6}

Delay this sequence by two sample points:

x[n] = {0,0,0,1,2,3,4,5,6}

Notice that at any given value of n, y[n] is equal to what x was 2 samples prreviously, or x[n-2], hence

y[n] = x[n-2]
 

Thread Starter

jag1972

Joined Feb 25, 2010
71
Thanks for the reply.

I totally understand conceptually what you mean by using the delay in discrete systems. With this example discrete function y[n]= x[n-2], y[n] will equal what x was 2 samples ago. This is exactly the same as you stated, now if n =0, then y[n] will have the amplitude of the sample when n=2. The first sample is when n=0,samples after that are n=1,n-2 and so on. Samples before n=0 are n=-1, n=-2 and so on. Samples before 0 are actually impossible, however can be used by using statistical data (probability systems).
I think you are stating that a delay will result in a move to the right and an advance will result in a move to the left.
I think you are stating the opposite, or have I misunderstood.

Thanks in advance for your continued help.
 
Top