SignalProcessingTools
A comprehensive Python package for time and space domain signal processing operations with a focus on vibration analysis and frequency-domain transformations. The space domain operations focus on railway applications, while the time domain operations are more general.
Overview
SignalProcessingTools provides a suite of tools for analyzing, transforming, and processing data.
Time domain operations:
- Fast Fourier Transforms (FFT) and inverse FFT
- Signal filtering
- Integration
- Power Spectral Density (PSD) using Welch's method
- Spectrogram generation
- Effective velocity calculations using SBR method
- 1/3 octave band analysis
- Windowing functions (Hann, Hamming, Blackman, etc.)
Space domain operations:
- D0, D1, D2, and D3 track longitudinal levels, following EN 13848-1:2006.
- Hmax and Hrms according to Zandberg et al. (2022).
Installation
Install from PyPI
You can install the package directly from PyPI using pip:
pip install SignalProcessingTools
Install from Source
To install the package from the source, clone the repository and run the following commands:
git clone https://github.com/PlatypusBytes/SignalProcessing.git
cd SignalProcessing
pip install -e .
Usage
Basic Example of Time Domain Operations
FFT and signal integration
import numpy as np
from SignalProcessingTools.time_signal import TimeSignalProcessing, Windows
# Create a test signal
t = np.linspace(0, 10, 5001)
y = 1.75 * np.sin(2 * np.pi * 6 * t)
# Initialize the signal processor
sig = TimeSignalProcessing(t, y)
# Perform FFT
sig.fft()
# Integrate the signal
sig.integrate(baseline=True, hp=True, fpass=1, n=6)
Windowed Processing and PSD and spectrogram
# Create a signal processor with Hamming window
sig = TimeSignalProcessing(t, y, window=Windows.HAMMING, window_size=4096)
# Calculate Power Spectral Density
sig.psd()
# Generate a spectrogram
sig.spectrogram()
Signal Filtering
# Apply a low-pass filter to remove high frequency noise
sig.filter(10, 4, type_filter="lowpass")
Effective Velocity Calculation (SBR-B Method)
# Calculate effective velocity using SBR method
sig.v_eff_SBR()
Basic Example of Spatial Domain Operations
D0, D1, D2, and D3 Calculation
import numpy as np
from SignalProcessingTools.space_signal import SpaceSignalProcessing
from SignalProcessingTools.space_signal import EN13848
# Create test data
x = np.linspace(0, 100, 50001)
omega = 2 * np.pi * 6
y = 1.75 * np.sin(omega * x)
y_noise = y + 0.01 * np.sin(120 * x)
sig = SpaceSignalProcessing(x, y_noise)
# Compute track longitudinal levels
sig.compute_track_longitudinal_levels()
Hmax and Hrms Calculation
x_track = np.linspace(0, 500, 25001)
track_irregularity = (
0.002 * np.sin(2 * np.pi * 0.1 * x_track) +
0.001 * np.sin(2 * np.pi * 0.2 * x_track) +
0.0005 * np.sin(2 * np.pi * 0.4 * x_track) +
0.0002 * np.random.randn(len(x_track))
)
sig_hmax = SpaceSignalProcessing(x_track, track_irregularity)
# Compute Hmax parameters
sig_hmax.compute_Hmax(convert_m2mm=True)
Example Files
A comprehensive example demonstrating all features is provided for the time signal and space signal.
License
This project is licensed under the MIT License - see the License file for details.
Metadata
Release files for SignalProcessingTools 1.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| signalprocessingtools-1.2.7.tar.gz | 15.9 kB | Without provenance | Details for signalprocessingtools-1.2.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| signalprocessingtools-1.2.7-py3-none-any.whl | Python 3 | none | any | Details for signalprocessingtools-1.2.7-py3-none-any.whl |
Total release size: 27.7 kB
Release files / signalprocessingtools-1.2.7.tar.gz
| Download URL | signalprocessingtools-1.2.7.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61a97327adbd7e98f1f04d27e290c045af4adf0535c3208a99c26a267677a556
|
|
BLAKE2b-256 checksum How to use checksums |
5429bbe06d66ab606094c4488fe9074d39a521e899859adaa3ca9deb926ed7f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.1
|
Release files / signalprocessingtools-1.2.7-py3-none-any.whl
| Download URL | signalprocessingtools-1.2.7-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
537f385fc15e42c4883aefbc05b6728f8815092758c96d32facf60baba0366b1
|
|
BLAKE2b-256 checksum How to use checksums |
6d69b439729397d5202162e7bbb680292fd4861121ae8818bfdfc0203d19f4bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.1
|
Security for SignalProcessingTools 1.2.7
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.