Jan Bs projects
This commit is contained in:
10
projects/project_noiseficurves/Makefile
Normal file
10
projects/project_noiseficurves/Makefile
Normal file
@@ -0,0 +1,10 @@
|
||||
latex:
|
||||
pdflatex *.tex > /dev/null
|
||||
pdflatex *.tex > /dev/null
|
||||
|
||||
clean:
|
||||
rm -rf *.log *.aux *.zip *.out auto
|
||||
rm -f `basename *.tex .tex`.pdf
|
||||
|
||||
zip: latex
|
||||
zip `basename *.tex .tex`.zip *.pdf *.dat *.mat *.m
|
||||
38
projects/project_noiseficurves/lifspikes.m
Normal file
38
projects/project_noiseficurves/lifspikes.m
Normal file
@@ -0,0 +1,38 @@
|
||||
function spikes = lifspikes( trials, input, tmaxdt, D )
|
||||
% Generate spike times of a leaky integrate-and-fire neuron
|
||||
% trials: the number of trials to be generated
|
||||
% input: the stimulus either as a single value or as a vector
|
||||
% tmaxdt: in case of a single value stimulus the duration of a trial
|
||||
% in case of a vector as a stimulus the time step
|
||||
% D: the strength of additive white noise
|
||||
|
||||
tau = 0.01;
|
||||
if nargin < 4
|
||||
D = 1e0;
|
||||
end
|
||||
vreset = 0.0;
|
||||
vthresh = 10.0;
|
||||
dt = 1e-4;
|
||||
|
||||
if length( input ) == 1
|
||||
input = input * ones( ceil( tmaxdt/dt ), 1 );
|
||||
else
|
||||
dt = tmaxdt;
|
||||
end
|
||||
spikes = cell( trials, 1 );
|
||||
for k=1:trials
|
||||
times = [];
|
||||
j = 1;
|
||||
v = vreset;
|
||||
noise = sqrt(2.0*D)*randn( length( input ), 1 )/sqrt(dt);
|
||||
for i=1:length( noise )
|
||||
v = v + ( - v + noise(i) + input(i))*dt/tau;
|
||||
if v >= vthresh
|
||||
v = vreset;
|
||||
times(j) = i*dt;
|
||||
j = j + 1;
|
||||
end
|
||||
end
|
||||
spikes{k} = times;
|
||||
end
|
||||
end
|
||||
91
projects/project_noiseficurves/noiseficurves.tex
Normal file
91
projects/project_noiseficurves/noiseficurves.tex
Normal file
@@ -0,0 +1,91 @@
|
||||
\documentclass[addpoints,10pt]{exam}
|
||||
\usepackage{url}
|
||||
\usepackage{color}
|
||||
\usepackage{hyperref}
|
||||
|
||||
\pagestyle{headandfoot}
|
||||
\runningheadrule
|
||||
\firstpageheadrule
|
||||
\firstpageheader{Scientific Computing}{Project Assignment}{11/05/2014
|
||||
-- 11/06/2014}
|
||||
%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014}
|
||||
\firstpagefooter{}{}{}
|
||||
\runningfooter{}{}{}
|
||||
\pointsinmargin
|
||||
\bracketedpoints
|
||||
|
||||
%\printanswers
|
||||
%\shadedsolutions
|
||||
|
||||
%%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\usepackage{listings}
|
||||
\lstset{
|
||||
basicstyle=\ttfamily,
|
||||
numbers=left,
|
||||
showstringspaces=false,
|
||||
language=Matlab,
|
||||
breaklines=true,
|
||||
breakautoindent=true,
|
||||
columns=flexible,
|
||||
frame=single,
|
||||
% captionpos=t,
|
||||
xleftmargin=2em,
|
||||
xrightmargin=1em,
|
||||
% aboveskip=10pt,
|
||||
%title=\lstname,
|
||||
% title={\protect\filename@parse{\lstname}\protect\filename@base.\protect\filename@ext}
|
||||
}
|
||||
|
||||
|
||||
\begin{document}
|
||||
%%%%%%%%%%%%%%%%%%%%% Submission instructions %%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\sffamily
|
||||
% \begin{flushright}
|
||||
% \gradetable[h][questions]
|
||||
% \end{flushright}
|
||||
|
||||
\begin{center}
|
||||
\input{../disclaimer.tex}
|
||||
\end{center}
|
||||
|
||||
%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\begin{questions}
|
||||
\question You are recording the activity of a neuron in response to
|
||||
constant stimuli of intensity $I$ (think of that, for example,
|
||||
of sound waves with intensities $I$).
|
||||
|
||||
Measure the tuning curve (also called the intensity-response curve) of the
|
||||
neuron. That is, what is the firing rate of the neuron's response
|
||||
as a function of the input $I$. How does this depend on the level of
|
||||
the intrinsic noise of the neuron?
|
||||
|
||||
\begin{parts}
|
||||
\part The neuron is implemented in the file \texttt{lifspikes.m}.
|
||||
Call it with the following parameters:
|
||||
\begin{lstlisting}
|
||||
trials = 10;
|
||||
tmax = 50.0;
|
||||
input = 10.0; % the input I
|
||||
Dnoise = 1.0; % noise strength
|
||||
|
||||
spikes = lifspikes( trials, input, 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 is set via the \texttt{input} variable, the noise strength via \texttt{Dnoise}.
|
||||
|
||||
\part First set the noise \texttt{Dnoise=0} (no noise). Compute and plot the firing rate
|
||||
as a function of the input for inputs ranging from 0 to 20.
|
||||
|
||||
\part Do the same for various noise strength \texttt{Dnoise}. Use $D_{noise} = 1e-3$,
|
||||
1e-2, and 1e-1. How does the intrinsic noise influence the response curve?
|
||||
|
||||
\part Show some interspike interval histograms for some interesting values of the input
|
||||
and the noise strength.
|
||||
|
||||
\end{parts}
|
||||
|
||||
\end{questions}
|
||||
|
||||
\end{document}
|
||||
Reference in New Issue
Block a user