Skip to main content

CI CI

ezDSP: Easy Digital Signal Processing

ezDSP is a digital signal processing toolbox written in PyTorch (./src/ezdsp/nn/). However, ezDSP not only processes torch.tensors (CPU & GPU) but also handles numpy.ndarray and pd.DataFrame, enabling a consistent and intensive workflow.

Installation

$ pip install ezdsp
$ python ./example.py # ./example_outputs/ will be generated.

Samples

Normalization, Resampling, Noise Addition, Filtering, Hilbert Transformation

Wavelet Transformation

Power Spectrum Density

Phase-Amplitude Coupling

fixme

Quick Start

import ezdsp as ed

# Parameters
SRC_FS = 1024  # Source sampling frequency
TGT_FS = 512   # Target sampling frequency
FREQS_HZ = [10, 30, 100]  # Frequencies in Hz
LOW_HZ = 20    # Low frequency for bandpass filter
HIGH_HZ = 50   # High frequency for bandpass filter
SIGMA = 10     # Sigma for Gaussian filter
SIG_TYPES = [
    "uniform",
    "gauss",
    "periodic",
    "chirp",
    "ripple",
    "meg",
    "tensorpac",
] # Available signal types


# Demo Signal
xx, tt, fs = ed.demo_sig(
    t_sec=T_SEC, fs=SRC_FS, freqs_hz=FREQS_HZ, sig_type="chirp"
)
# xx is either of torch.tensor (on cpu / cuda), numpy.ndarray, or pd.DataFrame.

# Normalization
xx_norm = ed.norm.z(xx)
xx_minmax = ed.norm.minmax(xx)

# Resampling
xx_resampled = ed.resample(xx, fs, TGT_FS)

# Noise addition
xx_gauss = ed.add_noise.gauss(xx)
xx_white = ed.add_noise.white(xx)
xx_pink = ed.add_noise.pink(xx)
xx_brown = ed.add_noise.brown(xx)

# Filtering
xx_filted_bandpass = ed.filt.bandpass(xx, fs, low_hz=LOW_HZ, high_hz=HIGH_HZ)
xx_filted_bandstop = ed.filt.bandstop(xx, fs, low_hz=LOW_HZ, high_hz=HIGH_HZ)
xx_filted_gauss = ed.filt.gauss(xx, sigma=SIGMA)

# Hilbert Transformation
phase, amplitude = ed.hilbert(xx) # or envelope

# Wavelet Transformation
wavelet_coef, wavelet_freqs = ed.wavelet(xx, fs)

# Power Spetrum Density
psd, psd_freqs = ed.psd(xx, fs)

# Phase-Amplitude Coupling
pac, freqs_pha, freqs_amp = ed.pac(x_3d, fs) # This function is computationally demanding. Please monitor the RAM/VRAM usage.

Alias

mngs.dsp has the same functionalities.

Contact

Yusuke Watanabe (ywata1989@gmail.com).

Metadata

Release files for ezdsp 1.3.2

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

Source distribution (sdist)

Source distribution for ezdsp 1.3.2
File Size Uploaded Provenance
ezdsp-1.3.2.tar.gz 24.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ezdsp 1.3.2
File Interpreter ABI Platform
ezdsp-1.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 56.4 kB

Release files / ezdsp-1.3.2.tar.gz

Download URL ezdsp-1.3.2.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6ba6d8a95b5a02f8379fffb664f3f7521fee5f29b491bf45871b6172c32dcef5
BLAKE2b-256 checksum
How to use checksums
6fed840efc763cf64f105ccfc39d781580a660df80f9306995a9fa8f0d12b661
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Release files / ezdsp-1.3.2-py3-none-any.whl

Download URL ezdsp-1.3.2-py3-none-any.whl
Size 32.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfc83ba9e8593321a975b90035ab2e78551b9443a3a08d3bf11b1e064fd51b72
BLAKE2b-256 checksum
How to use checksums
6ffef397733a34e2834b91bbf4c915d3c6f1161bb11332139952d82cab32d9e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Security for ezdsp 1.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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