This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
b:slope_compensation [2022/01/25 17:30] sz |
b:slope_compensation [2022/01/25 17:41] (current) sz |
||
|---|---|---|---|
| Line 15: | Line 15: | ||
| Fourier analysis assumes that a signal repeats on some fixed cycle. If a signal does not do this, then FA cannot be used. At least without closing the cycle or the like. | Fourier analysis assumes that a signal repeats on some fixed cycle. If a signal does not do this, then FA cannot be used. At least without closing the cycle or the like. | ||
| - | This program shows that when the " | + | This program shows that when the " |
| + | This means that the linear term "c x" completely prevents the linear slope from affecting the true Sin[ ] component. | ||
| also to find out how to structure data for FindFit | also to find out how to structure data for FindFit | ||
| " | " | ||
| - | < | + | < |
| - | Clear[x, | + | |
| - | imax=20 | + | Clear[x,y,x1]; |
| - | x2=Table[i, | + | imax=20; |
| + | x2=Table[i/2.,{i,imax}]; | ||
| Print[" | Print[" | ||
| - | a1=1; b1=25; c1=20; | + | a1=1.01; b1=25; c1=10; |
| - | y= Table[a1 Sin[2 Pi .1 x1] + b1 + c1 x1, | + | xy= Table[{x1/2.,a1 Sin[2 Pi .1 x1/2.]+ b1 + c1 x1/2.}, |
| - | Print[" | + | Print[" |
| - | ff=FindFit[y,a Sin[2 Pi .1 x] + b + c x, | + | ff=FindFit[xy,a Sin[2 Pi .1 x] + b + c x,{a,b,c},x]; |
| + | Print[" | ||
| Print[" | Print[" | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | Clear[x, y, x1]; | ||
| - | imax = 20; | ||
| - | x2 = Table[i/2., {i, imax}]; | ||
| - | Print[" | ||
| - | |||
| - | a1 = 1.03456789; b1 = 25; c1 = 10; | ||
| - | xy = Table[{x1/ | ||
| - | Print[" | ||
| - | |||
| - | ff = FindFit[xy, a Sin[2 Pi .1 x] + b + c x, {a, b, c}, x]; | ||
| - | Print[" | ||
| - | Print[" | ||
| - | |||
| x {0.5, | x {0.5, | ||
| + | xy {{0.5, | ||
| + | angles {0.314159, | ||
| + | ff {a-> | ||
| - | xy {{0.5, | ||
| - | |||
| - | angles {0.314159, | ||
| - | ff {a-> | ||
| </ | </ | ||