Function Repository Resource:

# HartleyMatrix

Generate a Hartley matrix

Contributed by: Jan Mangaldan
 ResourceFunction["HartleyMatrix"][n] returns an n×n Hartley matrix.

## Details and Options

Each entry Hrs of the Hartley matrix is defined as .
Rows or columns of the Hartley matrix are basis sequences of the discrete Hartley transform.
The Hartley matrix is symmetric and orthogonal, which means the Hartley matrix is involutory (i.e., its own inverse).
ResourceFunction["HartleyMatrix"][,WorkingPrecisionp] gives a matrix with entries of precision p.

## Examples

### Basic Examples (2)

A 4×4 Hartley matrix:

 In[1]:=
 Out[1]=

Visualize the basis sequences of the Hartley transform:

 In[2]:=
 Out[3]=

### Options (3)

#### WorkingPrecision (3)

By default, an exact matrix is computed:

 In[4]:=
 Out[4]=

Use machine precision:

 In[5]:=
 Out[5]=

Use arbitrary precision:

 In[6]:=
 Out[6]=

### Properties and Relations (2)

The Hartley matrix is symmetric and orthogonal:

 In[7]:=
 Out[7]=
 In[8]:=
 Out[8]=

The Hartley matrix is thus its own inverse:

 In[9]:=
 Out[9]=

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

 In[10]:=
 In[11]:=
 Out[11]=

It is faster to use the resource function DiscreteHartleyTransform:

 In[12]:=
 Out[12]=
 In[13]:=
 Out[13]=

## Version History

• 1.0.0 – 13 February 2023