Skip to content

Instantly share code, notes, and snippets.

@olekravchenko
Created April 28, 2016 05:30
Show Gist options
  • Save olekravchenko/1959865e90fbfab7675277259876ed5b to your computer and use it in GitHub Desktop.
Save olekravchenko/1959865e90fbfab7675277259876ed5b to your computer and use it in GitHub Desktop.
up.nb
FTup[x_, elemProd_] := Product[Sinc[x 2^-k], {k, 1, elemProd}]
up[x_, elemProd_, elemSum_] :=
If[-1 <= x && x <= 1,
0.5 + Sum[FTup[k \[Pi], elemProd] Cos[\[Pi] k x], {k, 1, elemSum}],
0]
elemProd = 4;
elemSum = 20;
Plot[{up[x, elemProd, elemSum]}, {x, -1 - 0.025, 1 + 0.025},
PlotRange -> Full, PlotStyle -> Thick,
PlotLabel -> Text[Style["up(x) function", 12]], Filling -> Axis,
ImageSize -> 640]
@olekravchenko
Copy link
Author

Computation of atomic up(x) function (first prime of Fabius function) by Fourier cosine series approximation (since up(x) is even function).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment