A comprehensive package for extracting standard, fractal, and complexity-based time-domain features from 1-D signals.
Project description
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}")
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py1dtdf-1.1.0.tar.gz.
File metadata
- Download URL: py1dtdf-1.1.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
194e9c4a48fdccd8b23b8231b9a266ec0b3ed62d3c127028b5999d167c143069
|
|
| MD5 |
46783b517f1bff6c9a1589a70e2b9c1d
|
|
| BLAKE2b-256 |
9b2b138a12d79ce03563e36b966b8f5c77084ef7869d42a75f1d504f13a1e855
|
File details
Details for the file py1dtdf-1.1.0-py3-none-any.whl.
File metadata
- Download URL: py1dtdf-1.1.0-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a228eac84003390d3c66bba78e5be9d641ee33ea95713080853956ef8bfe8eb3
|
|
| MD5 |
a2b95b254945f163118cc80d6d014660
|
|
| BLAKE2b-256 |
96784d2555f8b292ea09f2e3c11ef839db462a5c0076c78bc1eee0ad60dc49b9
|