{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Sample 01\n\nThis examples computes the three most basic standard SQIs\n(kurtosis, skewness and entropy). In addition, it shows\nthe code in a one big section. It is just an example.\n\n<div class=\"alert alert-danger\"><h4>Warning</h4><p>The ``dtw`` module seems to be loaded even though\n             we are not really using it. Instead, load it\n             only when required.</p></div>\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "# Libraries generic\nimport numpy as np\nimport pandas as pd\n\n# Libraries specific\nfrom vital_sqi.sqi.standard_sqi import perfusion_sqi\nfrom vital_sqi.sqi.standard_sqi import kurtosis_sqi\nfrom vital_sqi.sqi.standard_sqi import skewness_sqi\nfrom vital_sqi.sqi.standard_sqi import entropy_sqi\nfrom vital_sqi.sqi.standard_sqi import signal_to_noise_sqi\n\n# ---------------------------\n# Main\n# ---------------------------\n# Create samples\nx = np.linspace(-10*np.pi, 10*np.pi, 201)\n\n# Create signal\nsignal = np.sin(x)\n\n# Loop computing sqis\nk = kurtosis_sqi(signal)\ns = skewness_sqi(signal)\ne = entropy_sqi(signal)\n\n# Create Series\nresult = pd.Series(\n    data=[k, s, e],\n    index=['kurtosis', 'skewness', 'entropy']\n)\n\n# Show\nprint(\"\\nResult:\")\nprint(result)\n\n# ---------------\n# Create plot\n# ---------------\n# Library\nimport matplotlib.pyplot as plt\n\n# Plot\nplt.plot(x, signal)\n\n# Show\nplt.show()"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.7.9"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}