Data Processing
 
Spike2 contains advanced features for processing waveform and timestamp data. Waveforms can be modified and information passed between channel types, for example marking times of detected waveform features or converting event data to waveform for analysis of frequency content.
 
Channel processes
A channel process is an operation applied dynamically to waveform data. Although the original data is not changed in any way, the user sees the processed data. Multiple processes can be applied and removed at any time.
 

EMG data with duplicated channels showing rectification and smoothing
Virtual channels
Virtual channels hold waveforms calculated from existing channels, as defined by user-supplied expressions. Calculations can be simple sums, products, differences or ratios of channels, or use mathematical functions. Like channel processes, they are applied dynamically both on-line and off-line.
 

A virtual channel used to calculate the magnitude of 3 perpendicular forces
Memory channels
Memory channels are temporary versions of any type of Spike2 data channel. The data they contain is held in computer memory for fast access and modification. The information held can be copies of channels, detected waveform features or user-entered information. These channels are lost when the file is closed down, but can be written permanently to the file at any time, if you wish to keep them.
 

Import of arterial pressure peaks to memory channel
Digital filtering
Digital FIR (Finite Impulse Response) and IIR (Infinite Impulse Response) filters can be applied to waveform data. Both types are set up using interactive dialogs with the following functions:
 
FIR filter types include high pass, low pass, band pass and band stop (1, 1 ½ and 2 bands) and differentiators with control of band edges and steepness of cutoff. FIR filters are unconditionally stable and impose no phase delay, so peaks and troughs do not move when data is filtered.
 
IIR filter types include notch and resonator filters plus low pass, high pass, band pass and band stop, modelled on Butterworth, Bessel and Chebyshev analogue filters. IIR filters allow steeper edges and narrower notches than FIR filters for the same computational effort.
 

Digital FIR filtering
Data processing using the script language
As well as commands for implementing all the built-in data processing functions described above, the Spike2 script language has full access to the data as arrays of waveform values or marker times. Within the script language there are many commands and mathematical functions for use with arrays, matrices and individual values. Results may then be placed back into a data file, or to another type of view, or output for further analysis. Typical commands include:
 
ChanData() Fill an array with a waveform or event times
ChanMeasure() Take specified measurements from a channel
ArrFFT() Perform spectral analysis on result views, or data array
ArrFilt() Applies a FIR filter to an array
ArrSort() Sort an array and optionally order others in the same way
ArrSpline() Interpolate one array to another using cubic splines
MATDet() Calculate the determinant of a matrix
MATSolve() Solve a set of linear equations
MATTrans() Transpose a matrix
PCA() Principal component analysis (singular value decomposition)
Exp() Exponential function of a number or array
Log() Logarithm to base 10 of a number or array


Example script command help page
The script language also contains a function for converting events to waveform format. Although similar functionality is available through the use of virtual channels, the EventToWaveform() command gives the added benefit of allowing the resultant waveform to be smoothed with a user-defined shape which may be asymmetrical.
 
CED hardware
On-line processing in Spike2 requires the data to be recorded using one of the 1401 family of laboratory interfaces. The 1401 and Spike2 system can capture data continuously whilst simultaneously processing and analysing this data as well as controlling the experiment and generating output stimuli.
 

Script driven waveform processing; integration of nerve activity normalised to baseline