Manipulating Numerical Data
When you have numerical data, it is often convenient to find a simple formula that approximates it. For example, you can try to "fit" a line or curve through the points in your data.
|fit the values yn to a linear combination of functions fi|
|fit the points (xn, yn) to a linear combination of the fi|
Fitting curves to linear combinations of functions.
This finds a least-squares fit to data
of the form c1+c2x+c3x2
. The elements of data
are assumed to correspond to values 1
This finds a fit of the form c1+c2x+c3x3+c4x5
This gives a table of x
This finds a fit to the new data, of the form c1+c2sin (x)+c3sin (2x)
|find a fit to form with parameters pi|
Fitting data to general forms.
This finds the best parameters for a linear fit.
This does a nonlinear fit.
One common way of picking out "signals" in numerical data is to find the Fourier transform
, or frequency spectrum, of the data.
Here is a simple square pulse.
This takes the Fourier transform of the pulse.
Note that the Fourier
function in Mathematica
is defined with the sign convention typically used in the physical sciences—opposite to the one often used in electrical engineering. "Fourier Transforms"
gives more details.