Skip to content

Instantly share code, notes, and snippets.

@MarvinT
Created July 11, 2017 05:36
Show Gist options
  • Save MarvinT/c37cd01f55c07adaa6a2ad51b785c18b to your computer and use it in GitHub Desktop.
Save MarvinT/c37cd01f55c07adaa6a2ad51b785c18b to your computer and use it in GitHub Desktop.

Revisions

  1. MarvinT created this gist Jul 11, 2017.
    4 changes: 4 additions & 0 deletions gaussian_smoothing.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    def filtered_response(spk_times, tau = .01):
    spk_times = spk_times.reshape((-1, 1))
    norm_factor = tau * np.sqrt(2. * np.pi)
    return lambda t: np.sum(np.exp(-(spk_times - t.reshape((1,-1))) ** 2 / (2 * tau * tau)), 0) / norm_factor