This script and associated sequence can be used to generate a sine wave with a linear or quadratic increasing frequency from DAC 0 of a 1401 interface. To view the output, connect DAC 0 to ADC 0, load the included sampling configuration, ZAPexample.S2C, and select the text sequence file, ZAPexample.pls, from the Sequencer tab.
The script opens a new data file ready to sample based on the current sampling configuration. Sine wave settings are controlled from a script toobar button and can be updated during sampling
This script requires Spike2 v7.00 or higher and a Micro1401 or Power1401 interface.
Keywords: ZAP function, sine wave
This script and associated sequence creates ramps of increasing or decreasing pulse frequency on-line and allows the user to enter settings for ramp time as well as start, turning point and end frequencies for the pulse output.
Before running the script you must ensure that the LinRampFreq.pls output sequence is selected in the Sequencer tab of your sampling configuration. The script sets up a new data file for recording based on the current sampling configuration.
For testing purposes, set channel 1 in your sampling configuration to be an Event channel in which pulses can be recorded to help visualise the results. The pulses are set to be 10us long and are output from digital output 0 of the 1401.
This script requires Spike2 v5.17 or higher and a Micro1401 or Power1401 interface.
Keywords: linear frequency, pulse output
This script and associated sequence is an example of using the sequencer table to output a series of pre-recorded events during sampling. Select the PlaySpikeTimes.pls sequence file in the Sequencer tab of your sampling configuration before running the script
When run, the script prompts the user to open a data file containing the spikes or events to use and select a time range of events to write to the sequencer table. During sampling, key 'a' will play the copied data out of digital output 0.
This script requires Spike2 v5.17 or higher and a Micro1401 or Power1401 interface.
Keywords: Pre-recorded event output
This script can be used to monitor an event or WaveMark channel and switch between slow frame rate and the normal frame rate depending on the level of activity in the nominated channel. You can specify the minimum interval between events that signals the start of a period of low activity.
This script requires Spike2 v5.17 or higher.
Keywords: Frame rate, spike activity
This script is an example of applying IIR filters to a nominated waveform channel during sampling. It opens a new data file based on the current sampling configuration and then generates a dialog from which the user can specify the type of filter to apply and the source waveform channel to use.
Once sampling is started the script uses an idle routine to apply the filter to the source data and produces a new memory channel displaying the result.
This script requires Spike2 v6.01 or higher.
Keywords: On-line filter
This script demonstrates interaction between a script and the Spike2 output sequencer by means of variable values. It uses the VarEx.pls sequence file and is described in detail in the Scripts tutorial 1 page and requires version 3 or later.
This rectifies and smoothes an EMG signal in real time, while sampling.
This script allows you to record data at high sampling rates for long periods of time by opening and saving a series of data-files. Each data-file records for a preset time and is automatically saved before the next file is opened.
This on-line script is written for use with Spike2 for Windows version 3 and later.
It detects the time of threshold crossings on a waveform channel and marks these times in the file or outputs a TTL pulse upon detection. The threshold is set with a horizontal cursor which can be moved at any time during the recording.
Before running the script, you need to ensure a suitable sampling configuration is set. This must contain at least one waveform channel. If you select to output a TTL pulse upon threshold detection, you may choose to set up an event or level channel for testing purposes.
To run the script, go to the script menu and select Run script. If the script is already loaded, it will appear in the menu; otherwise select Load and run which will generate a file selection dialog from which you should find and load the threspul.s2s script.
When the script is run, a dialog will appear, from which you set the various required settings:
| Input channel | Waveform channel on which to base threshold crossing timing |
| Threshold | Direction of threshold crossing. Positive (rising) or negative (falling) |
| Action | TTL pulse and/or memory channel marker |
When OK is pressed in this dialog the script will open a new data file, ready to sample, with a horizontal cursor positioned on the selected waveform channel. This should be positioned at a reasonable starting level for the threshold, and the OK button pressed to continue.
When ready to sample, a toolbar is displayed from which the data sampling is controlled.
| Quit | Quit the script and close down the toolbar |
| Sample start | Commence data sampling |
| Sample stop | Stop sampling. This button is disabled until sampling begins |
| New file | Close current file and open a new file ready to sample |
TTL output
The default TTL output gives a pulse of duration 1ms from digital output 0 (bit 8) of the 1401 interface. The overall speed of the sequence and the pulse duration and selection of output bit can be edited in the pulse.pls file if required.
If TTL output is selected, the script writes a Spike2 output sequence file which is stored with a default name (pulse.pls) in the sequence sub-directory of the main Spike2 directory where the application is stored (e.g. C:\Spike4\Sequence\pulse.pls).
Memory channel marker
If Memory channel marker is selected, a new temporary channel is created and displayed in the data file. Each time the threshold is crossed, markers are imported into this channel at a position as close as possible to the actual threshold crossing.
This channel is temporary and must be written to a permanent channel if it is to be saved with the recorded data file. To do this go to the Analysis menu and select Memory buffer then Write to channel. From the dialog you can select an empty channel into which this data will be written.
In some types of experiment it may be necessary to adjust the gain and offset of external preamplifiers repeatedly during the course of a recording. It is important to keep track of these changes and to ensure that the recording levels always remain within recommended limits. The level meter script can help you fulfil these requirements. It generates a duplicate view of your incoming data with each channel displayed relative to the full input range of the 1401. It gives you audible and visual warnings if any of the traces approach the limits of the working range. The script also allows you to keep a record of gain, offset and other changes by annotating the data file with TextMarks.
This script requires Spike2 version 5 or higher.
This script enables you to create tone bursts, noise burst or clicks and store them in a sampling configuration. These waveforms are then available to be played via a 1401 DAC output as an auditory stimulus during subsequent recording sessions.
Click stimuli can be positive or negative going. The rising and falling phases of tone bursts can be of fixed duration or an exact number of cycles of the underlying waveform (tone pips). The script can also create sequences of identical tone bursts separated by fixed intervals. Thus you could create, for example, a synthesised cricket chirp with 4 equally spaced syllables.
You can store up to 10 auditory stimuli in a sample configuration. You can play them in ‘single-shot’ mode by pressing a button on the PlayWave toolbar during a recording session. Use the WavePlay script to play selected waveforms repetitively. Full user instructions are included in the comments section of the script file.
Software requirements: Spike2 version 5.14 or higher.
Hardware: not compatible with Standard 1401.
This script allows you to select a set of waveforms to play during the next recording session and set timing parameters such as repetition rate and number of repeats. Stimuli and responses can be then be displayed as triggered sweeps or in ‘chart recorder ‘ mode. The script also has the option to play two different stimuli alternately. A typical application would be alternate presentation of condensation and rarefaction clicks. A full user guide is included in the comments section of the script.
Software requirements: Spike2 version 5.14 or higher. The script works in conjunction with a text sequencer: PlayWaveform02.pls. This file must be stored in the folder named 'sequence' inside the main Spike2 directory.
Hardware requirements: Not compatible with standard 1401 interface
These scripts are stored as WinZip files, myscript.zip, except where they are shown as spike\scripts\myscript.s2s. Those latter files were installed with Spike2 and spike stands for the directory in which you installed Spike2. See the summaries by clicking on the description line, below. Then you can down-load them by clicking on the filename; please check the size received.