Skip to content

Commit

Permalink
Add STC, although it works very slow
Browse files Browse the repository at this point in the history
  • Loading branch information
ycanerol committed May 16, 2017
1 parent 60bf779 commit 454cf40
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions stc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 16 13:28:17 2017
@author: ycan
Spike-triggered covariance
"""

def stc(spikes,stimulus,filter_length):
covariance=np.matrix(np.zeros(filter_length,filter_length))
sta=sta(spikes,stimulus,filter_length)
for i in range(filter_length,total_frames):
snippet=stimulus[i:i-filter_length:-1]
# Snippets are inverted before being added
snpta=[snippet-sta]
covariance=covariance+snpta.T*snpta*spikes[i]
return covariance/fil

0 comments on commit 454cf40

Please sign in to comment.