Linear systems in DSP

Discussion in 'Math' started by jag1972, May 31, 2012.

  1. jag1972

    Thread Starter Active Member

    Feb 25, 2010
    60
    0
    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.
     
  2. richworks

    New Member

    May 31, 2012
    1
    0
    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..
     
  3. jag1972

    Thread Starter Active Member

    Feb 25, 2010
    60
    0
    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.
     
  4. WBahn

    Moderator

    Mar 31, 2012
    17,747
    4,795
    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

    <br />
f(x) = x^2<br />
x_3 = \alpha x_1 + \beta x_2<br />
    then
    <br />
y_3 = f(x_3)<br />
y_3 = (x_3)^2<br />
y_3 = (\alpha x_1 + \beta x_2)^2<br />
     
  5. jag1972

    Thread Starter Active Member

    Feb 25, 2010
    60
    0
    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!
     
  6. jag1972

    Thread Starter Active Member

    Feb 25, 2010
    60
    0
    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]= \alphax[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.
     
  7. WBahn

    Moderator

    Mar 31, 2012
    17,747
    4,795
    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.

    <br />
f(\alpha x) = \alpha f(x)<br />

    For this problem, you have

    <br />
y[n] = x[n-1]x[n+1]<br />

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

    <br />
x_2[n] = \alpha x[n]<br />

    If homogeneity holds, then the output must be

    <br />
y_2[n] = \alpha y[n]<br />

    But

    <br />
y[n] = (\alpha x[n-1])(\alpha x[n+1])<br />
y[n] = \alpha^2(x[n-1]x[n+1])<br />
y[n] = \alpha^2 y[n]<br />

    Therefore homogeneity does not hold.
     
  8. jag1972

    Thread Starter Active Member

    Feb 25, 2010
    60
    0
    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.

    \alphay[n]= \alphax[n]

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

    However this function: \alphay[n]= \alphax[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.
     
  9. WBahn

    Moderator

    Mar 31, 2012
    17,747
    4,795
    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])

    True.

    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.

    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.

    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.
     
  10. jag1972

    Thread Starter Active Member

    Feb 25, 2010
    60
    0
    WBahn, Thanks you very much for your time. Your replies have been very helpfull.
     
Loading...