laurentPolynomial
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
creates the
constant Laurent polynomial, where the constant is equal to 1 and the maximum order is
equal to 0.lpoly
= laurentPolynomial
creates a Laurent polynomial with Properties specified by
name-value arguments. For example, lpoly
= laurentPolynomial(Name=Value
)laurentPolynomial(MaxOrder=2)
creates a Laurent polynomial with maximum order equal to 2. You can specify multiple
name-value arguments.
Properties
Coefficients
— Laurent polynomial coefficients
1
(default) | real-valued vector
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
Example: If C = [4 3 2 1]
, then P =
laurentPolynomial(Coefficients=C)
represents the Laurent polynomial
Data Types: double
MaxOrder
— Maximum order
0
(default) | integer
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
Example: If C = [2 4 6 8]
, then P =
laurentPolynomial(Coefficients=C,MaxOrder=1)
represents the Laurent
polynomial
Data Types: double
Object Functions
Specific to laurentPolynomial
degree | Degree of Laurent polynomial |
euclid | Euclidean algorithm for Laurent polynomials |
polyphase | Polyphase components of Laurent polynomial |
mpower | Laurent polynomial exponentiation |
horzcat | Horizontal concatenation of Laurent polynomials |
vertcat | Vertical concatenation of Laurent polynomials |
lp2filters | Laurent polynomials to filters |
lp2LS | Laurent polynomials to lifting steps and normalization factors |
ne | Laurent polynomials inequality test |
rescale | Rescale Laurent polynomial |
Common to laurentPolynomial and laurentMatrix
dyaddown | Dyadic downsampling of Laurent polynomial or Laurent matrix |
dyadup | Dyadic upsampling of Laurent polynomial or Laurent matrix |
eq | Laurent polynomials or Laurent matrices equality test |
plus | Laurent polynomial or Laurent matrix addition |
minus | Laurent polynomial or Laurent matrix subtraction |
mtimes | Laurent polynomial or Laurent matrix multiplication |
reflect | Laurent polynomial or Laurent matrix reflection |
uminus | Unary minus for Laurent polynomial or Laurent matrix |
Examples
Basic Mathematical Operations Applied to Laurent Polynomials
Create three Laurent polynomials:
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 and . 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 .
consSum = b+2; res = helperPrintLaurent(consSum); disp(res)
z^(2) + 3*z + 2 + z^(-1)
Subtraction
Subtract from .
polyDiff = minus(b,a); res = helperPrintLaurent(polyDiff); disp(res)
z^(2) + 3*z - 1
Subtract from 1.
consDiff = 1-a; res = helperPrintLaurent(consDiff); disp(res)
- z^(-1)
Multiplication
Multiply and .
polyProd = mtimes(a,b); res = helperPrintLaurent(polyProd); disp(res)
z^(2) + 4*z + 3 + z^(-1) + z^(-2)
Compute .
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 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 .
polyPow2 = b^2-c; res = helperPrintLaurent(polyPow2); disp(res)
z^(4) + 5*z^(3) + 6*z^(2) - 3*z - 1 + z^(-2)
Properties of Laurent Polynomials
Create two Laurent polynomials:
a = laurentPolynomial(Coefficients=[1 -1],MaxOrder=1); b = laurentPolynomial(Coefficients=[-2 6 -7 2],MaxOrder=3);
Reflection
Obtain the reflection of .
br = reflect(b); res = helperPrintLaurent(br); disp(res)
2 - 7*z^(-1) + 6*z^(-2) - 2*z^(-3)
Unary Minus
Confirm the sum of and its unary negation is equal to 0.
b+uminus(b)
ans = laurentPolynomial with properties: Coefficients: 0 MaxOrder: 0
Degree
Multiply and . Confirm the degree of the product is equal to the sum of the degrees of and .
ab = a*b; degree(ab)
ans = 4
degree(a)+degree(b)
ans = 4
Exponentiation
Raise to the third power. Confirm the result is not equal to .
a3 = a^3; a3 ~= b
ans = logical
1
Rescale
Confirm raised to the third power is equal to .
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 . Obtain the degree of .
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 . 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
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)