Py1DTDF
This Python package provides a comprehensive set of standard, fractal, nonlinear, and information-theoretic time-domain features for 1-D signals. The features are computed using an adjustable sliding window and overlap mechanism, allowing flexibility in analyzing different segments of a signal.Hence the name 1DTDF : 1-Dimensional Time-Domain Features.
Features
1. Standard Time-Domain Features
These features capture the statistical and structural properties of the signal over time.
- Mean: Measures the central tendency of the signal (Wikipedia).
- Standard Deviation: Measures the variability of the signal (Wikipedia).
- RMS (Root Mean Square): Measures the magnitude of the signal (Wikipedia).
- Skewness: Measures the asymmetry of the signal distribution (Wikipedia).
- Kurtosis: Measures the "tailedness" of the signal distribution (Wikipedia).
- Zero-Crossing Rate: Measures how often the signal crosses zero (Wikipedia).
- Maximum Value: Returns the maximum value in the window (Wikipedia).
- Minimum Value: Returns the minimum value in the window (Wikipedia).
- Peak-to-Peak: Measures the range between maximum and minimum values (Wikipedia).
- Variance: Measures the variability of the signal (Wikipedia).
- IQR (Interquartile Range): Measures the spread of the middle 50% of the data (Wikipedia).
- Number of Peaks: Returns the number of peaks in the window (Wikipedia).
- Signal Line Length: Measures the cumulative sum of absolute differences in the signal (Wikipedia).
- Crest Factor: Ratio of the peak value to the RMS value (Wikipedia).
- Shape Factor: Ratio of the RMS value to the mean absolute value (Wikipedia).
- Impulse Factor: Ratio of the peak value to the mean absolute value (Wikipedia).
- Signal Range: Difference between the maximum and minimum values (Wikipedia).
- Mean Crossing Rate: Measures how often the signal crosses its mean value (Wikipedia).
- Signal Variability: Standard deviation divided by the square root of the signal length (Wikipedia).
- Peak Amplitude: Returns the peak value of the signal (Wikipedia).
- Energy: Sum of squared values in the signal (Wikipedia).
- Median: Returns the median value of the signal (Wikipedia).
- Root Sum of Squares (RSS): Square root of the sum of squared values (Wikipedia).
- DASDV: Measures the variability of differences between consecutive points (IEEE).
- Range Ratio: Ratio of the range (max - min) to the standard deviation (Wikipedia).
2. Fractal Features
These features describe the complexity and self-similarity of the signal.
- Higuchi Fractal Dimension: Measures complexity using Higuchi's algorithm (Scientific Article).
- Hurst Exponent: Measures the long-term memory of the signal (Wikipedia).
- Lyapunov Exponent: Indicates chaos in the signal by measuring sensitivity to initial conditions (Wikipedia).
- Katz Fractal Dimension: Measures signal complexity using Katz's method (IEEE).
- Petrosian Fractal Dimension: Measures complexity by detecting changes in signal direction (IEEE).
- Box-Counting Fractal Dimension: Uses the box-counting method to estimate fractal dimension (Wikipedia).
- Correlation Dimension: Estimates the fractal dimension using the correlation integral (Wikipedia).
3. Complexity and Nonlinear Features
These features capture the irregularity, randomness, or chaotic nature of the signal.
- Approximate Entropy: Measures the complexity and unpredictability of the signal (Wikipedia).
- Sample Entropy: A more robust version of Approximate Entropy (Wikipedia).
- Shannon Entropy: Measures the uncertainty or randomness of the signal (Wikipedia).
- Lempel-Ziv Complexity: Measures the number of distinct patterns in the signal (Wikipedia).
- Permutation Entropy: Evaluates the complexity by analyzing the order of neighboring values (Wikipedia).
- Largest Lyapunov Exponent: Quantifies the divergence of nearby trajectories, indicating chaos (Wikipedia).
- Mobility: Measures the rate of change in the variance of the signal (Wikipedia).
4. Information-Theoretic Features
These features quantify the information content and uncertainty in the signal.
- Entropy: Shannon entropy of the signal (Wikipedia).
- Mutual Information: Measures the shared information between two parts of the signal (Wikipedia).
- Symbolic Dynamics Entropy: Measures randomness in symbolic transitions (Wikipedia).
- Conditional Entropy: The entropy of the signal conditioned on its past values (Wikipedia).
5. Statistical Moments and Distribution-Based Features
These features capture statistical properties of the signal distribution.
- Higher-Order Moments: Measures higher-order statistical moments (up to 6th order) (Wikipedia).
- Percentiles: Returns a specific percentile of the signal (Wikipedia).
- L-Moments: Linear combinations of order statistics to describe the shape of the distribution (Wikipedia).
- Quantile Range: Measures the spread between upper and lower percentiles (Wikipedia).
- Autoregressive Coefficients: Coefficients from an autoregressive model fitted to the signal (Wikipedia).
6. Geometric and Recurrence-Based Features
These features analyze the geometric structure of the signal trajectory and its recurrence.
- Recurrence Quantification: Measures the recurrence patterns of the signal (Wikipedia).
- Attractor Reconstruction: Reconstructs the attractor of the signal in phase space (Wikipedia).
- Mean Crossing Rate: Measures how often the signal crosses its mean value (Wikipedia).
- Max Slope: Measures the steepest slope between consecutive points (Wikipedia).
Installation
To install the package, run:
pip install py1dtdf
Usage
The software is licensed under the MIT License. Please see LICENSE file for more details.
import numpy as np
from py1dtdf import all_features
# Example signal
signal = np.sin(np.linspace(0, 10, 1000)) # Sine wave signal
# Set window size and overlap
window_size = 200
overlap = 100
# Compute all features for the signal
features = all_features(signal, window_size, overlap)
# Print all features
for feature_name, feature_values in features.items():
print(f"{feature_name}: {feature_values}")
Metadata
Release files for py1dtdf 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py1dtdf-1.1.1.tar.gz | 15.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py1dtdf-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.1 kB
Release files / py1dtdf-1.1.1.tar.gz
| Download URL | py1dtdf-1.1.1.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f5dd399788bf1c0a10070d76b28bf36f0b802f3fd73cdac158f3768a77d682f
|
|
BLAKE2b-256 checksum How to use checksums |
5f70c0441c4fe216e461d4ef001cf84a3f8b12d346082ab16d6ade61addbf2e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|
Release files / py1dtdf-1.1.1-py3-none-any.whl
| Download URL | py1dtdf-1.1.1-py3-none-any.whl |
|---|---|
| Size | 17.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec26761ef86f3f97573823e39234aaad9d55fe05f364dc9cea193e37ddb22953
|
|
BLAKE2b-256 checksum How to use checksums |
8047b4fb361e37c4deb586d1688652df3cb7e38cf6485aed56c93ba94584b048
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|