{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Port ECGSYNTH to python" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "From these two scripts: \n", "\n", "- https://physionet.org/content/ecgsyn/1.0.0/Matlab/ecgsyn.m \n", "- https://physionet.org/content/ecgsyn/1.0.0/Matlab/derivsecgsyn.m" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import neurokit2 as nk\n", "import scipy\n", "import math\n", "\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "def _ecg_simulate_ecgsynth(sfecg=256, N=256, Anoise=0, hrmean=60, hrstd=1, lfhfratio=0.5, sfint=256, ti=[-70, -15, 0, 15, 100], ai=[1.2, -5, 30, -7.5, 0.75], bi=[0.25, 0.1, 0.1, 0.1, 0.4]):\n", " \"\"\"\n", " Credits\n", " -------\n", " This function is a python translation of the matlab script by Patrick McSharry & Gari Clifford (2013). All credits go to them.\n", " \"\"\"\n", "# Set parameter default values\n", "# sfecg = 256;\n", "# N = 256;\n", "# Anoise = 0;\n", "# hrmean = 60;\n", "# hrstd = 1;\n", "# lfhfratio = 0.5;\n", "# sfint = 512;\n", "# ti = [-70, -15, 0, 15, 100];\n", "# ai=[1.2 -5 30 -7.5 0.75];\n", "# bi=[0.25 0.1 0.1 0.1 0.4];\n", "\n", "\n", " ti = np.array(ti)*np.pi/180\n", "\n", " # Adjust extrema parameters for mean heart rate\n", " hrfact = np.sqrt(hrmean/60)\n", " hrfact2 = np.sqrt(hrfact)\n", " bi = hrfact*np.array(bi)\n", " ti = np.array([hrfact2, hrfact, 1, hrfact, hrfact2])*ti\n", "\n", " # Check that sfint is an integer multiple of sfecg\n", " q = np.round(sfint/sfecg)\n", " qd = sfint/sfecg\n", " if q != qd:\n", " raise ValueError('Internal sampling frequency (sfint) must be an integer multiple of the ECG sampling frequency (sfecg). Your current choices are: sfecg = ' + str(sfecg) + ' and sfint = ' + str(sfint) + '.')\n", "\n", " # Define frequency parameters for rr process\n", " # flo and fhi correspond to the Mayer waves and respiratory rate respectively\n", " flo = 0.1\n", " fhi = 0.25\n", " flostd = 0.01\n", " fhistd = 0.01\n", " fid = 1\n", "\n", "\n", " # Calculate time scales for rr and total output\n", " sfrr = 1\n", " trr = 1/sfrr\n", " tstep = 1/sfecg\n", " rrmean = 60/hrmean\n", " n = (np.ceil(np.log2(N*rrmean/trr)))**2\n", "\n", " rr0 = _ecg_simulate_rrprocess(flo,fhi,flostd,fhistd,lfhfratio,hrmean,hrstd,sfrr,n)\n", "\n", " # Upsample rr time series from 1 Hz to sfint Hz\n", " rr = nk.signal_resample(rr0, sampling_rate=1, desired_sampling_rate=sfint)\n", "\n", " # Make the rrn time series\n", " dt = 1/sfint\n", " rrn = np.zeros(len(rr))\n", " tecg=0\n", " i = 0\n", " while i < len(rr):\n", " tecg = tecg+rr[i]\n", " ip = int(np.round(tecg/dt))\n", " rrn[i:ip] = rr[i]\n", " i = ip+1\n", " Nt = ip\n", "\n", " # Integrate system using fourth order Runge-Kutta\n", " x0 = [1, 0, 0.04]\n", "\n", " # ------- THIS IS WHERE THINGS START TO GET COMPLICATED\n", "# Tspan = np.arange(0, (Nt-1)*dt, dt)\n", " Tspan = np.linspace(0, (Nt-1)*dt, len(rrn))\n", "# T, X0 = _ecg_simulate_derivsecgsyn(t=Tspan, rr=rrn, ti=ti, x=x0, flag=[], sfint, ti, ai, bi)\n", " dxdt = _ecg_simulate_derivsecgsyn(Tspan=Tspan, rrn=rrn, ti=ti, x0=x0, sfint=sfint, ai=ai, bi=bi)\n", "\n", " # downsample to required sfecg\n", " X = dxdt[np.arange(0,len(dxdt),q).astype(int)]\n", "\n", " # Scale signal to lie between -0.4 and 1.2 mV\n", " z = X.copy()\n", " zmin = np.min(z)\n", " zmax = np.max(z)\n", " zrange = zmax - zmin\n", " z = (z - zmin)*(1.6)/zrange -0.4\n", "\n", " # include additive uniformly distributed measurement noise\n", " eta = 2*np.random.uniform(len(z))-1\n", " s = z + Anoise*eta\n", "\n", " return(s)\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "def _ecg_simulate_derivsecgsyn(Tspan, rrn, ti, x0=[1, 0, 0.04], sfint=512, ai=[1.2, -5, 30, -7.5, 0.75], bi=[0.25, 0.1 , 0.1 , 0.1 , 0.4 ]):\n", "\n", " xi = np.cos(ti)\n", " yi = np.sin(ti)\n", " ta = math.atan2(x0[1], x0[0])\n", " r0 = 1\n", " a0 = 1.0 - np.sqrt(x0[0]**2 + x0[1]**2)/r0\n", " ip = np.floor(Tspan*sfint).astype(int)\n", " # w0 = 2*np.pi/rrn[ip.astype(int)] # This fails, also in the matlab script it seems...\n", " w0 = 2*np.pi/rrn[ip[ip <= np.max(rrn)]]\n", "\n", "\n", " fresp = 0.25\n", " zbase = 0.005*np.sin(2*np.pi*fresp*Tspan)\n", "\n", " dx1dt = a0*x0[0] - w0*x0[1]\n", " dx2dt = a0*x0[1] + w0*x0[0]\n", "\n", " dti = np.remainder(ta - ti, 2*np.pi)\n", " dx3dt = -np.sum(ai * dti * np.exp(-0.5*(dti/bi)**2)) - 1*(x0[2] - zbase)\n", "\n", " dxdt = np.concatenate([dx1dt, dx2dt, dx3dt])\n", " return(dxdt)\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "def _ecg_simulate_rrprocess(flo=0.1, fhi=0.25, flostd=0.01, fhistd=0.01, lfhfratio=0.5, hrmean=60, hrstd=1, sfrr=1, n=64):\n", "\n", "\n", " w1 = 2*np.pi*flo\n", " w2 = 2*np.pi*fhi\n", " c1 = 2*np.pi*flostd\n", " c2 = 2*np.pi*fhistd\n", " sig2 = 1\n", " sig1 = lfhfratio\n", " rrmean = 60/hrmean\n", " rrstd = 60*hrstd/(hrmean*hrmean)\n", "\n", " df = sfrr/n\n", " w = np.arange(n-1)*2*np.pi*df\n", " dw1 = w-w1\n", " dw2 = w-w2\n", "\n", " Hw1 = sig1*np.exp(-0.5*(dw1/c1)**2)/np.sqrt(2*np.pi*c1**2)\n", " Hw2 = sig2*np.exp(-0.5*(dw2/c2)**2)/np.sqrt(2*np.pi*c2**2)\n", " Hw = Hw1 + Hw2\n", " Hw0 = np.concatenate((Hw[0:int(n/2)], Hw[int(n/2)-1::-1]))\n", " Sw = (sfrr/2)*np.sqrt(Hw0)\n", "\n", " ph0 = 2*np.pi*np.random.uniform(size=int(n/2-1))\n", " ph = np.concatenate([[0], ph0, [0], -np.flipud(ph0)])\n", " SwC = Sw * np.exp(1j*ph)\n", " x = (1/n)*np.real(np.fft.ifft(SwC))\n", "\n", " xstd = np.std(x)\n", " ratio = rrstd/xstd\n", " rr = rrmean + x*ratio\n", " return(rr)\n" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD4CAYAAADsKpHdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAVhklEQVR4nO3df4zkd33f8edrZ/bOIeCcjWM439mciUyc+wMC2bimNMVgaGwH4UbKH3YIuJTqZBUi0rSNz7JEVKFKkLYRQhicE3EhheIk4MLVgrrghKCKAr4jYGzsw1cD9mEHh59BIN/t7L77x3z2bna9e7d3873ZcfJ8SKud7/f7mc/nPTP7/b6+3+/M7DdVhSRJMxtdgCRpOhgIkiTAQJAkNQaCJAkwECRJTX+jCziec845p3bs2LHRZUjSU8b+/fu/U1U/eyr3nepA2LFjB/v27dvoMiTpKSPJN0/1vp4ykiQBBoIkqTEQJEmAgSBJagwESRLQUSAkuTXJ40nuXWP5a5Lc034+m+QFXYwrSepOV0cI7wOuOM7yrwMvrarnA28F9nQ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66LIJNcBrwJeU+08xRTV+HMMw//Lbd3ZDnwxybOnqMalfm+voS8wPAtwzqRqnMZAuBu4KMmFSTYxfDNk7yQGbkn8x8D9VfWHI4v2Ate129cxfG9haf417d38C4GLgC+0w/ofJbm09fm6kfuMpapurKrtVbWD4XPzF1X1W1NW498AjyT5+TbrcuCr01Qjw1NFlyZ5Wuv7cuD+KatxSZc1jfb1Gwz/fsbes01yBXAD8Oqq+smK2je8xqr6SlWdW1U72rpziOEHSP5mWmpsPsrwvUGSPI/hBzK+M7EaT/ZNkEn8MLwe89cYvpN+0wTH/ScMD6nuAb7Ufq5ieN7tLuDB9vvskfvc1Oo8wMinS4A54N627F2cwhtO66j3Mo69qTxVNQK/COxrz+VHGR4GT1uN/wF4oPX/3xh+gmNDawQ+xPA9jXmGG603dFkTcAbw58BBhp9OeW5HNR5keL56ab25ZdpqXLH8G7Q3laepRoYB8IE25heBl0+yRv91hSQJmM5TRpKkDWAgSJIAA0GS1BgIkiTAQJAkNQaCJAkwECRJzf8HXXNWfEsCvOoAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "rr = _ecg_simulate_ecgsynth()\n", "pd.Series(rr).plot()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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.4" } }, "nbformat": 4, "nbformat_minor": 2 }