1
$\begingroup$

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)

$\endgroup$
3
  • $\begingroup$ 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 $\endgroup$
    – Bob Hanlon
    Aug 31, 2022 at 14:11
  • $\begingroup$ @BobHanlon My mistake, I have ommitted a term from my ODE. Let me correct the question. $\endgroup$
    – user27119
    Aug 31, 2022 at 14:27
  • $\begingroup$ I have corrected the question and the code to solve the differential equation, for some reason I didn't type my damping term... $\endgroup$
    – user27119
    Aug 31, 2022 at 14:32

1 Answer 1

3
$\begingroup$
$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) *)
$\endgroup$
4
  • 1
    $\begingroup$ That is a really helpful tip! You're a Mathematica wizard! $\endgroup$
    – user27119
    Aug 31, 2022 at 15:51
  • 2
    $\begingroup$ Of course, there are some interesting expressions whose Fourier transform exists, but which expand into terms whose Fourier transforms diverge. $\endgroup$
    – mikado
    Aug 31, 2022 at 19:46
  • $\begingroup$ @mikado Do you know of any specific examples I could look up? $\endgroup$
    – user27119
    Sep 2, 2022 at 20:02
  • 1
    $\begingroup$ 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). $\endgroup$
    – mikado
    Sep 3, 2022 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.