Skip to main content

Python wrapper for HIIR library

Project description

pyhiir

use hiir (https://github.com/unevens/hiir) library in python

HIIR is a DSP (digital signal processing) library in C++ which allows:

  • Changing the sampling rate of a signal by a factor of 2
  • Obtaining two signals with a pi/2 phase difference (Hilbert Transform)

Pyhiir offers wrappers for the hiir methods in python.

Usage Examples

Hilbert Transformer

from pyhiir.hiir import hiir
from pyhiir.allpass import Hilbert
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal

if __name__=='__main__':
    h = hiir()

    # compute filter coeficients for 40db attenuation 
    # and transition band of 10% of the sampling frequency
    c = h.compute_coefs(40, .1)

    # create a hilbert transformer with allpass chains
    h = Hilbert(c)

    fi, fq = h.get_transfer_function()
    wi, hi = signal.freqz(fi.b, fi.a, fs=2)
    wq, hq = signal.freqz(fq.b, fq.a, fs=2)

    # Plot the frequency response
    plt.plot(wi, (np.angle(hi)), color='r')
    plt.plot(wq, (np.angle(hq)), color='g')
    
    # plt.plot(wi, (np.angle(hi) - np.angle(hq)), color='y')

    plt.ylabel('Phase [rad]', color='r')
    plt.xlabel('Frequency')
    plt.tick_params('y', colors='r')
    plt.show()
    
    plt.plot(wi, np.abs(hi), color='r')
    plt.plot(wq, np.abs(hq), color='g')
    plt.xlabel('Frequency')
    plt.ylabel('Magnitude [db]')
    plt.ylim(0.95, 1.05)
    plt.show()

Filter Response Filter Response

Decimator Filter:

from pyhiir.hiir import hiir
from pyhiir.allpass import LowPass
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal

if __name__=='__main__':
    h = hiir()

    # compute filter coeficients for 120db attenuation 
    # and transition band of 1% of the sampling frequency
    c = h.compute_coefs(120, .01)

    # create an half-band low pass filter with allpass chains
    f = LowPass(c)

    # Now get the filter transfer function for plotting
    ff = f.get_transfer_function()
    w, h = signal.freqz(ff.b, ff.a)
    plt.grid(True)
    plt.xlabel("Normalized frequency")
    plt.ylabel("Amplitude [dB]")
    plt.plot(w / np.pi, 20 * np.log10(abs(h)), 'b')
    plt.show()

Filter Response

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyhiir-1.0.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyhiir-1.0.1-cp313-cp313-win_amd64.whl (10.9 kB view details)

Uploaded CPython 3.13Windows x86-64

pyhiir-1.0.1-cp313-cp313-win32.whl (10.9 kB view details)

Uploaded CPython 3.13Windows x86

pyhiir-1.0.1-cp313-cp313-musllinux_1_2_x86_64.whl (9.3 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

pyhiir-1.0.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (9.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

pyhiir-1.0.1-cp312-cp312-win_amd64.whl (10.9 kB view details)

Uploaded CPython 3.12Windows x86-64

pyhiir-1.0.1-cp312-cp312-win32.whl (10.9 kB view details)

Uploaded CPython 3.12Windows x86

pyhiir-1.0.1-cp312-cp312-musllinux_1_2_x86_64.whl (9.3 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

pyhiir-1.0.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (9.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

pyhiir-1.0.1-cp311-cp311-win_amd64.whl (10.9 kB view details)

Uploaded CPython 3.11Windows x86-64

pyhiir-1.0.1-cp311-cp311-win32.whl (10.9 kB view details)

Uploaded CPython 3.11Windows x86

pyhiir-1.0.1-cp311-cp311-musllinux_1_2_x86_64.whl (9.3 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

pyhiir-1.0.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (9.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

pyhiir-1.0.1-cp310-cp310-win_amd64.whl (10.9 kB view details)

Uploaded CPython 3.10Windows x86-64

pyhiir-1.0.1-cp310-cp310-win32.whl (10.9 kB view details)

Uploaded CPython 3.10Windows x86

pyhiir-1.0.1-cp310-cp310-musllinux_1_2_x86_64.whl (9.3 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

pyhiir-1.0.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (9.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

pyhiir-1.0.1-cp39-cp39-win_amd64.whl (10.9 kB view details)

Uploaded CPython 3.9Windows x86-64

pyhiir-1.0.1-cp39-cp39-win32.whl (10.9 kB view details)

Uploaded CPython 3.9Windows x86

pyhiir-1.0.1-cp39-cp39-musllinux_1_2_x86_64.whl (9.3 kB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

pyhiir-1.0.1-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (9.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

File details

Details for the file pyhiir-1.0.1.tar.gz.

File metadata

  • Download URL: pyhiir-1.0.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyhiir-1.0.1.tar.gz
Algorithm Hash digest
SHA256 70d7046cbb9e06f0dcd74d385fb3cbe4adac3544edb2bf567e97385221f16bd2
MD5 063b53a4bf0f84468eafa4341cd73c04
BLAKE2b-256 1a3710a4c58e4eb71e3b3e2d2a0ad01bb714d9b753a80f35644421cfd7390699

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyhiir-1.0.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyhiir-1.0.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 87f2abe9b8c03fc48bef8d69b7846732be1d07ceb9079bd09b55180c89ef84d1
MD5 ccc220526a5eb44d2d94a2b7fda82e7b
BLAKE2b-256 e4ee618cdc948badb825a1ff51b7b8a4afe225ad6c2beaa5f083abc9e9741b6a

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp313-cp313-win32.whl.

File metadata

  • Download URL: pyhiir-1.0.1-cp313-cp313-win32.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyhiir-1.0.1-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 f2882e6ccff0398c508bc015d59930e5b805ca8d23757735fa0e4c4e1e7872eb
MD5 4caf47a3ada060a347866866f019ec88
BLAKE2b-256 7da6488e59f208a19e0e0aa4ebff3258ec0f398e2f97c4ba094776e444b2d665

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhiir-1.0.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 107d4a3019924f4687412671ca92d11b9bff866b26e4eb1720100c5c436b9c95
MD5 791c0290c27ad52e937e6e72f3de6c89
BLAKE2b-256 6fce959c2caa25c38ee2310eaf82777ede0313b7699626c460f158bebcbc9a12

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pyhiir-1.0.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 cf751f11992b65555ecba8a4ec946bff6da6a3d486411f21792e8f1bd52d35c6
MD5 485226df4f0c59bddf1d0c319f57c805
BLAKE2b-256 5369630e2c2f1553aeba1102f5c6c5a0f694dbf686959c0f9d1d27e5657a5eb3

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyhiir-1.0.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyhiir-1.0.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 028671a5d1d49b9b32471d07421c821c2254407011451e9dc2127f7d9df68eee
MD5 9ff70fe028350fcbb81072ace097612d
BLAKE2b-256 6ae22fa0e5b2b4a001c5ee729922175e967f0552f8511df47b7312632086a6fe

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp312-cp312-win32.whl.

File metadata

  • Download URL: pyhiir-1.0.1-cp312-cp312-win32.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyhiir-1.0.1-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 0d5cb0eb1efb596a0541f65047c53be2cf41357d3f170e181fde1d17ab98764a
MD5 8085ec09798795352b0937bdef545487
BLAKE2b-256 14ff30ef997fe11ecfc8bddf135570924f7aae24e51d9559d4fa3dd7bc5b4485

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhiir-1.0.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 85895bf6e19e2c6dc5827f61750edc0c453054f760bbc1b08c2bc5e746b2f8bc
MD5 a6e38a0aa4f97de784c16ee70bf8b2da
BLAKE2b-256 08c2254d6c069fa3601a3919cf15d3050b1ccdcdb2db657bbdefc7652ef5adcd

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pyhiir-1.0.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 117be7e58ed2bafc3e23c74b16dcf0535f30439f8b57cf754a44204ab7ca3700
MD5 56ed8f8898f6d3876ddfd4250621bc82
BLAKE2b-256 0df78de60fd36cc32f9f6fbdf3e48bf58d49344e486ed3ff6f33ea1b7e9d304c

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyhiir-1.0.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyhiir-1.0.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3934f2451d4c7046dccf2fe185ce3f8201132fc50340ddbe6fed39071aa2721b
MD5 ce7ac52a15d89a437c249040dd46a8fa
BLAKE2b-256 8ed208f3353244edf2abfb2daf88efd1d716dc9ca16b1d41b83e2b5d5c4b8998

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp311-cp311-win32.whl.

File metadata

  • Download URL: pyhiir-1.0.1-cp311-cp311-win32.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyhiir-1.0.1-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 d734d33444d6324824a4a51a40dd5e9384876e8697d6c6fbe10999deaa6e1edd
MD5 d53ed450bbeac65c73d68b539d3815a8
BLAKE2b-256 676c2dc4531284380e8f39a91e08af7a5a0110a0bc6a619ac090c29bac4fee4e

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhiir-1.0.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ce3276bd3996b7afb573e7599c86230a66b96c6f813aab16b03d0b3003e663af
MD5 4cf4ee23ac9b18d03be6279c207b600e
BLAKE2b-256 1cc3a38ecb56e3c32c0d561e221a75d20a187afe93a23c117df546573cb5a4b8

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pyhiir-1.0.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 d62a7a4121a0f1cc62e434b4450d4be6693ba5967927f92bb72cd57cc1e352e8
MD5 4773e6b719e25b0f9e0f76df3c43cc29
BLAKE2b-256 fdb6ea71e38bab7947a2d90d61e3068e54d617fc3791f999a4081301c33a0605

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyhiir-1.0.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyhiir-1.0.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3f47d0fce262fe4fa05e55778e4e4205e0bbe046341b60ef3f6daaf4a7b63adb
MD5 14f06556420c641ee0686c6f58aa886b
BLAKE2b-256 4c9056dca1c1fd9f16b38177b86b5a2ae2b7f334051ed5ef6853aa3ade5df89a

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp310-cp310-win32.whl.

File metadata

  • Download URL: pyhiir-1.0.1-cp310-cp310-win32.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyhiir-1.0.1-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 b5fbff4a3a60928b3b6c5de279aa3631f5949bfd1c8dbf8cb4e304aba6010885
MD5 88157eefeeb1490851286d5e8b48f821
BLAKE2b-256 08157d994b5d7df968ccda5c148f5c597d55bc468e5d836300fe646d71655096

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhiir-1.0.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f073d0cd79a1ed9b99f841faed83ebe7c7a4368762575181920607bdd37b954f
MD5 2f4425a00597ebc58eed5414f996ff04
BLAKE2b-256 fa389fb3377eec2ae315af4e95ce4f8a379d331c7f527c1368d27fe68ec2f384

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pyhiir-1.0.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 d1320a8279d9a104bb3b97e09e86683faced0a773bb70f334a026900bc074ea8
MD5 577bc40c855da942d15c817b7808d89d
BLAKE2b-256 96e31228df10053105da737148c75813575c24852dba95fa4a4e12608145f425

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyhiir-1.0.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyhiir-1.0.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a88b2dcd7e2b62e03b14842c9dab8d8d973cf69ef3ed742fd6b73dfbda3ed2e5
MD5 06f8cffbfdedd2fb9ef8bf6b07dcd8e5
BLAKE2b-256 829a26ec4cc2cdc55dc613c8a064f5c0690050a9d82f3389118e9e273c164fc2

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp39-cp39-win32.whl.

File metadata

  • Download URL: pyhiir-1.0.1-cp39-cp39-win32.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyhiir-1.0.1-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 80b17fe867c8c8f8830950348a9a5935c914cd72e55ec1895826f06270fcea3d
MD5 b2c418d51f3b45b03392e7adbaed736e
BLAKE2b-256 b177e1ddd8c9adb77d06a68c10627eb3178b7262920aceebfa4006d69e59d5a2

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhiir-1.0.1-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 68888dc6925d5d3f23e98cf7c10081d9446f0a8089d947eb91eac6dab9e31fc6
MD5 3de848c75a8feb4b560012807e3beee7
BLAKE2b-256 a7abe327abfb705ebca88d141e97307e4f48790a5eab122211f78ea37fe8c5ba

See more details on using hashes here.

File details

Details for the file pyhiir-1.0.1-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pyhiir-1.0.1-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 df7dc69c9b90bf8843de2f8976cd0ea3129b8db92dfef7cc7dd4abb727afaa27
MD5 5c7c8fe8b26831566516db46c2057b7f
BLAKE2b-256 9053f595330c99e894b04793d149420190da8fb2fb27d021ed4b3395529d58d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page