kernel

Kernel generating functions.

AUTHORS:

  • THOMAS MCTAVISH (2010-02-05): initial version
  • THOMAS MCTAVISH (2011-01-12): Fixed bug where kernels did not normalize with dt.
neuronpy.math.kernel.gauss_1d(sigma=1.0, dt=1.0, limit=0.01, normalize=True)[source]

Get a Gaussian distribution that sums to 1 along 1 dimension, quantized by discrete steps.

neuronpy.math.kernel.rectangle_window(window=0, dt=0.1, normalize=True)[source]

Make a rectangle (really a vector) that has a particular length.

Parameters:window – Length of the kernel, in ms. A value of zero (default), will still make a kernel of len == 1, corresponding to 1 time interval value, and filtering with such a kernel will yield the input.

Note

A time window of 5 ms, say, will be different depending on the value of dt. If dt == 1, then the kernel will range from [-2,2] across 5 values. If dt == 0.1, then the kernel will range from [-2.5, 2.5] across 51 values.

neuronpy.math.kernel.triangle(dt=0.1, normalize=True)[source]

Make a ramp from 0 to 1 back to 0 again by dt.

Parameters:
  • dt – timestep interval. Kernel will be of length 2/dt - 1 with peak at 1/dt.
  • normalize – If True, the kernel sums to 1. Otherwise, each point on the ramp is quantized by an integer.

Previous topic

Math

Next topic

Neuron Objects

This Page