Main Content

laurentPolynomial

Create Laurent polynomial

Since R2021b

    Description

    Use the laurentPolynomial object to create a Laurent polynomial with real-valued polynomial coefficients. You can specify the maximum order of the polynomial. You can perform mathematical and logical operations on Laurent polynomials. You can also create a lifting scheme associated with a pair of Laurent polynomials.

    Creation

    Description

    lpoly = laurentPolynomial creates the constant Laurent polynomial, where the constant is equal to 1 and the maximum order is equal to 0.

    lpoly = laurentPolynomial(Name=Value) creates a Laurent polynomial with Properties specified by name-value arguments. For example, laurentPolynomial(MaxOrder=2) creates a Laurent polynomial with maximum order equal to 2. You can specify multiple name-value arguments.

    example

    Properties

    expand all

    Laurent polynomial coefficients, specified as a real-valued vector. If k is the length of the vector C, then lpoly = laurentPolynomial(Coefficients=C) represents the Laurent polynomial

    lpoly(z)=m=1kC(m)z1m.

    Example: If C = [4 3 2 1], then P = laurentPolynomial(Coefficients=C) represents the Laurent polynomial P(z)=4+3z1+2z2+z3.

    Data Types: double

    Maximum order of the Laurent polynomial, specified as an integer. If k is the length of the vector C and d is an integer, then lpoly = laurentPolynomial(Coefficients=C,MaxOrder=d) represents the Laurent polynomial

    lpoly(z)=m=1kC(m)zdm+1.

    Example: If C = [2 4 6 8], then P = laurentPolynomial(Coefficients=C,MaxOrder=1) represents the Laurent polynomial P(z)=2z+4+6z1+8z2.

    Data Types: double

    Object Functions

    expand all

    degreeDegree of Laurent polynomial
    euclidEuclidean algorithm for Laurent polynomials
    polyphasePolyphase components of Laurent polynomial
    mpowerLaurent polynomial exponentiation
    horzcatHorizontal concatenation of Laurent polynomials
    vertcatVertical concatenation of Laurent polynomials
    lp2filtersLaurent polynomials to filters
    lp2LSLaurent polynomials to lifting steps and normalization factors
    neLaurent polynomials inequality test
    rescaleRescale Laurent polynomial
    dyaddownDyadic downsampling of Laurent polynomial or Laurent matrix
    dyadupDyadic upsampling of Laurent polynomial or Laurent matrix
    eqLaurent polynomials or Laurent matrices equality test
    plusLaurent polynomial or Laurent matrix addition
    minusLaurent polynomial or Laurent matrix subtraction
    mtimesLaurent polynomial or Laurent matrix multiplication
    reflectLaurent polynomial or Laurent matrix reflection
    uminusUnary minus for Laurent polynomial or Laurent matrix

    Examples

    collapse all

    Create three Laurent polynomials:

    • a(z)=1+z-1

    • b(z)=z2+3z+z-1

    • c(z)=z3+3z2+5z+7

    a = laurentPolynomial(Coefficients=[1 1])
    a = 
      laurentPolynomial with properties:
    
        Coefficients: [1 1]
            MaxOrder: 0
    
    
    b = laurentPolynomial(Coefficients=[1 3 0 1],MaxOrder=2)
    b = 
      laurentPolynomial with properties:
    
        Coefficients: [1 3 0 1]
            MaxOrder: 2
    
    
    c = laurentPolynomial(Coefficients=[1 3 5 7],MaxOrder=3)
    c = 
      laurentPolynomial with properties:
    
        Coefficients: [1 3 5 7]
            MaxOrder: 3
    
    

    Addition

    Add the two polynomials a(z) and b(z). Use the helper function helperPrintLaurent to print the result in algebraic form.

    polySum = plus(a,b)
    polySum = 
      laurentPolynomial with properties:
    
        Coefficients: [1 3 1 2]
            MaxOrder: 2
    
    
    res = helperPrintLaurent(polySum);
    disp(res)
    z^(2) + 3*z + 1 + 2*z^(-1)
    

    Add 2 to b(z).

    consSum = b+2;
    res = helperPrintLaurent(consSum);
    disp(res)
    z^(2) + 3*z + 2 + z^(-1)
    

    Subtraction

    Subtract a(z) from b(z).

    polyDiff = minus(b,a);
    res = helperPrintLaurent(polyDiff);
    disp(res)
    z^(2) + 3*z - 1
    

    Subtract a(z) from 1.

    consDiff = 1-a;
    res = helperPrintLaurent(consDiff);
    disp(res)
    - z^(-1)
    

    Multiplication

    Multiply a(z) and b(z).

    polyProd = mtimes(a,b);
    res = helperPrintLaurent(polyProd);
    disp(res)
    z^(2) + 4*z + 3 + z^(-1) + z^(-2)
    

    Compute a(z)c(z)-b(z).

    polyProd2 = a*c-b;
    res = helperPrintLaurent(polyProd2);
    disp(res)
    z^(3) + 3*z^(2) + 5*z + 12 + 6*z^(-1)
    

    To multiply a Laurent polynomial by a constant, use the rescale function.

    consProd = rescale(b,7);
    res = helperPrintLaurent(consProd);
    disp(res)
    7*z^(2) + 21*z + 7*z^(-1)
    

    Exponentiation

    Raise a(z) to the fourth power.

    polyPow = mpower(a,4);
    res = helperPrintLaurent(polyPow);
    disp(res)
    1 + 4*z^(-1) + 6*z^(-2) + 4*z^(-3) + z^(-4)
    

    Compute b2(z)-c(z).

    polyPow2 = b^2-c;
    res = helperPrintLaurent(polyPow2);
    disp(res)
    z^(4) + 5*z^(3) + 6*z^(2) - 3*z - 1 + z^(-2)
    

    Create two Laurent polynomials:

    • a(z)=z-1

    • b(z)=-2z3+6z2-7z+2

    a = laurentPolynomial(Coefficients=[1 -1],MaxOrder=1);
    b = laurentPolynomial(Coefficients=[-2 6 -7 2],MaxOrder=3);

    Reflection

    Obtain the reflection of b(z).

    br = reflect(b);
    res = helperPrintLaurent(br);
    disp(res)
    2 - 7*z^(-1) + 6*z^(-2) - 2*z^(-3)
    

    Unary Minus

    Confirm the sum of b(z) and its unary negation is equal to 0.

    b+uminus(b)
    ans = 
      laurentPolynomial with properties:
    
        Coefficients: 0
            MaxOrder: 0
    
    

    Degree

    Multiply a(z) and b(z). Confirm the degree of the product is equal to the sum of the degrees of a(z) and b(z).

    ab = a*b;
    degree(ab)
    ans = 
    4
    
    degree(a)+degree(b)
    ans = 
    4
    

    Exponentiation

    Raise a(z) to the third power. Confirm the result is not equal to b(z).

    a3 = a^3;
    a3 ~= b
    ans = logical
       1
    
    

    Rescale

    Confirm a(z) raised to the third power is equal to -b(z)/2-z/2.

    zt = laurentPolynomial(Coefficients=[-1/2],MaxOrder=1);
    b2 = rescale(b,-1/2)+zt;
    eq(a3,b2)
    ans = logical
       1
    
    

    Dyadic Operations

    Create the Laurent polynomial c(z)=k=-34(-1)kkzk. Obtain the degree of c(z).

    cfs = (-1).^(-3:4).*(-3:4);
    c = laurentPolynomial(Coefficients=fliplr(cfs),MaxOrder=4);
    res = helperPrintLaurent(c);
    disp(res)
    4*z^(4) - 3*z^(3) + 2*z^(2) - z + z^(-1) - 2*z^(-2) + 3*z^(-3)
    
    degree(c)
    ans = 
    7
    

    Obtain the dyadic upsampling and downsampling of c(z). Obtain the degree of both polynomials.

    dUp = dyadup(c)
    dUp = 
      laurentPolynomial with properties:
    
        Coefficients: [4 0 -3 0 2 0 -1 0 0 0 1 0 -2 0 3]
            MaxOrder: 8
    
    
    degree(dUp)
    ans = 
    14
    
    dDown = dyaddown(c)
    dDown = 
      laurentPolynomial with properties:
    
        Coefficients: [4 2 0 -2]
            MaxOrder: 2
    
    
    degree(dDown)
    ans = 
    3
    

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2021b