Skip to content

Instantly share code, notes, and snippets.

@olekravchenko
Created May 12, 2016 16:59
Show Gist options
  • Save olekravchenko/8da89ecdbe0fcd8c85e145ce100aaf87 to your computer and use it in GitHub Desktop.
Save olekravchenko/8da89ecdbe0fcd8c85e145ce100aaf87 to your computer and use it in GitHub Desktop.
AsymetricAtomicFunction
(*FDE:
f'(x) = 2.25*(3f(3x) - 2f(3x-1) - f(3x-2)),
supp f = [0,1]
*)
(*Fourier Transform of f(x)*)
fFt[\[Omega]_] :=
Product[1/4 (3 - 2 Exp[-I \[Omega] 3^-n] - Exp[-2 I \[Omega] 3^-n])/(
I \[Omega] 3^-n), {n, 1, 4}]
(*Fourier Series of f(x)*)
f[x_] := 0.5 +
Sum[Re@fFt[\[Pi] m] Cos[\[Pi] m x] -
Im@fFt[\[Pi] m] Sin[\[Pi] m x], {m, 1, 50}]
(*Discrete Parameters*)
nx = 2^9; dx = 1/(nx - 1);
xTbl = Range[0, 1, dx];
fTbl = f[xTbl] // N;
(*Plots*)
Column@{
Plot[{Re@fFt[\[Omega]], Im@fFt[\[Omega]]}, {\[Omega], -30, 30},
PlotRange -> Full, ImageSize -> Medium],
ListLinePlot[Partition[Riffle[xTbl, fTbl], 2], ImageSize -> Medium]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment