1

I'm having some trouble performing an inverse Fourier transform, essentially I have a function which I can Fourier transform with seemingly no issue, but I can't inverse Fourier transform the result. My overall objective is to perform a Hilbert transform.

I have a function, found by solving a differential equation:

Xsol[t_] = 
DSolveValue[
            {
              X''[t] + \[Gamma] X'[t] + \[Omega]0^2 X[t] == F/m Cos[\[Omega]0 t], 
              X[0] == A0 Sin[\[Phi]0] && X'[0] == \[Omega]0 A0 Cos[\[Phi]0]
            },  X[t], t
           ] // Simplify

which seems to be well-behaved. I then attempt to find the Hilbert Transform of Xsol[t], I found several implementations from this question:

HilbertTransformMethod1[f_] := InverseFourierTransform[I * Sign[\[Omega]] * FourierTransform[f, t, \[Omega]], \[Omega], t] 
HilbertTransformMethod2[f_] := InverseFourierTransform[-I * (2 * HeavisideTheta[\[Omega]] - 1) * FourierTransform[f, t, \[Omega]], \[Omega], t]
HilbertTransformMethod3[f_] := 1/Pi * Convolve[f, 1/\[Omega], \[Omega], t, PrincipalValue -> True]

The third method seems to be obsolete (based on information in the comments) due to changes in the way Convolve[...] behaves. The Inverse Fourier transform seems to be where the problem lies, as

InverseFourierTransform[FourierTransform[Xsol[t], t, \[Omega]], \[Omega], t]

returns unevaluated, which seems strange as FourierTransform[Xsol[t], t, \[Omega]] works with no problem.

I've tried different approaches to get the inverse Fourier transform bit working such as using Assuming[] to make sure that all the variables are real and $>0$, using Integrate[] to "directly" inverse Fourier transform, and I have also use FourierTransform[] but with redefined FourierParameters (on the off chance that FourierTransform and InverseFourierTransform behave differently)

user27119
  • 2,500
  • 13
  • 34
  • Use Set rather than SetDelayed for Xsol so that the differential equation is solved once and simplify the results. Xsol[t_] = DSolveValue[{X''[t] + ω0^2 X[t] == F/m Cos[ω0 t], X[0] == A0 Sin[φ0] && X'[0] == A0 ω0 Cos[φ0]}, X[t], t] // Simplify – Bob Hanlon Aug 31 '22 at 14:11
  • @BobHanlon My mistake, I have ommitted a term from my ODE. Let me correct the question. – user27119 Aug 31 '22 at 14:27
  • I have corrected the question and the code to solve the differential equation, for some reason I didn't type my damping term... – user27119 Aug 31 '22 at 14:32

1 Answers1

3
$Version

(* "13.1.0 for Mac OS X x86 (64-bit) (June 16, 2022)" *)

Clear["Global`*"]

HilbertTransformMethod1[f_] := 
 InverseFourierTransform[
  I*Sign[ω]*FourierTransform[f, t, ω], ω, t]

HilbertTransformMethod2[f_] := 
 InverseFourierTransform[-I*(2*HeavisideTheta[ω] - 1)*
   FourierTransform[f, t, ω], ω, t]

Put assumptions into $Assumptions so that they are available to any function that takes the option Assumptions

$Assumptions = Thread[{A0, F, m, γ, ϕ0, ω0} > 0];

Your function simplifies further with FullSimplify; however, it works with either.

Xsol[t_] = 
 DSolveValue[{X''[t] + γ X'[t] + ω0^2 X[t] == 
     F/m Cos[ω0 t], X[0] == A0 Sin[ϕ0], 
    X'[0] == ω0 A0 Cos[ϕ0]}, X[t], t] // FullSimplify

(* (F Sin[t ω0])/(m γ ω0) + E^(-((t γ)/ 2)) (A0 Cosh[ 1/2 t Sqrt[γ^2 - 4 ω0^2]] Sin[ϕ0] + ((-2 F + A0 m γ (2 ω0 Cos[ϕ0] + γ Sin[ϕ0])) Sinh[ 1/2 t Sqrt[γ^2 - 4 ω0^2]])/( m γ Sqrt[γ^2 - 4 ω0^2])) *)

The transform of a sum is the sum of the transforms. For complicated expressions, Expand the expression to operate on the simpler individual components.

HilbertTransformMethod1 /@ Expand[Xsol[t]]

(* -((E^(-I t ω0) (1 + E^(2 I t ω0)) F)/(2 m γ ω0)) *)

HilbertTransformMethod2 /@ Expand[Xsol[t]]

(* (E^(-I t ω0) (1 + E^(2 I t ω0)) F)/(2 m γ ω0) *)

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198
  • 1
    That is a really helpful tip! You're a Mathematica wizard! – user27119 Aug 31 '22 at 15:51
  • 2
    Of course, there are some interesting expressions whose Fourier transform exists, but which expand into terms whose Fourier transforms diverge. – mikado Aug 31 '22 at 19:46
  • @mikado Do you know of any specific examples I could look up? – user27119 Sep 02 '22 at 20:02
  • 1
    It is easy to create artificial examples e.g. Cosh[t]-Abs[Sinh[t]]. (I've not checked whether Mathematica can do this without simplifying first. Neither of the terms have convergent Fourier transforms, though their difference does). – mikado Sep 03 '22 at 11:32