data acquisition for applications in ... - spike hound...

21
Spike Hound v1.2 Suite of Software Tools for Data Acquisition & Experiment Control Software Oscilloscope & Data Logger, Stimulus Pulse & Component Function Generator Output Digital I/O Signal Conditioning, Visualization, & CrossCorrelation Real Time Event Detection & Analysis Open Source Release User’s Manual ©2010 Gus K Lott III, PhD Neurobiological Instrumentation Engineer Howard Hughes Medical Institute 19700 Helix Dr., Ashburn, VA 20147 [email protected] [email protected] April 11, 2010

Upload: others

Post on 28-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

   

 Spike Hound v1.2 

Suite of Software Tools for Data Acquisition & Experiment Control   

Software Oscilloscope & Data Logger, Stimulus Pulse & Component Function Generator Output 

Digital I/O Signal Conditioning, Visualization, & Cross‐Correlation 

Real Time Event Detection & Analysis   

Open Source Release 

User’s Manual      ©2010 Gus K Lott III, PhD 

Neurobiological Instrumentation Engineer Howard Hughes Medical Institute 19700 Helix Dr., Ashburn, VA 20147 [email protected] [email protected]  April 11, 2010 

Page 2: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

2

Introduction  

Spike Hound  (formerly  “g‐PRIME”)  is  a data  acquisition  and  real  time  analysis package  designed  for  use  in  physiology  labs where  continuous multi‐channel  data  is acquired  and  discrete  events  are  analyzed.    The  software  allows  for  connection  to  a broad  range  of  popular  data  acquisition  hardware  from  high  end,  calibrated  data acquisition boards to the sound card in  your  computer.    Spike  Hound allows  for  signal  visualization,  real‐time  filter  applications,  audio output, and data  logging with meta‐data. 

Spike  Hound  replaces  and exceeds  the  functionality of  several classical  bench‐top  tools  including the  oscilloscope  and  arbitrary function  generator.    Spike  Hound offers  many  powerful  features  for scientific  visualization  with  a  user friendly  interface  developed  in  a feedback process with neurophysiology researchers and students at the university level. 

This software is written in the Matlab® scientific programming environment, but is compiled as a stand‐alone program (Windows ONLY) and does not require a Matlab® license.    As  such,  it  supports  all  of  the  hardware  supported  by  the  Matlab  Data Acquisition Toolbox®.  

  

Page 3: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

3

Contents  

1. Installation & Supported Hardware  4 1.1. Sound Card, Parallel Port  4 1.2. Custom Adaptors from Other Vendors  4 

   2. Connecting to Input Hardware, Visualizing, & Recording Data  5 

2.1. Selecting an Input Device  5 2.2. Adding Channels  5 2.3. Visualizing Data  5 

2.3.1. Zooming, Offsetting, Listening to & Pausing a Channel  5 2.4. Time Controls (Sampling Rate, Sweep Width, & Trigger Modes)  7 2.5. Recording Data  8 2.6. Experiment Meta‐Data Notes  8 2.7. Saving/Loading a Scope Session  9 2.8. Advanced Input & Visualization Controls   9 2.9. NIDAQ Signal Routing  10 

   3. Stimulus Generation  11 

3.1. Connecting to an Output Device  11 3.2. Configuring the Output Interface  11 3.3. Pulse Train Generation  11 

3.3.1. Manually Configured Constant Amplitude  11 3.3.2. Script Driven Variable Amplitude/Duration  12 

3.4. Component Function Generator  13    4. Digital I/O  14 

4.1. Connecting to a Device  14 4.2. Adding a Line or Port In/Out  14 4.3. Configuring & Logging Digital Data  15 4.4. Synchronizing with Raw Analog Data Logging, Digital Data Format  15 

   5. Live Signal Conditioning, Event Detection & Analysis  16 

5.1. Connecting to a Signal Source  16 5.2. Fourier Spectrum & Spectrogram  17 5.3. Low & High Pass Filters, Notch Filters  17 5.4. Two Level Thresholding & Event Detection  18 

5.4.1. Invert, Rectify, Window Center & Width  18 5.5. Event Analysis Parameters  19 5.6. Thresholding Within the Analysis Space  19 

   6. Multi‐Channel Correlation (Event Triggered Average)  20 

6.1. Selecting a Target  20 6.2. Trigger Location, Correlation Center, Display Configuration  20 6.3. Correlation Auto‐Reset  21 

Page 4: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

4

Installation Three Easy Steps to Your Spike Hound Installation  

1. Install the Matlab Component Runtimes version 7.7 (MCRInstaller.exe) 2. Install the LabView Run‐time Engine version 7.1 (LVRunTimeEng.exe) 

This step may be skipped  if you do not wish to run the NIDAQ signal routing algorithm in the advanced menu 

3. Unzip  spikeHound.exe  &  spikeHound.ctf  into  a  directory.    Double  click spikeHound.exe 

You  may  create  a  shortcut  to  spikeHound.exe  and  place  that anywhere on your computer (such as your desktop) 

 

Supported Hardware Spike Hound supports all hardware supported by the Matlab Data Acquisition Toolbox as of version 2.11.  Supported hardware includes data acquisition systems from: Acqiris, ADLINK, Advantech, Agilent, CONTEC, Data Translation, g.tec,  IOTech, Keithley Instruments,  Measurement  Computing,  National  Instruments,  United  Electronic Industries, VXI Technology  Sound Card, Parallel Port In addition to the above vendors, Spike Hound supports Analog Input and Output using the Windows sound card interface for the sound card in your computer.  Modern sound cards  are  remarkably  efficient  and  many  extend  to  sampling  rates  at  ultrasonic frequencies  allowing  for  many  applications  in  research/educational  physiology  for virtually no cost.  Caveats to remember are that most sound cards have a relatively high (5+kHz) lowest possible sampling rate and they are generally AC‐coupled inputs (no DC signals) with  uncharacterized  input  filters.    But  the  “volume”  controls  act  as  a  pre‐amplifier  for  your  signal  and  any differential  voltage  can be  fed  into  the microphone port via a mini‐phono connector to  interface a data source with your computer for no extra cost.  The parallel port on many modern computers may also be used as a digital I/O interface.  Custom Adaptors from Other Vendors If your hardware  is not natively supported by the data acquisition toolbox, the vendor may write a Matlab data acquisition adaptor which allows Spike Hound to interface with the device.  Your vendor may offer this with the hardware they provide.  If your vendor provides a data acquisition toolbox adaptor for Matlab, simply drop the adaptor DLL file into the Spike Hound directory and Spike Hound will automatically detect and register it at start‐up.   Details on custom adaptor authoring are provided by Matlab and  require advanced  programming  skills.

Page 5: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

5

Connecting to Input Hardware Selecting an Input Device When  Spike  Hound  initializes,  it  will  scan  your computer  for  available  data  acquisition  devices  and create an  interface  list  in  the “Input” menu.   Devices will be separated into categories by vendor/driver and the currently selected  interface will have a check next to its name. If the input device you connect to also has the capacity to generate analog signals, you will be prompted  to  connect  to  the device’s output  for  the  stimulus/signal generation features offered by Spike Hound.  Adding Channels Below  the main  scope window  is  the  “Available  Channels”  section  of  the  interface controls.    If  it  is not displayed, click  the “Chan”  select button at  the  lower  left of  the green scope window.  You may give the channel a name or simply click the add button and a name will be generated for you.  The color for the display trace for your channel may be modified by clicking  the button  labeled “Color” before adding  the channel  to your  scope.    In  order  to  change  the  name  or  color  of  a  trace,  the  channel must  be removed and re‐added with the new properties.  

  

Visualizing Data in the Main Scope Scaling and Placing a channel in the Scope Any  channel  in  the  scope window may be moved  for parallel visualization with other channels and  it may be scaled  in order to visualize  larger or smaller signals.     You may only modify one channel at a time and that channel must be selected by clicking on it in the “Active Channels”  interface panel.   The Channel Display Controls  for the currently selected channel will appear to the right of the “Active Channels” interface box. 

 

Zoom  in/out  on  a  single  channel  by  scrolling  the mouse wheel  or  selecting  a value in the “Volts per Division” select box 

Move a Channel vertically  in  the  scope by clicking on  the channel’s name and dragging it vertically. 

Subtract  DC  Visually  from  a  signal  to  remove  DC  offsets  such  as  resting potentials for visualization only. 

External Gain may be specified and the trace in the scope window will be scaled to demonstrate a pre‐amplification level for your signal. 

Page 6: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

6

ADC Input Range corresponds to the preamplifier settings in the ADC board you are connected to.  Setting this range determines the max and min voltages that may be converted.  This setting controls the quantization level for your system. 

 Listening to a Channel on Your Computer Speakers You may attempt  to output  the channel as audio on your system’s sound card  (i.e.  in order to hear spikes or other signal content of interest).  Simply click the “Listen” check‐box  in  the “Active Channels”  interface panel and Spike Hound will attempt  to output the channel as audio on your system sound card.   Select a different channel and spike hound will automatically switch the audio output to your computer speakers. 

Volume  on  the  “Listen”  audio  output  is  proportional  to  the  signal  size  in  the scope window.   Max  volume  on  your  speakers  corresponds  to  the  full  range  of  the current scope for that channel.  So if your scope was set to 1V per division, any signals above 5V would be clipped on your speakers.  Remember that you can further increase volume  on  your  speakers  (the  volume  knob)  or  in  the Windows  sound  configuration utility. 

There may be problems with generation if your sound card does not support the same sample rate as your data acquisition device.  You may hear a popping sound as the software generates a signal at a different rate  from which  it  is acquiring the data.   No interpolation was  implemented  (in order  to match  sample  rates) due  to  computation overhead.    If you have  issues with  this, and you want a  smoother  sound output,  it  is recommended  that  you  acquiring  using  standard  sound  card  sampling  rates  such  as 11025 and 22050 and 44100 Hz.  Pausing & Visualizing a Channel If  you  wish  to  pause  a  streaming  channel  in order to capture what  is currently displayed on your scope or  to assist  in visualizing your data, click the gray “Pause” button in the upper right of the scope window.  This same feature is available in the Live Data Analysis tools. 

If  you wish  to  save  the  raw  scope  contents  to  a Matlab  (.mat)  file,  select  the green “.MAT” button in the upper right of the scope window.  This is different than the data  logging  features  and  only  applies  to  the  current  scope  contents.    For  raw  data logging, the Spike Hound recording features should be used. 

You may also extract the contents of the scope window to a separate figure for comparison  or  to  export  to  a  graphics  file  such  as  a  JPEG  or  TIFF  using  the maroon square button.  All trace windows have a maroon button that can be used to export the trace contents to a window for export/comparison. 

 

Right  Click  the maroon  button  to  send  the  data  to  an  active  extraction window for multiple trace overlay. 

Click  the  Rainbow  button  in  the  extracted  figure  to  open  up  a  property editor for the extracted trace and the axis that contains  it.   You can modify trace color, width, and data markers to generate publication quality graphics. 

Page 7: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

7

 Time Controls – Sample Rate and Sweep Width Sample  rate  and  sweep  width  is controlled  for all  input channels  from the  “Time”  interface  panel.    Simply modify  the values here to change  the scope display.   An unsupported value will  be  replaced  with  the  nearest available  sample  rate  for  your interface device.  Trigger Modes There are several trigger modes for the input interface in Spike Hound just as you would find in a modern digital oscilloscope. 

 1. Continuous 

This mode simply streams data continuously into the scope and is supported by all input interfaces. 

2. Manual Manual  trigger  mode  will  acquire  one  “full  span”  of  input  data  upon  a manual click of the “Trigger” button in the “Trigger” interface panel 

3. Channel Software  Level based  triggering.    Select a  channel  source  from  the pop‐up menu and either enter a voltage  level or drag the threshold bar  in the main scope  window  to  select  a  trigger  level.   When  the  voltage  on  the  input channel passes that level, a single “Full Span” of input data will be acquired. 

4. External (HWDigital) Supported by several National  Instruments  (NIDAQmx) Devices, a hardware pin can be used to trigger a “full span” sweep on a TTL pulse (5V).  Generally, the default external  trigger  is PFI0 and may be  set  in  the NIDAQ advanced configuration tools in Spike Hound. 

5. Stimulus (Software) If you don’t wish to devote a channel to a trigger signal or your board does not support the HWDigital trigger mode, this mode issues a software trigger whenever  a  pulse  train  is  triggered  from  the  “Pulse  Train  Stimulus Generation” output interface in Spike Hound. 

  Pre‐Trigger Data in Manual and Channel Trigger Modes In the upper left of the scope window is a “T” indicating the location of zero time.  Click and drag this T to place the zero time point in the scope window.  Upon acquisition of a manual or channel based sweep trigger, the scope will display pre‐trigger event data to allow you to visualize what preceded your trigger event.  

Page 8: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

8

Recording Data Data  Logging  in  Spike  Hound  streams  raw sampled data from your interface device to a file  on  your  hard  disk.    Regardless  of  your visualization  settings,  Spike  Hound  will stream  the  actual  voltage  levels  from  your interface to file.  1. Specify a File Name 

Click  the  “File Name…” button  in  the record controls interface and specify a file name.   No  file name  (other  than temp.daq)  will  ever  be  overwritten.  Iterated file names will be generated. The “Open Dir” button to the right of the file name select button will open the current directory  in windows explorer so you may modify files that you are  logging without having to search down to that directory manually.  

2. Select a Trigger Mode See Previous Section on  trigger modes.   Any  trigger mode  is  supported during data logging.  A single file will log several trigger events and you must manually stop the recording in any mode other than continuous.  If a fixed duration is set, continuous  triggering  will  end  the  acquisition  session  at  the  end  of  the  set elapsed time.   Any other trigger mode will acquire the “fixed duration” amount of data after each trigger and the session must be manually ended.  

3. Select a Record Duration You may  record  indefinitely  (until you manually  stop  the  recording or you  run out of disk) or you may  indicate a specific period of time (in seconds) to record and Spike Hound will stop after the specified time.  

4. Hit the “Record Start” Button That’s  all.    The  interface  will  prevent  specific  parameter  changes  (gray  out) during  logging, but channel visualization will be available.   Note  that “Subtract DC” and “External Gain” visualization data will NOT be logged to file. 

 Experiment Meta‐Data Notepad The “Metadata” button  in  the “Record”  interface panel will open an editable notepad style text box that allows for information to be logged with your saved data.  This is an ideal place  to  enter  experiment parameters  associated with  your  specific experiment run.  If the metadata pad has contents when you hit the record button, this information will be stored in a text file with the same name as your save data file combined with the “_info” extension. 

Page 9: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

9

 Saving a Scope Connection State Once  you  have  several  channels  added  to  your  interface  and  a  variety  of  setup parameters  in place, you may wish  to save  this state  information  for  loading  the next time you open Spike Hound. 

 

Save Current Scope State using the option in the “Advanced” menu  The scope state saved in file name “default.mat” will automatically load when you open Spike Hound.   Any other saved state may be  loaded  from  the “Advanced” drop down menu at the top of the scope window.  Load a Scope Connection State As with  state  saving,  any  saved  connection  state may  be manually  loaded  using  the option in the “Advanced” drop down menu.  

Advanced Input & Display Controls Input Configuration There are many advanced control parameters that the user may modify beyond the basics generally used in every-day recording. Many of these options may be accessed from the “Input Cfg” button at the bottom left of the main scope window.

Input Type – Modify the state of your board input channels. Generally this allows for “single ended” or “differential” recording modes supported by your specific system.

Input Clock Source – Bypass the “sample rate” property for the board input and use an external clock source to control your system’s sample rate. For NIDAQ boards (in next section), this external clock signal is provided on the “InExternalXXXClockSource” Channel configurable from the NIDAQ controls.

Channel Skew – This refers to the rate at which the system jumps between channels in a multiplexed acquisition system. For non-simultaneous sample boards, an internal multiplexer rapidly jumps between input channels to convert the voltage levels. The Skew determines the time between jumps and relates to sub-sample phase measurements. Generally you will use either “minimum” (requires calibration for accurate phase measurements at frequencies near the nyquist) or “equisample” which divides the steps up evenly within the sample period.

NIDAQ Specific Conifgurations For National Instruments ® data acquisition systems, Spike Hound offers many specific controls for board systems. Internal clock rates may be linked to an external source pin on the National Instruments interface.

Page 10: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

10

InHwDigitalTriggerSource – This parameter sets the source line for “External (HWDigital)” trigger mode. The line set here will initiate a sweep trigger upon a TTL low to high transition.

InExternalSampleClockSource – Sets the pin used to control the sampling of individual channels in a single scan of all channels on a non-simultaneous sample system (see Channel Skew in previous section). (Must set “Input Clock Source” parameter to external)

InExternalScanClockSource – Sets the input pin to drive a single sample acquisition from all connected channels. For example, link the output clock signal to this pin to synchronize stimulus presentation with data acquisition on a sample per sample basis. (Must set “Input Clock Source” parameter to external)

NIDAQ Signal Routing Spike Hound offers a feature not currently available in the Matlab Data Acquisition Toolbox®. You may access the full signal routing features of the National Instruments DAQ boards to link any number of clock signals to external pins to synchronize a single board or to connect clock signals between multiple systems running Spike Hound or other data acquisition software. The “NI DAQmx signal routing” interface is accessible through the option of the same name in the “Advanced” drop down menu in the main scope figure. You may select any input channel available for your system and rout it to any target pin on any other system supported. You may also disconnect a previously established connection. There is no way to poll the state of internal connections, so you must manually track connection states internal to your board as you apply them. These internal connection states will not be saved using the state saving option in the advanced menu. Advanced Graphics Controls In addition to advanced input configuration, visualization of input channels may be optimized for your system using hardware acceleration and the scope may be extracted for full screen visualization.

Full Screen Scope Mode – Selecting this option from the “Advanced” menu will extract the scope portion of the active channels into its own window which can be maximized to fill your computer screen for visualization.

Measure off Active Trace – This option allows for a line to be drawn on the scope between two points giving a rough estimate of waveform size parameters. Just select this option and click and drag on the scope window to measure.

Graphics Acceleration – This advanced control allows for graphics rendering to be offloaded to your PC video card using OpenGL rendering where supported. This drop down menu lists all available graphics acceleration settings for your system. Note that if you select hardware graphics acceleration, the overlay may only work on your main monitor (not a secondary monitor). This may allow for visualization of many more channels with less software strain.

Page 11: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

11

Stimulus Generation  Connecting to an Output interface If you did not automatically connect to an output interface when you connected to your input hardware, you may select your output interface in an identical manner to input selection using the “Output” drop down menu in the main scope figure. The currently selected interface will have a check mark next to it. Output Interface Configuration Once connected, a variety of configuration parameters are available to Spike Hound. They are accessible from the “Signal Generation” control interface through the “Output” button to the bottom left of the main scope window.

Sample Rate – The sample rate may be configured for your output device just as with the input interface.

Output Range – Defines the quantization level for your specific board as well as the maximum and minimum voltage values your system is capable of generating.

Clock Source – As with the input interface control, this parameter allows you to set an external clock source for your signal generation (bypassing the sample rate property). Output clock source is configurable for NIDAQ systems using the “OutExternalClockSource” property in the NIDAQ Configuration panel.

In this configuration panel, you may also access the Pulse Train Generation or Component Function Generator subsystems in Spike Hound. Stimulus Pulse Train Generator Spike Hound offers a graphical signal generation system that allows for the production of stimulus pulse trains useful for a variety of physiological experiments in electrophysiology including voltage clamp current measurements and cell/synapse potentiation studies using rapidly repeated stimulus.

The pulse train interface allows for single shot or repeated stimuli to be constructed or for arbitrary pulse trains with varying amplitudes to be loaded from a script file. Manually Configured Constant Amplitude Pulse Train Generation

o By selecting the “One Pulse,” “Two Pulses,” or “Tetanic” stimulus options, the user may generate a series of pulses on a single output channel of their output interface.

Page 12: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

12

o This mode requires two output channels available on the output subsystem.

The first channel (generally channel 0) contains the pulse train and the second channel contains a short TTL trigger pulse that may be used to synchronize a variety of systems with the stimulus waveform.

o Waveform shape controls include: Pulse Duration – Global pulse width for all pulses Delay 1 – Delay from TTL Trigger before initiation of pulse 1 Delay 2 – Delay from initiation of pulse 1 to initiation of pulse 2 Tetanus Duration – Length of time to present a tetanic pulse train Tetanus Interval – Delay between initiation of tetanus pulses Delay 3 – Delay between final tetanic pulse and post-tetanic pulse Amplitude – Constant amplitude for all pulses

o The generated pulse train may be triggered in a single shot via the “Trigger”

button in the Stimulus interface or the system will loop the stimulus indefinitely on a repeat interval defined in the stimulus subsystem.

Script Driven Variable Amplitude Pulse Train Generation Complex pulse trains with varying amplitudes and durations may be generated through a scripting language interface described below and should be saved as “.txt” files

#Spike Hound example stimulus script file for arbitrary pulse generation #Comments preceded by "#" #Stimulus output will default to zero at all time regions not specified #format is amplitude in volts, initiation time (sec), duration (sec), #if TTL trigger pulse (2nd channel) is issued at beginning of interval (1 or 0) 0.1,0.1,0.01,1 0.2,0.2,0.05,1 0.3,0.3,0.05,1 0.4,0.4,0.05,1 0.5,0.4,0.05,1 0.6,0.5,0.05,1 0.7,0.6,0.5,1 0.8,1.2,0.05,1 0.9,1.8,0.05,1 1.0,1.9,0.5,1 0.0,2.0,1.00,1 #any comment will be ignored when the file is loaded. #Any blank line spaces will be ignored.

Page 13: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

13

Arbitrary Component Function Generator Spike Hound offers a powerful multi-component function generator for signal generation, testing, and system calibration.

The function generator allows for the construction of a multi-component signal and for generation and modification of component parameters in streaming mode. The component signal is generated as the signal is being continuously fed to the output subsystem allowing for a smooth multi-frequency signal with no popping at loop edges for true white noise application and for seamless component parameter modification while running. Functions Available:

Sine Wave, Square Wave, Triangle Wave, White Noise, Global DC Offset Creating a Component Function

Adding Components A function may be pieced together by selecting a function type from the drop down menu and clicking the “Add” button.

This will create a signal component and add it to your current function. Selecting that function name in the list box will bring up the parameter controls for that function. The parameter controls display the signal as if it were generated on a “sample and hold” analog output system (this is how most signal generators work). You will be able to see digitization levels increase in size as the frequency of the signal approaches half of your system’s sample rate (the Nyquist rate). Increasing the system output rate will create smoother signals.

Removing Components

Individual elements may be removed from your component signal by selecting them in the component list box and clicking the remove button. The entire interface may be reset by selecting the “clear all” interface.

Generating the Signal The component function may be generated by clicking the “Generate Signal” button in the function generator control panel under the display trace of the component signal.

The subsystem generates a signal in real time, so if the computer is overloaded with other tasks, the signal generation may not keep up with function outputting and the system might stop. Simply reactivate the function generator to restart output. This

Page 14: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

14

should only happen in extreme processor loading cases. This behavior is necessary to prevent edge popping from different frequencies in the component signal and for individual parameter modification within the signal in semi-real-time.

Digital I/O In addition to analog input and output subsystems, Spike Hound gives the user full access to software logged digital input lines for experiment control, process synchronization, and data collection. Digital I/O configuration is accessed via the “Digital IO” button to the bottom left of the main scope window. Spike Hound does not currently offer support for clocked digital I/O (available on systems such as the National Instruments “M-series” DAQ boards) for high bandwidth communications protocols, but this is slated for a future Spike Hound release.

Connecting to a Device In the pop-up menu in the Digital I/O subsystem control panel, the user has access to any supported interface for software driven digital line states. Connect to the selected Digital I/O interface by clicking the “Connect” button. Adding a Line or Port Digital I/O systems are broken into ports with a common “data direction” amongst all lines within that port. Port direction support is listed in the “Entire Port” option in the line selection drop down list or the “In” and “Out” buttons will be active based on support of a single selected channel.

Select either an entire port or a single line and select a data direction by clicking on the “In” or “Out” button to the right of the line selection pop-up menu. This will activate the Digital I/O subsystem and generate graphical buttons indicating line state for an individual port pin (red = 1, grey = 0).

The state of the input port pins are updated graphically every 100ms (10Hz) and the output pin is updated immediately upon pressing the associated button. The port/line label on input pins is grayed and the buttons are not modifiable by the user while output pin label text is black and the buttons are clickable to change port parameters.

Page 15: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

15

Configuring and Logging Data The user may log digital data in synchronization with analog input data logging and they may furthermore choose to log only changes in digital port states. It should be noted that this logging is entirely software driven and as such will not create as periodic of a data structure as with the hardware clocked analog-input subsystems. Time stamps, however, are saved for each logged value providing you with an accurate time reference relative to your logged analog data.

Note that log frequencies greater than 100Hz will begin to be limited due to operating system lag and other processing on your system. Spike Hound will attempt to reach your target sample rate, but in any case, time stamps in the logged data file should always be used to measure sample times.

Select a Log Rate

o Set a recording rate in the indicated box below the port selection pop-up menu.

Select a Log File o Set a log target file-name by clicking the button to the right of the log rate

input box. If you are linking your digital data logging with analog input recording, this parameter will be automatically overwritten with a file name based on your recording file name included with an “_dio” extension much as the meta-data is stored.

Log Changes Only o The user may only be interested in locations where digital data changed on

the input ports and selecting this parameter will log ONLY data to file if the current state is different from the previous state in any way. This eliminates much redundancy in digital data.

Link with Recording o As mentioned previously, this option allows the user to software

synchronize analog data logging with digital data logging. Digital Data Format Data is stored in a column based format. The first line is a Matlab clock vector indicating absolute data and time of data acquisition initiation and the subsequent lines represent elapsed time followed by the state of each port in the order in which they were added. Example File Logged at 50Hz: 2008 1 2 11 52 54.671 0.18800 0 1 1 1 0 1 1 1 0 0 0 1 0 0 1 0 0.20400 1 1 1 1 0 1 1 1 0 0 0 1 0 0 1 0 0.23500 0 0 0 0 1 1 1 1 0 0 0 1 0 0 1 0 0.25000 0 1 0 0 1 1 1 1 0 0 0 1 0 0 1 0 0.26600 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 0 0.28200 0 0 1 0 1 1 1 1 0 0 0 1 0 0 1 0 0.31300 1 0 1 0 1 1 1 1 0 0 0 1 0 0 1 0 0.32900 1 1 1 0 1 1 1 1 0 0 0 1 0 0 1 0 0.36000 0 0 0 1 1 1 1 1 0 0 0 1 0 0 1 0 0.37500 1 0 0 1 1 1 1 1 0 0 0 1 0 0 1 0

Page 16: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

16

Live Signal Conditioning Spike Hound enables a wide variety of real-time signal conditioning tools for data visualization. These tools are accessed via the “Live Data Analysis” button in the upper right of the main scope window. This spawns a new figure containing all analysis tools and decoupled from the data logging features (i.e. data logging will only ever stream raw samples to file and not filtered data).

These tools are designed to assist in experiment setup and control. For example, you might advance a recording electrode into electrically active tissue and monitor spike behavior or time correlated spikes to a given reference event in order to determine location in tissue. Connecting & Visualizing a Signal Source Select the raw channel from the “Select Channel” drop down menu in the analysis window. The currently selected channel is automatically activated when the analysis features are opened. You may have any number of instances of the same channel open for application of different filters or for visualization on different zoom or time scales.

Zoom on a trace using the mouse wheel or by selecting a “voltage range” from the pop up menu

Move a trace vertically in the display window by grabbing the “+” overlaying the left end of the trace and dragging it with the mouse

Increase the time width of a trace by selecting a value in the “time scale” pop-up menu under the trace.

Pause trace display by activating the pause button in the upper right of the yellow analysis menu

Listen to the filtered signal by clicking the “Listen” button in the upper right of the yellow analysis panel. This will output the band pass filtered signal to the sound card just as the “Listen” feature in the main scope display

Remove the Analyzed Channel by clicking the “x” button in the upper right of the yellow panel

Resize the Analysis Window just as you would any window figure to increase visualization area for individual channels

Page 17: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

17

Fourier Spectrum and Spectrogram Spike Hound, offers tools for frequency spectrum visualization of analyzed signals. Both a 50ms window sweep FFT (Fast Fourier Transform) and 50ms window by 5 second width spectrogram are available for spectral visualization of these signals. In the following example figures, the Spike Hound function generator was used to generate sine waves at three frequencies (500, 1200, & 2400Hz) along with background noise. Note that frequency is displayed on the vertical axis in the spectrogram and on the horizontal axis for the FFT. Activating frequency display modes deactivates any active analysis or correlation activity (settings will remain). Access the Fourier Spectrum visualization tools through the “Spectrogram” and “FFT” buttons in the bottom left of each active channel analysis area.

Applying Built-In Filters Spike Hound offers several built-in fixed frequency filters (third order “Butterworth” high and low pass filters). Access these filters (along with many analysis settings) from a context menu by right clicking the axis containing the data trace.

In future versions, available filters will be user configurable and the user will have the ability to construct custom filters.

In addition to the low and high pass filters, there is a -6dB IIR notch filter set at 60Hz with a Q-factor of 15. This is useful for removing line noise from 60Hz power systems such as those found in the US.

The total spectrum of applied filters (amplitude and phase) may be visualized from the context menu as well using the “Display Total Filter Spectrum” option. This will create a window containing a plot of the amplitude response of your current filter settings.

Page 18: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

18

Threshold Based Event Detection Window based event detection is implemented in Spike Hound in order to assist in identification of signals of interest. A fixed threshold level is set, and when the signal level exceeds this threshold, an event is detected. A window of time is blocked off around the threshold cross and both pre and post event data are gathered and analyzed. These events can be further limited by a second amplitude level threshold or separate result based thresholds in both Energy Density and Peak Frequency spaces. Resulting events can be visualized or used as triggers for a spike triggered cross correlation between the current channel and any analyzed or raw signal trace available in the Spike Hound space.

Setting a Threshold & Detecting Events Activate a threshold by clicking the “Threshold 1” or “Threshold 2” check boxes under the data trace. A black threshold line will appear in the analysis trace window and may be dragged vertically relative to the trace. Spike Hound will automatically detect if your threshold is placed below or above the mean value of the trace and use this information to cast the detection limit in the negative or positive going direction. Add a second threshold to reject events which exceed this second level. Defining a Window Width and Center Location The width of the detection window may be set in the “Window” box underneath the data trace. This defines the width of the red event overlay window. This window value will define the minimum distance between detected events. In order to capture data both before and after a threshold cross (i.e. to acquire full waveform shape), a window center may be set at discrete positions relative to the threshold. The window center option is accessible from the context menu acquired by right clicking within the data display axis. The user may select from four window center values: 0%, 25%, 50%, and 75%. This places the threshold cross at a fixed percent distance into the window. If the user were to select 25% window center and a window width of 10ms, when an event was detected, Spike Hound would capture 2.5ms before the event and 7.5ms after the event. Spike Hound would also detect a second event following the currently detected event a minimum of 7.5ms after the current threshold cross. The data trace may also be inverted (180 degree phase shift) or it may be rectified (does not visually appear) in order to detect both positive and negative going threshold

Page 19: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

19

crosses with a single threshold level. These options are available in the context menu below the filter parameters. Analysis Parameters for Individual Events Spike Hound offers 7 different analysis parameters for visualization in a two dimensional space. These values are selectable from drop down menus to the right of the analysis axis (activated via the “Analysis” button in the bottom right of the channel analysis panel.

Available analysis parameters for each axis include:

Event Time – The time of the event threshold crossing Rate/Interval – The inter-event rate and interval Max/Min – Maximum and minimum voltage amplitude in the window region Peak FFT Component – Maximum frequency component of the Fourier

transform of the event window. This is generally proportional to spike width or signal derivative. Faster spikes will score higher on this axis.

Energy Density – A much cleaner amplitude measurement than “Max” or “Min” value. This represents the sum of the amplitude components of the FFT divided by the number of points in the window. This produces a relatively constant term for noise sources in the signal as long as the noise is identical from window to window.

Analysis Parameter Thresholding Events may be further rejected by setting threshold levels in both Energy Density and Peak Frequency spaces in the analysis window. Activate an energy threshold by selecting Energy Density or Peak frequency for the “Y-Axis Metric” in the analysis display and clicking the “parameter Threshold” checkbox in the upper right of the analysis area. This will activate two dragable traces in the current analysis window that you can use to set. Thresholding in peak frequency space may be useful, for example, to reject slower spikes and accept faster spikes even if the faster spike amplitude exceeds that of the slower spike or if the amplitude of spikes is changing through the recording while maintaining a constant pulse width. Thresholding in energy density space is a way of cleanly separating similar amplitude spikes who’s amplitudes are difficult to separate through simple amplitude thresholding due to noise sources (ED is a relative noise free amplitude measurement).

Page 20: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

20

Multi‐Channel Correlation (Event Triggered Average) Spike Hound allows for comparison of event timing between two signal sources or within a single signal source. Events that are detected may be used to generate a running average of a window on a separate channel. Over time, uncorrelated signal sources will average to zero and correlated events will rise out of the noise. This tool is an extremely powerful component of the Spike Hound arsenal allowing for cross-channel correlation with any set of active signals (analyzed or raw scope traces) in the Spike Hound space.

Illustrated in this figure is the analysis of data from an intracellular electrode (bottom) in a muscle and an extracellular electrode (top) attached to a nerve bundle innervating the muscle. The detected spikes are cross correlated for a spike triggered average yielding an image of a compound post synaptic potential (top center) and two or three distinct amplitude classes of spikes are clear (top right).

Selecting a Target Activate the Correlation mode by clicking the “Correlation” button in the bottom of the yellow analysis channel panel. Right click the correlation axis to activate a control context menu in order to add and modify traces.

Activate Channel – Select this channel to activate a cross correlation trace with any signal (filtered or raw) in the current Spike Hound space.

Trigger Location – The user may choose to activate the correlation sweep off of the threshold crossing time point, the time point of the maximum amplitude of the signal, or the time point of the minimum amplitude of the signal. This

Page 21: Data Acquisition for Applications in ... - Spike Hound v1spikehound.sourceforge.net/Doc/SpikeHound-v1p2b-Manual.pdf · Spike Hound v1.2 Open Source Release Gus K Lott III, PhD 3 Contents

Spike Hound v1.2 Open Source Release Gus K Lott III, PhD

21

functionality is useful to center your time correlation on an event with a changing amplitude. Selecting “max amplitude” creates a much more stable time reference if the signal amplitude is changing (thus causing a different threshold cross time for subsequent signals).

Center Window on Event – This option does just as it says. The correlation window (specified in the “window” editable text field under the correlation trace) is centered on the event target point specified in the “trigger location” field. This allows the user to see activity that may be time correlated with past events.

Hide Text Labels – Removes the text label from the correlation field display if it covers a portion of the signal of interest.

Change Trace Color – Right click on the text label for a given trace to activate a dialog that will change the trace color to separate correlation traces

Zoom Correlation Traces – Use the mouse scroll wheel to zoom in on active correlation traces all at once

Move Correlation Traces Vertically – Click the trace text label and drag it vertically in the correlation axis to offset it relative to the other traces.

Auto-Reset Correlation Traces In addition to manually resetting trace correlation, the user may specify a time period for trace resetting. This may be useful if the user is seeking within a target tissue for signals of interest and does not wish to free a hand to manually click the correlation reset option. Setting a correlation time here will allow the user to just watch the screen in a given location for results and then move to the next area if none are detected. Setting the correlation reset to a zero or negative value will deactivate the auto-reset feature. %EOF