jaysulk / DHT

A naive Python implementation of the Discrete Hartley Transform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discrete Hartley Transform in Python

A naive implementation of the Discrete Hartley Transform(DHT) and Inverse Discrete Hartley Transform (IDHT) in Python. The code has not been optimized for speed. All computations are based on formulas listed here.

  • To compute the DHT we use the well-known relationship between FFT and DHT.
  • To compute the IDHT we use the fact that the DHT is involutory, i.e., its own inverse up to a scale factor equal to 1/N where N is the sequence length
  • To compute the cyclic convolution of two sequences based on the DHT, we first compute the DHT of the convolution of two sequences using the convolution theorem for the DHT, and then we compute the IDHT of the resulting sequence

Requirements

Run

pip install -r requirements.txt

Currently, the only requirement is numpy.

Tests

To execute tests, in the same directory where dht.py is, run

python test_dht.py

Limitations

Currently, only the 1D DHT is computed.

About

A naive Python implementation of the Discrete Hartley Transform

License:MIT License


Languages

Language:Python 100.0%