Numerical implementation of Hilbert transform

7 views (last 30 days)
Mat Hunt
Mat Hunt on 30 Jul 2016
Commented: Mat Hunt on 2 Aug 2016
I have been trying to implement the Hilbert transform numerically but I have been having some trouble. The way I decided to do it is the use of Fourier transforms. The fourier transform of the Hilbert transform of f(x) is -i*sgn(k)*F(k), where F(k) is the Fourier transform of f(x).
I have written my own Fourier and inverse Fourier routines but I don't get nice results. Can anyone suggest anything? The picture (pdf) I have included shows my computational result and the value which it should be.
  11 Comments
Walter Roberson
Walter Roberson on 1 Aug 2016
Mat, you are free to call anything you want a "Fourier transform", and to refuse to acknowledge anything other people call a "Fourier transform" as being what you would call a Fourier transform. But if you do so, then we have no common ground and you are going to need to solve the problem yourself.
The transform invented by Jean-Baptiste Joseph Fourier does not require a "k". There are alternative formulations that involve "k" and those formulations make it easier to approach various computations, but they are not the only possibilities.
fft() and ifft() do not implement the Fourier Transform: they implement the Fast Fourier Transform, and the Inverse Fast Fourier Transform, which are implementations of Discrete Fourier Transforms. The Symbolic Toolbox implements the (continuous) Fourier Transform http://www.mathworks.com/help/symbolic/fourier.html, and does so without explicit reference to the variables you indicate as being required. When I look at your code, I am pretty much certain that you are not interested in the continuous Fourier Transform and are instead interested in a Discrete Fourier Transform. However, I have only been reading code for 40 years so I could be mistaken.
Mat Hunt
Mat Hunt on 2 Aug 2016
I would like to implement the Fourier transform as defined as follows:
F(f)(k)=\int_{-\infty}^{\infty}f(x)exp(-ikx)dx
I only have a limited number of points to work with, so I have to do an approximation to the above transform. This will work relatively well if f(x) tends towards zero reasonably rapidly. This is the case I have, So I chose a few points and computed the Fourier transform and the results are actually quite good. The only snag is that you have to know what the limits of your function are.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!