BMEBW4020 4

Problem 1:¶
Consider the following Encoding circuit with 2 Wilson neurons with feedforward, feedback and cross-feedback:

$h^1$ and $h^2$ refer to feedforward filters; $h^{11}$ and $h^{22}$ refer to feedback filters; $H$ refer to summation-cross-feedback filter.

Assume that the BSGs in the figure are PIFs of two different Wilson neurons.

Questions:¶
Write down the $t$-transform of the Encoding Circuit shown above in an inner product form.
Find an algorithm that recovers the signal $u$. Provide detailed procedures of derivation, such as how to calculate $q, G, c$ and how to recover the signal.
Under what conditions can the signal $u$ be perfertly recovered? Note that the analytical solution is not required here. Just use your words to briefly describe your understanding, such as from the perspectives of $u$ and the observed spikes.

Note that this problem tests your understanding of neural encoding and decoding. It does NOT require you to write any code.
Write your answer in markdown.

Problem 2¶
In this problem you are asked to derive and implement a TEM/TDM algorithm for an ONOFFIAF neuron (refer to Chapter 8, ON-OFF IAF Neurons with Feedback) with dendritic processing modeled as a linear filter ($h(t)$ in the figure below).

# import libraries
import numpy as np
from scipy.integrate import cumulative_trapezoid as cumtrapz
from compneuro.utils.signal import convolve
import matplotlib.pyplot as plt
import typing as tp

np.random.seed(0)

def stimulus(t, omega, s):
out = np.zeros_like(t)
omega_pi = omega / np.pi
for k in range(len(s)):
out += s[k] * omega_pi * np.sinc(omega_pi * t – k)
return out / np.max(np.abs(out))

def signal_generator(t, samples, sample_times, omega):
signal = np.zeros_like(t)
for s, st in zip(samples, sample_times):
signal += omega / np.pi * s * np.sinc(omega / np.pi * (t – st))
return signal

dt = 1e-5 # time step
ds = 10 # downsampling factor
t = np.arange(-0.1, 0.25, dt) # simulation time
omega = 2 * np.pi * 50 # cutoff frequency
N = np.floor(t[-1] / np.pi * omega).astype(int) # number of sample points
u = stimulus(t, omega, np.random.rand(N) – 0.5) # randomly generated input stimulus

t_filt = np.arange(T_1, T_2, dt)
* np.exp(-a * t_filt)
(a * t_filt) ** 3 / np.math.factorial(3)
– (a * t_filt) ** 5 / np.math.factorial(5)
) # filter impulse response

# convolve input stimulus with filter

# setup for G matrix

# code up encode, decode, compute_q, compute_G functions
# Class FilterONOFFIAF:

# instantiate model
onoffiaf_params = dict(delta=0.01, kappa=1, b=1, omega=omega)

def own_filter(t, tk):
td = t – tk
td = td[td>0]
return np.sum(0.1 * np.exp(-td/0.01))

def cross_filter(t, tk):
td = t – tk
td = td[td>0]
return np.sum(0.075 * np.exp(-td/0.015))

onoffiaf = FilterONOFFIAF(own_filter=own_filter, cross_filter=cross_filter, params=onoffiaf_params)

# plot results and SNR

# For results, in the same plot include the original and recovered signals,
# use different colors/linwidth if have to

# SNR vs t in another plot