Linear systems in DSP

Thread Starter

jag1972

Joined Feb 25, 2010
71
Hi Folks,
I am teaching myself DSP and have got a problem with checking if a system is linear. The system is linear if and only if the rules of homogeneity and superposition apply. They are both the necessary and sufficient conditions for linearity.
I am stuck on the following
y[n]=x\(^{2}\)[n]
to check whether this is linear I can apply the homegneity rule that is multiply the system by a constant.
y[n]=αx\(^{2}\)[n]. if by making that constant 0 the output also goes to 0. The system obeys homegeneity, this is however only necassary not sufficent for linearity. The system must also obey superposition.
My understanding of it as that 2 seperate functions X1[n] + X2[n] should equal
if:
y1[n]=x1\(^{2}\)[n]
y2[n]=x2\(^{2}\)[n]

How does a response of the system become:

y3[n]= [α1x1[n]+β2x2[n]]\(^{2}\)

Surely this can not be looked at from the POV of numbers as:

3\(^{2}\)+4\(^{2}\) \(\neq \) (3+4)\(^{2}\)

I can only assume I have to look at it in terms of a digital system but can not visulaise it. Any help will be appreciated.
 

richworks

Joined May 31, 2012
1
x(n)^2 is non linear. Just look at the graph of that function.. You just proved it with both homogeneity and superposition. I don't understand what your question is, however..
 

Thread Starter

jag1972

Joined Feb 25, 2010
71
Thaks for replying, I understand the function is not linear in the mathematical sense, however do not undertstand from the POV of DSP system.
If it was linear then Y1[n]+Y2[n] = a1x1\(^{2}\)[n]+a2x2\(^{2}\)[n]. But Y3[n] = [a1 x1[n]+a2 x2[n])\(^{2}\).
I dont understand why Y3 equals what it does.
 

WBahn

Joined Mar 31, 2012
30,077
You have to keep in mind that the homogeneity and superposition properties apply to ARBITRARY constants, meaning that you don't have any say in what the particular value is.

If f(x) = x^2, then if this were linear it would have to be true that

f(Ax) = A*f(x)

for ANY value of A.

Similarly, it would have to be true that

f(x1+x2) = f(x1) + f(x2)

for ANY values of x1 and x2.

NOTE: Both of these requirements are often combined into the following necessary and sufficient requirement:

f(A*x1+B*x2) = A*f(x1) + B*f(x2)

As for why y3 is what is it, you don't specify what x3 is (the input to the system that produces y3). Assuming

\(
f(x) = x^2
x_3 = \alpha x_1 + \beta x_2
\)
then
\(
y_3 = f(x_3)
y_3 = (x_3)^2
y_3 = (\alpha x_1 + \beta x_2)^2
\)
 

Thread Starter

jag1972

Joined Feb 25, 2010
71
Thanks WBahn for that excellent explanation, I understand now completely.

I can not believe I did not connect:

fx\(_{3}\)[n]=x\(_{1}\)[n] + x\(_{2}\)[n] and therefore:

y\(_{3}\)[n]= x\(_{3}\)[n]

as: y[n]=x[n]\(^{2}\) then

y3[n]=x3[n]\(^{2}\)

Seems so obvious now, doh!
 

Thread Starter

jag1972

Joined Feb 25, 2010
71
Could someone please confirm I have got this right please.

Is this a linear system.

y[n] = x[n-1] x[n+1]

This system will pass the homogeneity part. If a zero is multiplied to x[n] then y[n] will be zero.

However for the superposition part.

The linear combination of y3[n] should be:
y\(_{3}\)[n]= \(\alpha\)x[n-1] x[n+1] + \(\beta\) x[n-1] x[n+1]

However the digital system will deal with the same sample at once. x1[n-1] and x2[n-1] are both fed into a multiplier of the digital system for which this is the difference equation. Therefore x3[n] is:

x\(_{3}\)[n]= \(\alpha\) x\(_{1}\)[n-1] x\(_{2}\)[n+1] + \(\beta\) x\(_{2}\)[n+1] x\(_{2}\)[n+1]

The two are not the same therefore the system can not be linear. Is this correct or have I made a mistake in understanding.
 

WBahn

Joined Mar 31, 2012
30,077
You're doing it again!

When applying the homogeneity rule, you don't get to pick a particular special magical value for the multiplying constant. It must apply for ANY and ALL values of the multiplying constant.

The homogeneity rule basically says that if we double the strength of the input signal, that the strength of the output signal will double.

\(
f(\alpha x) = \alpha f(x)
\)

For this problem, you have

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

Now what happens if we multiply x[n] by α to generate a new input sequence?

\(
x_2[n] = \alpha x[n]
\)

If homogeneity holds, then the output must be

\(
y_2[n] = \alpha y[n]
\)

But

\(
y[n] = (\alpha x[n-1])(\alpha x[n+1])
y[n] = \alpha^2(x[n-1]x[n+1])
y[n] = \alpha^2 y[n]
\)

Therefore homogeneity does not hold.
 

Thread Starter

jag1972

Joined Feb 25, 2010
71
Thanks for the reply. You are right I am making mistakes overall. However let
me explain what I mean by using the constants is:

if the digital system is: y[n]=x[n]

I thought homogeneity means that if you multiply the input and output by a constant, they should be equal. As you say there is no magic number, however the system has to hold true for all values of the constant. if we can use any value for the constant. Why not zero as this is easy to test.

\(\alpha\)y[n]= \(\alpha\)x[n]

If \(\alpha\) is 0, this will make both sides of th2 equation equal to 0 (pass homogeneity)

However this function: \(\alpha\)y[n]= \(\alpha\)x[n] + C

which is in linear equation is not a linear system because when alpha is 0 it does not guarantee that the output will be 0 because of the constant.

That is why I was using 0 to start.

You are totally correct and I thank you for the superposition part as I am continuously making mistakes on it. I must keep practising.
 

WBahn

Joined Mar 31, 2012
30,077
Thanks for the reply. You are right I am making mistakes overall. However let
me explain what I mean by using the constants is:

if the digital system is: y[n]=x[n]
First off, y[n] is not equal to x[n] unless your digital system passes the input directly to the output (and such a system would be a linear one).

In general, you have an input sequence, x[n], that is passed through a digital system, characterized by some function f(), to produce an output sequence, y[n]. Or

y[n] = f(x[n])

I thought homogeneity means that if you multiply the input and output by a constant, they should be equal.
True.

As you say there is no magic number, however the system has to hold true for all values of the constant. if we can use any value for the constant. Why not zero as this is easy to test.
Because it may happen to work for zero. It may happen to work for pi. It may happen to work for 112.37. But if it doesn't also work for 2.718 and 42 and every other number in the universe, then it fails to hold, period.

\(\alpha\)y[n]= \(\alpha\)x[n]

If \(\alpha\) is 0, this will make both sides of th2 equation equal to 0 (pass homogeneity)
If your system is the identity function (output equals input), then it does pass homogeneity, but not because it happens to work for 0, but because it works no matter what the constant is.

However this function: \(\alpha\)y[n]= \(\alpha\)x[n] + C

which is in linear equation is not a linear system because when alpha is 0 it does not guarantee that the output will be 0 because of the constant.

That is why I was using 0 to start.
If you can find one value, any value, for which it does not hold, then that is all that is needed to prove that homogeneity does not hold. But the reverse is not true, finding a single value for which it does work does not prove that it works for ALL values.

The way to show that it works for all values is for the multiplying constant to cancel out. If it cancels out, then clearly it doesn't matter what value it is.
 
Top