This folder contains the modelling and analysis code in MATLAB and MATLAB Simulink used in Olson et al. (2021) to model feedforward 
inhibitory (FFI) neurons in the dorsal uncrossed bundle (DUB) of the locust which are presynaptic to the lobula giant movement detector 
(LGMD). Data from the manuscripts "Feedforward Inhibition Conveys Time-Varying Stimulus Information in a Collision Detection Circuit" by 
Wang et al. (2018) and "Synchronized Neural Input Shapes Stimulus Selectivity in a Collision-Detecting Neuron" by Jones and Gabbiani (2010) 
have been included for comparison.  If you have any questions regarding the model, please direct them to Erik Olson (erik.olson@usask.ca).

To generate the model data:
- Open and run DataGeneration1, which generates data for simulations of looming stimuli using various l/|v| values and inhibition schemes
- Open and run DataGeneration2, which generates data for FFI neuron responses to the appearance and movement of a small patch of grating; 
note that this can take a very long time to run (~50 hrs on a 20-core processor)
- Open and run DataGeneration3, which simulates a voltage-clamped LGMD's response to single-facet luminance changes of various durations
- Open and run DataGeneration4, which simulates responses of lamina monopolar cells to single-facet luminance changes of various durations

To generate figures (output as PDFs):
- Run Figures1 to generate Figures 8, 9, and 10 from the manuscript, which pertain to looming stimuli
- Run Figures2 to generate Figure 11, which pertains to grating stimuli
- Run Figures3 to generate Figures 3 and 4, which pertain to single-facet stimuli

Notes:
- The files DataGeneration1 and DataGeneration2 assume that the parallel processing toolbox is present.  If not, comment out or delete the
indicated lines of code which set up the parallel pool.