Great video! Now it all makes sense. When I studied Lagrange polynomials, I only understood enough to work out the interpolation polynomials but never really grasped the intricate details behind them. Your video - like your other video of Pade approximations - has made the whole concept a lot clearer to me. Thank you!
I remember developing the interpolation polynomial formula in college for fun. My discrete math professor gave a puzzle to the class to come up with polynomials that for many integer inputs return prime number outputs. I switched the problem a little bit for myself in that I asked "how can I make a polynomial that passes through each of these arbitrary points?" And as I solved this puzzle on my own over the next two weeks I developed this interpolation method on my own and it felt so empowering. I showed it to a few of my other professors and we proved that there is only one line passing through two points, only one parabola passing through three points, only one cubic passing through four points, only one quartic passing though five points, etcetera for all natural numbers of points. Anyway, some of my most enjoyable days of college were solving these puzzles.
I found this video from the Advent of Code 2023, because it needed Lagrange Polynomials to solve one of the problems (without telling you). Maybe you'd enjoy the problems in Advent of Code as well? It's free and open, so could just check it out. One of these year people also found the Chinese Remainder Theorem for example...
Best comment ever! Really though, it is such a fun journey to figure out error correcting codes. Might I suggest my favorite the Reed Solomon Vandermonde variant as the most challenging IHMO. For a cherry on the cake implement a real finite field of any scalar bit width and don't cheat with dog slow 8 bit toy implementations :). Taught me everything I'll ever want to know about applied mathematics in computer science.
I love the way you explain things, its so straight forward and intuitive that it makes it feel like it's something I could've come up with. Really good explanations in this video and the Padé approximations, which I had never heard before. Thanks for making great content
Wow! Awesome explanation! I particularly love how you broke down Lagrange polynomials into the smaller order polynomials that compose it and how those were "guessed" in the first place. Very intuitive explanation. Thank you!
This was perfect. Why can't professors explain like this? Easy to understand with nice graphics for the visual learners + soothing voice that helps you concentrate. Thank you!
I'm a French student and I have to do researches on Lagrange interpolation theorem. Your video is the only that helped me understand the subject, not a single French video helped me on this.
well, i'm actually dealing with maths in french, and it is my second language, but I swear that no french speaking professor on youtube was able to transmit this idea as smoothly as you did,sir. I appreciate that tysm...
This is excellent. I've reviewed my materials and looked at a bunch of others online but this is far and away the best explanation I've found. Thank you!
Dr. Will THANK YOU! I'm getting all worked up over the bad explanation of my teacher and book, and I watch the first minute of your video and I get it. You rock!
Thank you! The visual representation really makes it clear how the interpolated polynomial gets the correct values. Also, splitting it into steps rather than just giving us the entire equation all at once!
Great video. Just connected all the dots in my head. Thank you! I cannot believe that some random guys with far lesser skills in teaching dominate the search results...
A music teacher told me that a really good music teacher is always a really good musician.. I wonder how true that is of mathematicians. I took a BA in math at UCSC and only had a couple really good teachers.. Tnx Dr Wood for these very helpful videos.. Almost want to take out my old Burden and Faires and write some code!
Thank you for this! In my math class at Uni, they just sort of wrote up lagrange polynomial interpolation so they could use it for integral approximation. However they told us nothing of where it came from, so this helps a lot!
Thank you so much! I stumbled upon that when researching Shamir's Secret Sharing Algorithm but at that point the formulas just went straight over my head but this is explained so clear, I love it
Great material. In comms, we use Lagrange interpolators in control loops doing timing recovery. Typically, we refer to them as Farrow filters. But they are, in essence, just a lagrange polynomial. A matrix multiply derives the coefficients, and then we evaluate the polynomial at the desired sample location. In modern FPGAs, we have resolutions of 1/2^26 evaluation points between samples. They're flexible as resamplers, interpolators or phase shifters for phased antenna arrays. So many great applications.
Also, in FPGAs, where multiply and accum (MAC) HW is prevalent, the Horner decomposition is really useful. Y = c0 + c1*x + c2*x^2 + c3*x^3 + c4*x^4 Y = c0 + x(c1 + x(c2 + x(c3 + c4*x))) It can be decomposed this way into a series of MACs for which we have fast hardware. If you have enough clocks, you can even get it done reusing 1 MAC (DSP48e2).
I'm really unfamiliar with that topic could you give me some hand holds/ search terms to look this up? I'm really curious about the application of this method.
@@drvanon Sure. Happy to comment. First, a fantastic reference on the subject is "Digital Signal Processing with Field Programmable Gate Arrays (Fourth Edition)" by Uwe Meyer-Baese. He covers the topic in section 5.6, Arbitrary Sample Rate Converters. Subsection 5.6.2 is Polynomial Fractional Delay Design specifically treats Lagrange Polynomial interpolators. If you're a MATLAB user, Farrow filters are equivalent mathematically to cubic spline interp. But if you have the comms or DSP toolbox (can't remember which), there's a Fractional Rate Converter that is a farrow and will actually give you the matrix of coefficients you need for the matrix mult to derive the polynomial coefficients. In HW, you only have to do one multiply for that matrix, as the other coeffiecients are divisions by powers of 2, so shifts work. So you do one multiply, and then a bunch of shifts and some adds. Then, for evaluating the polynomial, it's a bunch of recursive MACs. There's a bunch of bookeeping to handle. You'll need a phase accumulator that will need to wrap. You can use this for interpolation or decimation. In the decimation case, you'll occasionally need to slip a sample. In the interp case, you'll potentially have multiple polynomial evaluations per sample location.
One nuance to add is that you can use a lagrange polynomial of arbitrary length. Typically a 3rd or 4th order polynomial is used in comms work, as going beyond that doesn't give much of a return on investment. Uwe-Meyer mentions that in some audio work in SW processing, they've used polynomials of very high order. I'm not sure what the motivation is. But with a 3rd or 4th order polynomial, it's still very efficient in HW. If you're working in something like a Zynq Ultrascale+, and are running at 350 MHz for your sysclk, and have a signal in the 30 MSPS range, this is VERY realizable with 1 DSP for real and 1 DSP for imag. (I think I use a third DSP for my phase accumulator so I can hit a good fmax). I do a lot of OFDM work. Typically, when I'm running my timing control loops, I'll measure the accumulated phase angle of the channel estimates and run that into a PID which is then driving the Farrow Filter resample rate. Driving the error to zero essentially locks you "on-baud" in the OFDM sense that you're triggering your FFTs precisely on the instant that you need to. That helps in tracking the signal timing drift, but it also means your equalizer doesn't have to work very hard... i.e. the sinusoid in the frequency domain on your channel estimate isn't there, and you have more significant bits for equalizer precision. It's worth the effort. It translates to multiple dB SNR improvement on the recovered constellation.
Ugh, I just used Lagrange interp to make a camera fly about between points so 5 minutes ago, if I was asked if I understood it I'd have said nodded my head and said "pretty decent understanding". After this video I'm revising my self-appraisal to "I'm effectively clueless".
you don't know how this material was unnecessarily made complicated in your classes in university. I'm amazed how clearly and simply you explain what others couldn't. Thanks a lot
It brings back memories of my glorious days that I used this thing to predict pattern of the prime numbers. No matter how hard I tried, everything just failed successfully.
A very important point is that the interpolation formula (another polynomial) can be doing something totally different than the function outside the selected points, even between the selected points.
Is this method unsuitable if there's any noise in the original observation of the "nodes"? If this method guarantees the lowest order polynomial, then I guess it could give a polynomial of order 1 million that *exactly* fits the nodes, instead of a very low order polynomial that *almost* fits the nodes.
My background is in physics and this is exactly what I was wondering too! My thought was that it introduces a new variable for each data point, which practically never works with "real life data". Im curious if that means this is not suited for fitting then, or if it can be modified to be more suitable. If the former, what are then the practical uses of this?
The higher the order of the polynomials, the more that noise yields vastly different results. It gets more unstable as you add more points. The polynomial will still always fit the intended points, but the interpolating polynomials become wildly different for more and more points. If approximations robust to noise are what you need, you can try other interpolation methods, like fourier
Yes! Of any variable count, and in any configuration you can imagine ( Degree of each variable ). As long as you don't run out of data points. I like to think of it as a fractal reduction of functions.