Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hilbertTransformSmoothFinite[f_, x_?NumericQ, supp_, s_: 1] :=
- Module[{esupp, ef},
- esupp = {supp[[1]] - Abs[f[supp[[1]]]]/s,
- supp[[2]] + Abs[f[supp[[2]]]]/s};
- ef = Function[X, Piecewise[{{f[X], supp[[1]] < X <= supp[[2]]},
- {f[supp[[1]]] + Sign[f[supp[[1]]]] s (X - supp[[1]]),
- esupp[[1]] < X <= supp[[1]]},
- {f[supp[[2]]] - Sign[f[supp[[2]]]] s (X - supp[[2]]),
- supp[[2]] < X <= esupp[[2]]}, {0, True}}]];
- NIntegrate[
- 1/\[Pi] (ef[\[Xi]] - ef[x])/(\[Xi] - x), {\[Xi], esupp[[1]],
- esupp[[2]]}] +
- 1/\[Pi] ef[x] Log[(esupp[[2]] - x)/(x - esupp[[1]])]]
- hh = h /. NDSolve[{h'[x] == x, h[0] == 0}, h, {x, 0, 1}][[1]];
- p = Function[x, hilbertTransformSmoothFinite[hh, x, {0, 1}]];
- Plot[p[x], {x, 0, 1}]
- Plot[p'[x], {x, 0, 1}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement