Skip to content

Instantly share code, notes, and snippets.

@jeakwon
Created August 19, 2020 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeakwon/602e982257d3dbb3b4f03270bd767719 to your computer and use it in GitHub Desktop.
Save jeakwon/602e982257d3dbb3b4f03270bd767719 to your computer and use it in GitHub Desktop.
import numpy as np
t = np.arange(1000)
v = np.zeros(1000)
v[10]=1
v[200]=5
v[240]=2
def psc(t, tau1, tau2):
assert tau1<tau2
y = ( -np.exp(-t/tau1) + np.exp(-t/tau2) )
A_ = (tau2/tau1)**(tau1/(tau1-tau2))
ret = np.convolve(v, y/A_, 'full')
return ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment