03-08-2020 04:42 AM
Hello,
I would like to ask you about the purpose of the ramp pattern in this code.
Thank you,
Daniel
03-08-2020 11:45 AM
When you look at LabVIEW code that you didn't write (such as the code you attached), and maybe don't quite understand how to use some of the Functions in that code (such as General Polynomial Fit), you can open the code in LabVIEW, right-click the function you don't understand, and read the Help for the function. If you did this, you would (probably) be able to understand why a Linear Ramp was wired to one of its inputs, hence would be able to answer your own question.
If you do this simple task yourself, you will learn (and remember) it better than if one of us "explains it for you" (and you will also learn how to do this yourself, next time).
Bob Schor
03-08-2020 11:45 AM - edited 03-08-2020 12:04 PM
it provides equally spaced x values for the polynomial fit with the same number of points as the signal (y).
(It is a design decision that the fit function will not work unless x is wired, it could have been handled internally. If you agree, please vote for this old idea. :D)
03-08-2020 11:55 AM - edited 03-08-2020 11:58 AM
Note that using a ramp from 0 ..N is a very poor design decision in this case (10 is an unreasonably high polynomial order to begin with!!!).
For reasonable input sizes (e.g. 2k),, x^10 goes up to ~1E33, which makes the linear algebra getting extremely high condition numbers and the fit will be ill-conditioned. Who wrote this?
A wandering baseline is NOT a 10th order polynomial!!! Completely silly!
03-08-2020 01:59 PM
I found it here:
Thank you for your advice.
Daniel