|
@@ -1,5 +1,5 @@
|
|
|
function [naturalMovie_output]=BC_predNaturalMovies(loadData,filename,movieSignal,STA_output,NL_output,Hz)
|
|
|
-%[naturalMovie_output]=BC_predNaturalMovies(movieSignal,STA_output,NL_output)
|
|
|
+%[naturalMovie_output]=BC_predNaturalMovies(loadData,filename,movieSignal,STA_output,NL_output,Hz)
|
|
|
%this function shows the prinicpal calculation for the prediction of the
|
|
|
%response to the natural movie, from the linear-nonlinear model (LN-model)
|
|
|
%computed with white noise stimulus.
|
|
@@ -12,12 +12,13 @@ function [naturalMovie_output]=BC_predNaturalMovies(loadData,filename,movieSigna
|
|
|
% STA_output = output of the BC_STA function; containing the
|
|
|
% STA (filter) of the white noise stimulus
|
|
|
% NL_output = output of the BC_NL function; containing the
|
|
|
-% output nonlinearity of the white noise stimulus
|
|
|
+% output nonlinearity of the white noise stimulus
|
|
|
+% Hz = movie update rate given in excel file
|
|
|
%
|
|
|
%Outpus: naturalMovie_output = structure containing the output of the
|
|
|
% prediction
|
|
|
%
|
|
|
-% code by HS last modiefied Feb 2021
|
|
|
+% code by HS last modiefied March 2021
|
|
|
|
|
|
%% Constants
|
|
|
findBreak=500; %the movie is repeated multiple times. Between the movies there is
|
|
@@ -38,8 +39,17 @@ movieSignal2D_zoom=reshape(movieSignal_zoom,size(movieSignal_zoom,1)*...
|
|
|
%normalize the filter
|
|
|
linearFiler=normSTA(STA_output.STA2D_zoom);
|
|
|
%convolve the natural movie stimulus sequence with the
|
|
|
-%normalized STA
|
|
|
+%normalized STA.
|
|
|
stim2pred=filter2(linearFiler,movieSignal2D_zoom,'valid');
|
|
|
+%%IMPORTANT: if you have a best spatial and temporal component as described in Point 7
|
|
|
+%in the function BC_STA.m (see Method of Manuscript), this part hast to be done in two lines, e.g.:
|
|
|
+%NL_PredXaxis2=filter2(sp_bestnorm,movieSignal2D_zoom,'valid'); %first
|
|
|
+%convolve the spatial dimension
|
|
|
+%generator_signal=filter2(temp_bestnorm,NL_PredXaxis2,'valid'); %then the
|
|
|
+%temporal dimension
|
|
|
+%%Also note, to avoid noise contributions from pixels outside the receptive
|
|
|
+%%field,it is important to cut the STA into a smaller region around the maximum pixel, this
|
|
|
+%%gives a much cleaner NL-> see BC_STA.m and Methods in Schreyer&Gollisch (2021).
|
|
|
|
|
|
%% 2.2 compute the prediction through linear interpolation
|
|
|
NL_x=NL_output.bins.NL_xbin;
|