Skip to content

Commit

Permalink
[DOC] More natural to flip sign in PureDelay
Browse files Browse the repository at this point in the history
  • Loading branch information
arvoelke committed Mar 27, 2017
1 parent 7e204e0 commit aee92b8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nengolib/synapses/analog.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,18 @@ def _proper_delay(q, c):
We use this because it is numerically stable for high q
and doesn't have a passthrough.
"""
j = np.arange(1, q+1, dtype=np.float64)
u = (q + j - 1) * (q - j + 1) / (c * j)
j = np.arange(q, dtype=np.float64)
u = (q + j) * (q - j) / (c * (j + 1))

A = np.zeros((q, q))
B = np.zeros((q, 1))
C = np.zeros((1, q))
D = np.zeros((1,))

A[0, :] = B[0, 0] = -u[0]
A[0, :] = -u[0]
B[0, 0] = u[0]
A[1:, :-1][np.diag_indices(q-1)] = u[1:]
C[0, :] = - j / float(q) * (-1) ** (q - j)
C[0, :] = (j + 1) / float(q) * (-1) ** (q - 1 - j)
return LinearSystem((A, B, C, D), analog=True)


Expand Down

0 comments on commit aee92b8

Please sign in to comment.