1
$\begingroup$

I'm trying to compute the Fourier Transform of a diverging and oscillating function::

Needs["FourierSeries`"] f[x_] = Exp[-CosIntegral[10*x]] Abs[x]^3; NFourierCosTransform[f[x], x, 1] 

But unfortunately the function times a cosinus oscillates very strongly and I cannot make the algorithm converges. I tried a lot of method: Levin's rule, LocalAdaptive, ... But nothing seems to work. Even an asymptotic result holding close to 0 would be appreciable!

Here is a plot of f(x)cos(x)

enter image description here

note that f(x) itself contains also some oscillations independently on cos(x), not visible clearly on this graph.

I'm expecting the Fourier transform result to be proportional to 1/k^4 close to 0 since f is very well approximated by |x|^3 at large x.

$\endgroup$
5
  • $\begingroup$ What numeric method do you expect to compute a distribution if it is recast as a divergent integral? $\endgroup$ Commented Jun 2, 2024 at 17:01
  • $\begingroup$ @DanielLichtblau Truth is: I really don't know how the integral are computed under the hood but just come across the fact that mathematica can correctly numerically compute the fourier transform of |x|^3 which is similar to the one I'm trying to get. It's a simple observation and nothing more, that the numerical methods Mathematica uses can sometimes compute (correctly) fourier transform understood as distribution. Which by itself is also interesting.. $\endgroup$ Commented Jun 2, 2024 at 17:08
  • $\begingroup$ I’m surprised |x|^3 can be handled numerically (even though it can be done symbolically). $\endgroup$ Commented Jun 2, 2024 at 17:11
  • $\begingroup$ @DanielLichtblau FourierTransform[Abs[x]^3, x, 0.1] NFourierTransform[Abs[x]^3, x, 0.1] both give the same results indeed. And I agree with you, the original articles from which the methods Mathematica uses are derived, clearly state that their techniques hold only when the integral is decreasing in amplitude with x... $\endgroup$ Commented Jun 2, 2024 at 17:13
  • $\begingroup$ Some experiments indicate that NIntegrate is producing results consistent with the FCT for Abs[t^3]. Whether this is an accident of the numeric method or something else I cannot say. $\endgroup$ Commented Jun 3, 2024 at 17:27

2 Answers 2

1
$\begingroup$

According to Weisstein, Eric W. "Fourier Cosine Transform." From MathWorld, "The Fourier cosine transform of a real function is the real part of the full complex Fourier transform". Again according to Weisstein, Eric W. "Fourier Transform." From MathWorld, its existence required "$\int_{-\infty}^\infty|f(x)]\,dx$ exists". In view of

f[x_] = Exp[-CosIntegral[10*x]] *Abs[x]^3; Series[f[x], {x, Infinity, 1}, Assumptions -> x > 0] // Normal 

E^(-(Sin[10 x]/(10 x))) x^3,

that condition does not hold. Therefore, the Fourier cosine transform of f[x] does not exist in traditional sense. Maybe, the one can be defined in the sense of generalized functions (distributions), but usual numerical methods do not work in this case.

$\endgroup$
7
  • $\begingroup$ The function is very close to |x|^a which has a well defined fourier transform in the space of distribution. The fourier transform of this function is well approximated by mathematica. This is why I expect f to be also well defined and computable. $\endgroup$ Commented Jun 2, 2024 at 14:21
  • 1
    $\begingroup$ @Syrocco: Did you read the end of my answer "Maybe, the one can be defined in the sense of generalized functions (distributions), but usual numerical methods do not work in this case" before having commented it? $\endgroup$ Commented Jun 2, 2024 at 14:26
  • $\begingroup$ @Syrocco: Also Series[f[x], {x, -Infinity, 1}, Assumptions -> x < 0] // Normal results in -E^(-(1/2) I (2 \[Pi] - 2 I Log[10] - 2 I Log[-x] + I Log[100 x^2]) - Sin[10 x]/(10 x)) x^3. In view of it your words "The function is very close to |x|^a" do not correspond to reality. $\endgroup$ Commented Jun 2, 2024 at 14:29
  • $\begingroup$ Yes and you did not read the part where I said that the fourier transform of |x|^a, a result well defined in the sense of distribution is well computed from the algorithm you say cannot do this kind of thing. $\endgroup$ Commented Jun 2, 2024 at 14:38
  • $\begingroup$ The function oscillates around x^3 as x increases. $\endgroup$ Commented Jun 2, 2024 at 14:39
1
$\begingroup$

Very much likely FALSE (see comments)

It looks like Method -> "ExtrapolatingOscillatory" works well:

Needs["FourierSeries`"] f[x_] = Exp[-CosIntegral[10*x]] Abs[x]^3; g[x_] = Abs[x]^3; G[k_] = FourierTransform[g[x], x, k]; LogLogPlot[{NFourierCosTransform[f[x], x, k, Method -> "ExtrapolatingOscillatory"], G[k]}, {k, 0, 5}, PlotPoints -> 10, MaxRecursion -> 0, PlotLabels -> {"FT[f(x)]", "FT[|x|^3]" }] 

enter image description here

Altough it takes quite a lot of times (I thought it was stuck the first time I tried!) and it does not really converges around k = 10 (probably due to a dirac delta because of the oscillation at frequency 10). At large k, it seems to also exhibit some strong numerical errors:

enter image description here

$\endgroup$
10
  • $\begingroup$ Please, present the whole code that generates this plot. $\endgroup$ Commented Jun 2, 2024 at 15:27
  • $\begingroup$ @user64494 ah yes, my bad! Done. $\endgroup$ Commented Jun 2, 2024 at 15:31
  • $\begingroup$ At the moment, all that is built on the sand. Where is the FourierSeries package documented and described? Also, the usual FourierCosTransform[f[x], x, k] does not exist as grounded in my answer. If that transform exists in the sense distributions, then usual numeric methods (in particular Method -> "ExtrapolatingOscillatory") do not work (see Wiki for info). Also the difference in one in LogLogPlot means the huge difference in Plot. $\endgroup$ Commented Jun 2, 2024 at 15:57
  • $\begingroup$ Also it should be noticed that the results of FourierTransform[g[x], x, k] and FourierCosTransform[g[x], x, k] are identical because of the parity of the function. $\endgroup$ Commented Jun 2, 2024 at 16:06
  • $\begingroup$ @user64494 I agree with you that it cannot be trusted blindly. Let's say that the result of the (probably senseless) computation seems coherent from what I expected. $\endgroup$ Commented Jun 2, 2024 at 16:17

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.