signalz/generators/ecgsyn.py
def derfunc(t, x, rr, sfint, ti, ai, bi):
    """
    Derivations of the ECG function.
    """
    xi = np.cos(ti)
    yi = np.sin(ti)
    ta = np.arctan2(x[1], x[0])
    r0 = 1.
    a0 = 1. - np.sqrt((x[0]**2) + (x[1]**2)) / r0
    ip = int(np.floor(t * sfint))
    w0 = 2. * np.pi / rr[ip]
    fresp = 0.25
    zbase = 0.005 * np.sin(2 * np.pi * fresp * t)
    dx1dt = a0*x[0] - w0*x[1]
    dx2dt = a0*x[1] + w0*x[0]
    dti = rem(ta - ti, 2. * np.pi) 
    dx3dt = - np.sum(ai * dti * np.exp(-0.5*(dti / bi)**2)) - (x[2] - zbase)
    return np.array([dx1dt, dx2dt, dx3dt])

    Derivations of the ECG function.
    
Derivations of the ECG function.
Derivations of the ECG function .
def derfunc(t, x, rr, sfint, ti, ai, bi):
    xi = np.cos(ti)
    yi = np.sin(ti)
    ta = np.arctan2(x[1], x[0])
    r0 = 1.
    a0 = 1. - np.sqrt((x[0]**2) + (x[1]**2)) / r0
    ip = int(np.floor(t * sfint))
    w0 = 2. * np.pi / rr[ip]
    fresp = 0.25
    zbase = 0.005 * np.sin(2 * np.pi * fresp * t)
    dx1dt = a0*x[0] - w0*x[1]
    dx2dt = a0*x[1] + w0*x[0]
    dti = rem(ta - ti, 2. * np.pi) 
    dx3dt = - np.sum(ai * dti * np.exp(-0.5*(dti / bi)**2)) - (x[2] - zbase)
    return np.array([dx1dt, dx2dt, dx3dt])
def derfunc ( t , x , rr , sfint , ti , ai , bi ) : xi = np . cos ( ti ) yi = np . sin ( ti ) ta = np . arctan2 ( x [ 1 ] , x [ 0 ] ) r0 = 1. a0 = 1. - np . sqrt ( ( x [ 0 ] ** 2 ) + ( x [ 1 ] ** 2 ) ) / r0 ip = int ( np . floor ( t * sfint ) ) w0 = 2. * np . pi / rr [ ip ] fresp = 0.25 zbase = 0.005 * np . sin ( 2 * np . pi * fresp * t ) dx1dt = a0 * x [ 0 ] - w0 * x [ 1 ] dx2dt = a0 * x [ 1 ] + w0 * x [ 0 ] dti = rem ( ta - ti , 2. * np . pi ) dx3dt = - np . sum ( ai * dti * np . exp ( - 0.5 * ( dti / bi ) ** 2 ) ) - ( x [ 2 ] - zbase ) return np . array ( [ dx1dt , dx2dt , dx3dt ] )
Derivations of the ECG function.
Derivations of the ECG function .
"""
    Derivations of the ECG function.
    """
t
x
rr
sfint
ti
ai
bi