{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Advanced Features Analysis\n", "\n", "This notebook demonstrates the advanced nonlinear dynamics and information-theoretic methods available in vitalDSP:\n", "\n", "1. **Multi-Scale Entropy (MSE)** - Signal complexity across temporal scales\n", "2. **Symbolic Dynamics** - Pattern analysis and symbolic representation\n", "3. **Transfer Entropy** - Directional coupling between signals\n", "\n", "We'll use synthetic physiological signals to demonstrate each method's capabilities." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setup and Imports" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Warning: Some vitalDSP modules could not be imported: cannot import name 'SignalFiltering' from partially initialized module 'vitalDSP.filtering.signal_filtering' (most likely due to a circular import) (d:\\workspace\\vital-dsp\\src\\vitalDSP\\filtering\\signal_filtering.py)\n", "β All modules imported successfully\n" ] } ], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from plotly import graph_objects as go\n", "import plotly.io as pio\n", "\n", "# Configure plotly renderer\n", "# pio.renderers.default = \"sphinx_gallery\"\n", "\n", "# Import vitalDSP modules\n", "from vitalDSP.utils.data_processing.synthesize_data import generate_ecg_signal, generate_synthetic_ppg, generate_resp_signal\n", "from vitalDSP.utils.signal_processing.peak_detection import PeakDetection\n", "\n", "# Import advanced features\n", "from vitalDSP.physiological_features.advanced_entropy import MultiScaleEntropy\n", "from vitalDSP.physiological_features.symbolic_dynamics import SymbolicDynamics\n", "from vitalDSP.physiological_features.transfer_entropy import TransferEntropy\n", "\n", "print(\"β All modules imported successfully\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Generate Synthetic Signals\n", "\n", "We'll generate three types of physiological signals:\n", "- ECG signal for heart rate variability analysis\n", "- PPG signal for additional cardiovascular features\n", "- Respiratory signal for coupling analysis" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "