Wave Planner and WavePlayer

Overview

SpikeGLX contains easy to use tools for stimulus waveform output.

Waves

A 'wave' is a pair of descriptor files:

  1. A mywave.meta file is in human readable 'ini' format, just like a SpikeGLX run.meta file. It's a handful of plain text 'keyword=value' pairs. Here's an example:
[WaveMeta]
sample_frequency_Hz_dbl=10000
wave_Vpp_dbl=2
device_Vpp_dbl=5.0
data_type_txt_i16_f32=txt
num_samples_i32=0
  1. The corresponding data file can have three formats, selected by the data_type_txt_i16_f32 meta item:
  1. 'txt' data type: file mywave.txt contains a plain text script that generates the samples.
  2. 'i16' data type: file mywave.bin contains the numerical samples as 16-bit signed integers.
  3. 'f32' data type: file mywave.bin contains the numerical samples as floats.

IMPORTANT:

Binary Wave Files

The binary formats are provided to allow maximum flexibility to generate samples using your own external tools. Valid binary data follow these rules:

The scaled values are forced to range [-32768,32767].

Although you must generate the .bin file and its samples yourself, you can use the SpikeGLX Wave Planner dialog to edit the frequency and voltage scales in the .meta file.

Text Wave Syntax

Use the Wave Planner 'Data' text box to write your generator script.

Our wave mini-language uses four commands that can be strung together in any combination:

White-space (returns, spaces, tabs) are completely ignored. Use space freely to make a script readable.

At load-time your script is compiled into scaled samples; scale factor: (32767 * wave_Vpp_dbl / device_Vpp_dbl).

Example

do 10 {
    level(     0,   50 )
    ramp( 0,   0.5, 10 )
    level(     0.5, 100 )
    ramp( 0.5, 0,   10 )
}

fin