Function Repository Resource:

DiscreteHilbertTransformMatrix

Source Notebook

Generate a matrix that arises in the computation of the discrete Hilbert transform

Contributed by: Jan Mangaldan

ResourceFunction["DiscreteHilbertTransformMatrix"][n]

returns an n×n Hilbert transform matrix.

Details and Options

The Hilbert transform matrix is the matrix such that, when multiplied with a vector of commensurate size, gives the discrete Hilbert transform of that vector.
The Hilbert transform matrix is an antisymmetric Toeplitz matrix.
For even n, the Hilbert transform matrix is also sparse.
ResourceFunction["DiscreteHilbertTransformMatrix"][,WorkingPrecisionp] gives a matrix with entries of precision p.

Examples

Basic Examples (2) 

A 4×4 Hilbert transform matrix:

In[1]:=
ResourceFunction["DiscreteHilbertTransformMatrix"][4] // MatrixForm
Out[1]=

Visualize a Hilbert transform matrix of odd dimension:

In[2]:=
MatrixPlot[ResourceFunction["DiscreteHilbertTransformMatrix"][127]]
Out[2]=

Options (3) 

WorkingPrecision (3) 

By default, an exact matrix is computed:

In[3]:=
ResourceFunction["DiscreteHilbertTransformMatrix"][3] // Simplify // MatrixForm
Out[3]=

Use machine precision:

In[4]:=
ResourceFunction["DiscreteHilbertTransformMatrix"][3, WorkingPrecision -> MachinePrecision] // MatrixForm
Out[4]=

Use arbitrary precision:

In[5]:=
ResourceFunction["DiscreteHilbertTransformMatrix"][3, WorkingPrecision -> 20] // MatrixForm
Out[5]=

Properties and Relations (2) 

The Hilbert transform matrix is antisymmetric:

In[6]:=
ResourceFunction["DiscreteHilbertTransformMatrix"][6]
Out[6]=
In[7]:=
AntisymmetricMatrixQ[%]
Out[7]=

Compute the discrete Hilbert transform of a vector by multiplying it with the Hilbert transform matrix:

In[8]:=
u = N[{1, 2, 3, 4, 5, 6, 7}];
n = Length[u];
In[9]:=
AbsoluteTiming[
 v1 = ResourceFunction["DiscreteHilbertTransformMatrix"][n] . u]
Out[9]=

Using the resource function DiscreteHilbertTransform is faster:

In[10]:=
AbsoluteTiming[v2 = ResourceFunction["DiscreteHilbertTransform"][u]]
Out[10]=
In[11]:=
Chop[v1 - v2]
Out[11]=

Version History

  • 1.0.0 – 13 March 2023

Source Metadata

Related Resources

License Information