• API
• FAQ
• Tools
• Archive
SHARE
TWEET

Untitled

a guest Jun 9th, 2017 13 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. hilbertTransformSmoothFinite[f_, x_?NumericQ, supp_, s_: 1] :=
2.  Module[{esupp, ef},
3.   esupp = {supp[[1]] - Abs[f[supp[[1]]]]/s,
4.     supp[[2]] + Abs[f[supp[[2]]]]/s};
5.   ef = Function[X, Piecewise[{{f[X], supp[[1]] < X <= supp[[2]]},
6.       {f[supp[[1]]] + Sign[f[supp[[1]]]] s (X - supp[[1]]),
7.        esupp[[1]] < X <= supp[[1]]},
8.       {f[supp[[2]]] - Sign[f[supp[[2]]]] s (X - supp[[2]]),
9.        supp[[2]] < X <= esupp[[2]]}, {0, True}}]];
10.   NIntegrate[
11.     1/\[Pi] (ef[\[Xi]] - ef[x])/(\[Xi] - x), {\[Xi], esupp[[1]],
12.      esupp[[2]]}] +
13.    1/\[Pi] ef[x] Log[(esupp[[2]] - x)/(x - esupp[[1]])]]
14. hh = h /. NDSolve[{h'[x] == x, h[0] == 0}, h, {x, 0, 1}][[1]];
15. p = Function[x, hilbertTransformSmoothFinite[hh, x, {0, 1}]];
16. Plot[p[x], {x, 0, 1}]
17. Plot[p'[x], {x, 0, 1}]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Top