Sie sind auf Seite 1von 4

ENGR 1221 – Mid-Semester Project

This is an individual project. Rules for interaction with your fellow students are
the same as any individual assignment.

Background: In this project you will be working with neurological data collected inside a
subject’s brain. This data has 3 channels and 25,000 values that represent the
microvoltages at the cellular level (neuronal) (Figure 1). You will use what you have
learned to summarize the information contained in these three channels using plotting and
data analysis.

Figure 1: Neurons and microelectrode recording an action potential.

In the assignment section of Carmen you will find the necessary data for this project
(file: neuronData.xlsx). The data array contains 3 columns of 25,000 values each.;
each column contains the data from one microelectrode. These 25,000 samples were
taken in a span from 0 to 1.3 seconds.

Task 1: Write a function to plot the 3 channels of data on a single graph using a
subplot

Function Specification

Input Arguments:

 The data array (a matrix)


 The sampling interval (time between samples), a scalar [You can easily
figure this out from the provided information above.]

Output Arguments: None

Make a summary plot showing the three different channels with the shared time axis
(hint: use a subplot). The channels should be properly labeled showing the date of the
recording (Channel 1 – 3/16/17, Channel 2 – 3/20/17, Channel 3 – 4/07/17), the units
(mV), and using a combination of the max function and the text function to find which
action potential has the largest amplitude. Example below in figure 2:

Figure 2: Text function implemented in channels to find maximum amplitude.

A researcher might be interested in looking more closely at said action potential and
look at its profile to characterize it better. In the same subplot, add a zoomed in version
of this action potential (hint: instead of creating a 3x1 subplot, create a 3x3 subplot and
use the blocks 1x3, 2x3, and 3x3 for your zoom). In order to zoom into a subset of your
data, you only need to set your axis to the desired field of view. Your finished result
should look something like this:

Figure 3: Channel data with respective maximum action potential.


Task 2: Write a function to perform analysis on a set of spike trains.

Function Specification

Input Arguments:

 The data array containing the 3 channels of spike data


 The sampling period (time between samples) of the data (a scalar)
 The threshold voltage (in mV) for a spike (a scalar)

Output Arguments:

 A 1x3 array with the number of spikes above the threshold value in each
channel
 A 1x3 array with the average peak height in each channel
 A 1x3 array with the maximum peak height in each channel
 A 1x3 array with the average time between spikes
 A 1x3 array containing the correlation coefficient for each pair of
channels, in the following order: (1,2), (1,3), (2,3). The correlation
coefficient is defined below.

For example, if the function is called analyze_spikes, and the sampling interval is 10
microseconds, a call might look like this:

[numSpikes, avgHeight, maxHeight, avgTime, corrCoeff] =


analyze_spikes(spikeData, 10e-6, 1.0)

Remember that the output arguments are 1x3 arrays.

To find the number of peaks above the threshold, you can use the Matlab built-in
function findpeaks(), for example:

[peak_vals, peak_ind] = findpeaks(data,'MinPeakHeight',1)

This function will give you the peaks in a recording that are above 1 unit of measure (in
this case mV); peak_vals is an array containing the maximum value of each peak,
and peak_ind is an array containing the index at which each peak value occurs.

Correlation is a measure of how likely two neurons are to fire at the same time. For
purposes of this project, the correlation between two channels is calculated in the
following (simplified) manner:1

1
This is not the same as the formal definition of correlation coefficient in statistics; it is a simplified measure that
we created for this project.
 For each peak in the first channel, if the second channel is above
threshold at the time of that peak, the overlap for that peak is 1;
otherwise it is zero
 The correlation between channels i and j is then defined as:

(Sum of overlaps of chan j with chan i)*(Sum of overlaps of chan i with chan j)

(Number of Peaks in chan i)*(Number of peaks in chan j)

The degree of correlation will depend on the threshold value; the higher the threshold,
the lower the correlation. Note that if i and j are the same channel, the correlation is
1.0.

While this calculation may sound complicated, it can be done in one line in Matlab with
logical array operations.

Task 3: Write a script that does the following:

 Loads in the data matrix


 Calls your plotting function described in Task 1
 Calls the analysis function described in Task 2, using a threshold value of 0.5
 Writes the following tables to a text file, then use the type command to display
it to the command window (The numbers below are not the actual results):

Spike Data for Individual Channels


Channel Number of Spikes Mean Height Max Height Avg. Interval
(mV) (mV) (ms)
1 52 0.65 2.32 8.13
2 37 0.83 2.41 7.65
3 46 0.77 2.28 9.02

Correlation Between Channels, Threshold = 0. 5 mV


1 2 3
1 1.0 0.0076 0.0023
2 0.0076 1.0 0.0035
3 0.0023 0.0035 1.0

Notice that the correlation between channels i and j is always the same as between
channels j and i.

Das könnte Ihnen auch gefallen