Skip to content

Commit

Permalink
Add STA projection removal
Browse files Browse the repository at this point in the history
  • Loading branch information
ycanerol committed May 18, 2017
1 parent 095e74f commit 54dacfa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def stc(spikes, stimulus, filter_length, sta_temp):
if spikes[i] != 0:
snippet = stimulus[i:i-filter_length:-1]
# Snippets are inverted before being added
snippet = snippet-np.dot(snippet,sta_temp)*sta_temp
# Project out the STA from snippets
snpta = np.array(snippet-sta_temp)[np.newaxis, :]

covariance = covariance+np.dot(snpta.T, snpta)*spikes[i]
return covariance/(sum(spikes)-1)

Expand All @@ -40,7 +43,7 @@ def stc(spikes, stimulus, filter_length, sta_temp):
plt.xlabel('Eigenvalue index')
plt.ylabel('Variance')

eigen_indices = [0, 1, 2]
eigen_indices = [0, 1]
eigen_legends = []

plt.subplot(1, 2, 2)
Expand Down

0 comments on commit 54dacfa

Please sign in to comment.