\documentclass[a4paper,12pt,pdftex]{exam}

\newcommand{\ptitle}{Neural tuning and noise}
\input{../header.tex}
\firstpagefooter{Supervisor: Jan Benda}{phone: 29 74573}%
{email: jan.benda@uni-tuebingen.de}

\begin{document}

\input{../instructions.tex}

\begin{questions}
  \question You are recording the activity of a neuron in response to
  constant stimuli of intensity $I$ (think of that, for example,
  as a current $I$ injected via a patch-electrode into the neuron).

  Measure the tuning curve (also called the intensity-response curve) of the
  neuron.  That is, what is the mean firing rate of the neuron's response
  as a function of the constant input current $I$?

  How does the intensity-response curve of a neuron depend on the
  level of the intrinsic noise of the neuron?

  How can intrinsic noise be usefull for encoding stimuli?

  The neuron is implemented in the file \texttt{lifspikes.m}.  Call it
  with the following parameters:\\[-7ex]
    \begin{lstlisting}
trials = 10;
tmax = 50.0;
current = 10.0;  % the constant input current I
Dnoise = 1.0;    % noise strength
spikes = lifspikes(trials, current, tmax, Dnoise);
    \end{lstlisting}
    The returned \texttt{spikes} is a cell array with \texttt{trials}
    elements, each being a vector of spike times (in seconds) computed
    for a duration of \texttt{tmax} seconds.  The input current is set
    via the \texttt{current} variable, the strength of the intrinsic
    noise via \texttt{Dnoise}. If \texttt{current} is a single number,
    then an input current of that intensity is simulated for
    \texttt{tmax} seconds. Alternatively, \texttt{current} can be a
    vector containing an input current that changes in time. In this
    case, \texttt{tmax} is ignored, and you have to provide a value
    for the input current for every 0.0001\,seconds.

    Think of calling the \texttt{lifspikes()} function as a simple way
    of doing an electrophysiological experiment. You are presenting a
    stimulus with a constant intensity $I$ that you set. The neuron
    responds to this stimulus, and you record this response. After
    detecting the timepoints of the spikes in your recordings you get
    what the \texttt{lifspikes()} function returns. In addition you
    can record from different neurons with different noise properties
    by setting the \texttt{Dnoise} parameter to different values.

  \begin{parts}
    \part First set the noise \texttt{Dnoise=0} (no noise). Compute
    and plot the neuron's $f$-$I$ curve, i.e. the mean firing rate
    (number of spikes within the recording time \texttt{tmax} divided
    by \texttt{tmax} and averaged over trials) as a function of the
    input current for inputs ranging from 0 to 20.

    How are different stimulus intensities encoded by the firing rate
    of this neuron?

    \part Compute the $f$-$I$ curves of neurons with various noise
    strengths \texttt{Dnoise}. Use for example $D_{noise} = 10^{-3}$,
    $10^{-2}$, and $10^{-1}$.

    How does the intrinsic noise influence the response curve?

    What are possible sources of this intrinsic noise?

    \part Show spike raster plots and interspike interval histograms
    of the responses for some interesting values of the input and the
    noise strength. For example, you might want to compare the
    responses of the four different neurons to the same input, or by
    the same resulting mean firing rate.

    How do the responses differ?

    \part Let's now use as an input to the neuron a 1\,s long sine
    wave $I(t) = I_0 + A \sin(2\pi f t)$ with offset current $I_0$,
    amplitude $A$, and frequency $f$. Set $I_0=5$, $A=4$, and
    $f=5$\,Hz.

    Do you get a response of the noiseless ($D_{noise}=0$) neuron?

    What happens if you increase the noise strength?

    What happens at really large noise strengths?

    Generate some example plots that illustrate your findings.

    Explain the encoding of the sine wave based on your findings
    regarding the $f$-$I$ curves.

 \end{parts}

\end{questions}

\end{document}
