Getting started with Spike Recorder for iOS
First thing you should do is to connect your iPhone or iPad to SpikerBox with a green smartphone cable.
Green cable comes with designators on each end of the cable (“Smartphone” and “SpikerBox”). Connect “Smartphone” end of the cable to the headphone input on your iPhone/iPad and “SpikerBox” end to your SpikerBox or SpikerShield green audio output and you are ready to record.
Figure 1: Recording setup. Connect green audio output of SpikerBox/SpikerShield using green cable to your headphones input on iPhone/iPad.
By default, Spike Recorder will be in the View/Record screen upon startup and will display the waveform of the signal captured in real time. Signal waveform will be displayed along with the horizontal time scale at the bottom of the screen. You can examine the signal in greater detail by zooming in and out by using a two-finger pinch gesture for amplitude or time scale. The time scale can be changed from 0.1 ms to 3 seconds. This flexibility enables you to examine the signal in full depth, from a single neuron spike to a series of spike bursts. It
Figure 2: Real time view screen
To record a signal for your experiment, tap on the Record button on the right-hand top side of the screen. During the recording, the application will display a red bar on the top of the screen with the time elapsed since the beginning of the recording. When you tap on the red bar, the application will stop recording and save data to an audio file.
Figure 3: Real time view during recording
All recordings can be accessed by using the Recordings tab at the bottom right of the screen. After you have chosen one of the recordings, the application will offer you numerous options.
Figure 4: File options screen
Figure 5: File details screen
If you select the File Details option, the application will show you details of the recording. Here you can change the name of the file, add a comment to the file, and see other details such as the sampling rate, the length of the file, and the date it was created.
On the File options screen you can also replay your recording (Play), analyse it, share it with other mobile devices or your desktop computer or delete it. We will examine some of these options in greater detail below.
Note that not all of the options will be present on the FIle options screen immediately after recording. For some of the options, like analysis graphs, you will first need to do spike sorting using the Find Spikes option.
If you choose the Play option in the file options screen, the application will open a new screen similar to live data view and immediately start playing the recording. You can pause the recording at any time by using the Pause button and examine the signal in greater detail by zooming in and out by using a two-finger pinch gesture for amplitude and/or time scales.
Figure 6: Playback screen
Scroll bar at the bottom will help you scroll the signal through time and easily jump from one part of the signal to another. Also, you can do similar things if you put your finger on the signal and drag it left and right.
To send your recording to another mobile device or desktop computer, use the Share option in the file options screen. The Share option will open a standard system sharing window. In this window, you will find multiple options, depending on your system configuration and installed third party applications.
Figure 7: Share window
Figure 8: Import window
If you, for example, share the recording using email, the receiver can open the email in their native email client and tap-and-hold attachment’s icon to access the import option for our mobile application.
Analysis of signal recording
Spike Recorder application has ability to perform numerous analysis on the recorded signal:
- spike count
- spike frequency
- root mean square (RMS)
- autocorrelation graph
- cross-correlation graph
- interspike interval graph (ISI)
- average spike waveform
To access results of all analyses you will first need to do spike sorting and create spike trains.
Figure 9: Spike sorting screen
To access the spike sorting screen, tap on the Find Spikes option in the file options screen. When the spike sorting screen opens, you will be presented with a signal waveform that is processed with a spike detection algorithm. You can scroll through the entire recording using the scroll bar.
When recording a signal in your specimen, a recording electrode will pick up the activation of all the neurons in the vicinity of the electrode. The spikes of the neurons close to your recording electrode will normally have the highest voltage peaks. Sometimes you will be able to see additional spike trains of a smaller amplitude in the recorded signal. These spikes correspond to the activation of a more distant neuron. The algorithm used in our application is very sensitive and will typically detect and mark all those spikes from different neurons. In addition, it will sometimes detect noise glitches as valid spikes.
Initially, all these neuron spikes in the signal will be marked with a white dot. In order to filter and extract only spikes that correspond to the activation of one neuron, you will need to adjust a valid amplitude interval using the two handles on the left and right side of the screen. After moving the two handles and adjusting your selection interval, you will see the selected neuron spike’s marks become red. It is important to note that the selection interval is immediately applied to the whole signal and not only to the part of the signal that you can see on the screen. Therefore, always use the scrollbar at the bottom of the screen to check if the filtering interval is compliant with the rest of the signal.
After adjusting the filtering interval, a set of selected spikes will be treated as one spike train that corresponds to the activation of a single neuron. All the other spikes (with a white mark) will be discarded when you finish spike sorting.
If an additional spike train from a distant neuron is visible in your recorded signal, you can create an additional valid voltage interval that will extract only spikes from that additional neuron. (Note that the two intervals should not overlap since it will give incorrect results in the subsequent analysis).
To create an additional spike train, tap on the “+” button on the top of the screen. The application will save information about the first valid voltage interval, create a new one and position handles at the initial value of zero volts. Now you can adjust the new voltage interval in a similar way you did with the first spike train. This time, the selected spikes will be marked with yellow marks.
When you create the second spike train, two additional buttons will appear at the top of the screen (refer to the image above). By using the handle button you can switch between the created spike trains and with the second (trash can) button you can delete the current spike train.
When you are satisfied with the filtering results, you can tap on the back button and all spike trains will be saved automatically.
RMS, spike count and spike frequency
If you play recording after you finish spike sorting you will notice that all spikes, that belong to created spike trains, are marked with colored dots.
Now you can find part of the recording that you are interested in and analyse it in greater details. If you tap and hold a finger on the waveform for a second a selection marker will appear on the screen. Now you can drag the selection marker over screen and select interval of the signal that you want to analyse.
Figure 10: Playback and spike measurements
Application will display gray background for the selected interval of the recording. In addition to that application will calculate and display:
- RMS (root mean square) of the signal
- length of the selected interval in seconds
- spike counts and spike frequency for every spike train that you created
Beside analysis that is displayed during playback you can use a file options screen to create ISI (interspike interval), autocorrelation and average spike graph. If you have multiple spike trains you can also create a cross-correlation graph that will show correlation between spikes of two different neurons.
Interspike interval graph
This graph is derived from a single spike train. X axis represents the time difference between two adjacent spikes in a single spike train. For this graph we used a logarithmic time scale to be able to show small inter spike intervals and greater inter spike intervals on the same graph. So, for example, 1E-2 seconds represents seconds which is equal to 0.01 seconds or 10ms.
Figure 11: Interspike interval graph
The Y axis application calculates interspike intervals for all adjacent spikes and sort them in bins. Namely, the height of one bin represents the number of occasions we encountered given an interspike interval in signal.
If you have multiple spike trains in recording you can select which one you want to zoom in by tapping on the small graphs on the right hand side of the screen (or bottom when device is in portrait orientation)
Autocorrelation graph is very similar to the ISI graph and is also calculated on a single spike train. The horizontal linear axis represents the time difference between any two different spikes (note that ISI is calculated only for consecutive spikes). Unit on the time scale is second.
Vertical axis represents the absolute number of spike pairs we measured in the spike train. Therefore the height of one histogram’s bin represents number of occasions we encountered given time difference between two different spikes in signal.
Figure 12: Autocorrelation graph
Average spike graph
Average spike graph displays waveform of average spike calculated by averaging all spikes in spike train centered around positive peak.
Horizontal linear axis represents time in milliseconds centered around positive peak and vertical axis displays peak-to-peak amplitude of average spike waveform in voltage units.
Beside average waveform (black line in the middle of every graph) graph also displays standard deviation of average waveform as a colored area around average waveform.
Figure 13: Average spike graph
Cross-correlation is used to discover the hidden relation between two neurons. Therefore it is calculated using information from two spike trains and a cross-correlation graph will be available in file options screen only if you made more than one spike train during spike sorting.
When you select cross-correlation in the file options screen, the first thing you will be presented with is a matrix of cross-correlation graphs (image on the left). Here you can have a brief overview of the correlation between different spike trains in your signal.
Note that graphs on the main diagonal represent cross-correlation between same spike trains which is analogous to autocorrelation of that spike train.
If you want to see one of the graphs in greater detail you can open the graph by tapping on the graph image.
Similarly to previous graphs, the horizontal axis represents the time difference between two spikes given in seconds.
On the vertical axis height of one histogram’s bin represents number of occasions we encountered given time difference between two spikes from different spikes trains.
Figure 15: Cross-correlation graph
Thresholding and measurements
If you want to average neuron spikes or take a snapshot of a single spike, you can use threshold view. By selecting on the Threshold tab, the application will enter the threshold mode that will catch the snapshot of the signal every time the waveform crosses the threshold level.
Figure 16: Measurements on threshold screen
On the top of the screen you will find sliders that vary from 1x to 100x. With this slider you can adjust the number of consecutive spikes that will be used for the calculation of the average spike. For example, if you select 25x, 25 consecutive spikes are averaged. Irrespective of the length of your recording, the application will always use the 25 most recently captured spikes for the calculation of the average spike. In extreme cases, when you set a slider to the value of one, the application will present only a raw signal of the most recent spike.
You can adjust a threshold level at any time by moving the red threshold line up and down using a handle on the right hand side of the screen.
During thresholding, similarly to the playback screen, you can tap and hold a finger on the waveform for a second and a selection marker will appear. By holding down and dragging your finger in a horizontal direction over the signal you can select an interval of the signal. Application will show you the time length of the interval in milliseconds and calculate RMS (Root mean square) of the selected portion of the signal.