1. Polynomial fit

1.1. Purpose

Fit a polynomial of degree \(n\) to the input signal.

1.2. Description

A polynomial \(p(x)=\sum_{i=0}^n p_i x^i=p_0 + p_1 x + p_2 x^2 + … p_n x^n\) of degree \(n\) is fit to the input signal using the method of least squares. That is, the error \(E = \sum_{j=0}^N \left| p(x_j) - f(x_j) \right|^2\) is minimized. In the error expression, \(N\) is the number of samples in the input signal \(f\). The fitted polynomial \(p\) can be subtracted from the original signal \(f\) in order to assess the quality of the fit.

The editor has two options:

  • Polynomial degree - which is the degree \(n\) of the polynomial to be fitted. The degree of the polynomial should be an integer from to 2 to 99.

  • Subtract - should the the fitted polynomial be subtracted from the original signal or not

1.3. Input

Any equidistant signal (see Signal Types ).

1.4. Output

The fitted polynomial or the difference between the fitted polynomial and the original signal.