Skip to main content
pytest Codecov NIST Public Domain

Hilbert - Discrete Hilbert Transform Implementations

Hilbert is a project that will contain numerous implementations of the Hilbert transform for discrete data. This will hopefully enable users to compare different implementation, such as the newly introduced LeDHT (see below).

arXiv manuscript on a learned-matrix approach to the DHT (LeDHT): https://arxiv.org/abs/2204.00666

  • Jupyter notebooks to recreate the main and supplemental text figures (and data) are included in the Examples folder

Currently Implemented

  • Discrete Fourier Transform-based

    • Henrici [1]

    • Marple (SciPy and MATLAB’s hilbert implementation) [2]

    • Haar wavelet-based (similar to Zhou-Yang [3])

  • Learned-matrix approach to the DHT (LeDHT) [4] - Data and code from the arXiv manuscript is available in the Examples folder as a Jupyter Notebook

References

Coming Soon

  • Implementations

    • B-splines implementation (Bilato)

    • Sinc / Whittaker Cardinal

    • and more!

  • Documentation

Dependencies

  • Python 3.* (Tested on 3.8)

  • NumPy (Tested on 1.19)

  • SciPy (Tested on 1.5)

  • Scikit-learn (Tested on 1.0)

Installation

NOTE: The Examples/ folder (and data) are not included in the pip installation. You will need to download the file from the GitHub repo manually.

Using pip

# If this fails, try hilbert_toolkit
pip install hilbert-toolkit

Using pip (soft install, i.e. can update with git)

# Make new directory for hilbert-toolkit and enter it
# Clone from github
git clone https://github.com/usnistgov/hilbert .

pip install -e .

# To update in the future
git pull

Usage

import numpy as np
import matplotlib.pyplot as plt
from hilbert_toolkit import hilbert_fft_marple as dht
from hilbert_toolkit import hilbert_pad_simple

dht_pad = lambda x: hilbert_pad_simple(x, dht, 1)

n = np.arange(-500,501)

sig_analytical = -2 / (n + 1j*50)
plt.plot(n,sig_analytical.real, label='Real Part')
plt.plot(n,sig_analytical.imag, label='Imag Part')
plt.plot(n,dht(sig_analytical.real), label='DHT{Real Part}')
plt.plot(n,dht_pad(sig_analytical.real), label='DHT-Pad{Real Part}')
plt.legend()
plt.xlabel('n')
plt.ylabel('Amplitude (au)')
plt.show()

Citing This Software

C. H. Camp Jr., “Raman Signal Extraction from CARS Spectra Using a Learned-Matrix Representation of the Discrete Hilbert Transform”, arXiv:2204.00666 (2022).

LICENSE

This software was developed by employees of the National Institute of Standards and Technology (NIST), an agency of the Federal Government. Pursuant to title 17 United States Code Section 105, works of NIST employees are not subject to copyright protection in the United States and are considered to be in the public domain. Permission to freely use, copy, modify, and distribute this software and its documentation without fee is hereby granted, provided that this notice and disclaimer of warranty appears in all copies.

THE SOFTWARE IS PROVIDED ‘AS IS’ WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND FREEDOM FROM INFRINGEMENT, AND ANY WARRANTY THAT THE DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY WARRANTY THAT THE SOFTWARE WILL BE ERROR FREE. IN NO EVENT SHALL NIST BE LIABLE FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN ANY WAY CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY, CONTRACT, TORT, OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY PERSONS OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR SERVICES PROVIDED HEREUNDER.

Portions of this package include source code edited from the sklearn’s project template, which requires the following notice(s):

Copyright (c) 2016, Vighnesh Birodkar and scikit-learn-contrib contributors All rights reserved.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Contact

Charles H Camp Jr: charles.camp@nist.gov

Contributors

  • Charles H Camp Jr

Release files for hilbert-toolkit 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hilbert-toolkit 0.1.4
File Size Uploaded
hilbert-toolkit-0.1.4.tar.gz 31.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for hilbert-toolkit 0.1.4
File Interpreter ABI Platform
hilbert_toolkit-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 31.8 MB

Release files / hilbert-toolkit-0.1.4.tar.gz

Download URL hilbert-toolkit-0.1.4.tar.gz
Size 31.8 MB
Tags Source
SHA-256 checksum
How to use checksums
dc50101ec51f5442a3907d05df4517018a1515465b379c55b18d1d601ef0ada2
BLAKE2b-256 checksum
How to use checksums
ae6e68f1cd14e9a7fed407d3260f40dd11c4754598ef0c5c667db111f3676378
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / hilbert_toolkit-0.1.4-py3-none-any.whl

Download URL hilbert_toolkit-0.1.4-py3-none-any.whl
Size 23.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6ba4235621f8d8bca7b01dc6226a4fd2e8ce75893521c6e9e24b72284f479bc
BLAKE2b-256 checksum
How to use checksums
efd656311946d21f235add122636cfcc454e7ceb54dafe4b0dae077298e17ceb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page