Equation to Matlab code
Show older comments
Can someone please help to me understand how the equation (eq. 47) and code given in the picture relate ?
Any hint or suggestion would be of great help.
In the equation c is the order of the polynomial.
Thank you.

5 Comments
Rik
on 1 Aug 2022
There are several algebraic steps between the two forms. The x seems to be substituted already.
I must admit I don't understand the mathematical description well enough to understand why the code is equivalent.
Torsten
on 1 Aug 2022
I guess LPC(i,j) is the value of j-th coefficient of the i-th Legendre polynomial.
jessupj
on 1 Aug 2022
i think OP needs to define what the intended domain is. there's no x anywhere here.
start with
x=linspace(0,1,25);
Jeffrey Clark
on 2 Aug 2022
@Ajai Singh, @Torsten is correct - the LPC values are the computed multipliers for the x^(c-n) terms of the Legendre polynomials. So LPC(1,1) is the multiplier for the zero order Legendre polynomial, which is 1*x^0; similarly LPC(2,1:2) are the mulpliers for the 1st order polynomial 0*x^0 + 1*x^1. Check that the MATLAB code provided does compute the 2nd order polynomial multipliers when c = 3 to be LPC(3,1:3) = [-0.5 0 1.5] as in -0.5*x^0 + 0*x^1 + 1.5*x^2.
A table for the first 11 (0->10) can be seen in this article Legendre polynomials - Wikipedia
Note that MATLAB functions that operate on this short hand description of polynomials generally expects them in reverse order. See Polynomial roots - MATLAB roots (mathworks.com)
John D'Errico
on 2 Aug 2022
Edited: John D'Errico
on 2 Aug 2022
@jessupj - The Legendre polynomials from this family will be orthognal on the interval [-1,1], NOT [0,1]. In fact though, they could be evaluated on ANY interval, as they are still just polynomials. Some people choose to define the Legendre polynomials on the interval [0,1], which is entirely doable. But were you to do that, you would find a different family of polynomials. Regardless, you do not need to define what x is before you create any polynomials.
Accepted Answer
More Answers (0)
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!