Skip to content

SONGetADCMarkerChannel

  SONGETADCMARKERCHANNEL reads an ADCMark channel from a SON file.

  [DATA {, HEADER}]=SONGETADCMARKERCHANNEL(FID, CHAN{, START{, STOP{, OPTIONS}}})
  FID is the matlab file handle, CHAN is the channel number (1=max)

  [DATA, HEADER]=SONGETADCMARKERCHANNEL(FID, 1{, OPTIONS})
        reads all the data on channel 1
  [DATA, HEADER]=SONGETADCMARKERCHANNEL(FID, 1, 10{, OPTIONS})
        reads disc block 10 for continuous data or epoch 10 for triggered
        data
  [DATA, HEADER]=SONGETADCMARKERCHANNEL(FID, 1, 10, 20{, OPTIONS})
        reads disc blocks 10-20

  DATA is a structure with 3 fields.
        DATA.TIMINGS contains timestamps
        DATA.MARKERS contains 4 uint8 marker values for each event
        DATA.ADC contains the ADC data associated with each timestamp

  When present, OPTIONS must be the last input argument. Valid options
  are:
  'ticks', 'microseconds', 'milliseconds' and 'seconds' cause times to
     be scaled to the appropriate unit (seconds by default)in HEADER
  'scale' - calls SONADCToDouble to apply the channel scale and offset to
     DATA.ADC which will  be cast to double precision
  'progress' - causes a progress bar to be displayed during the read.

  Returns the signed 16 bit integer ADC values in DATA.ADC (scaled, offset and
  cast to double if 'scale' is used as an option). If present, HEADER
  will be returned with the channel header information from the file.

  Example:
  options={'scale' 'microseconds'}
  [data, header]=SONGetADCMarkerChannel(fid, 1, 20, 40, options{:})
     reads blocks 20-40 from channel 1 and displays a progress bar.
    Timestamps in data.timings wil be in microseconds
    data.adc will be returned in double-precision floating point after
    scaling and applying the offset stored on disc via SONADCToDouble.

  in this case HEADER could have the following example field values
           FileName: 'c:\matlab704\work\02feb00.smr'
              system: 'SON4'
         FileChannel: 3
             phyChan: -1
                kind: 6
             npoints: 9273
              values: 100
             preTrig: 10
             comment: 'No comment'
               title: 'Memory'
      sampleinterval: 2.0000e-004
               scale: 1
              offset: 0
               units: ' volt'
          interleave: []
           TimeUnits: 'microseconds'
              Epochs: {[20]  [40]  'of'  [95]  'blocks'}
           transpose: 0

  Malcolm Lidierth 02/02
  Updated 09/05 ML
  Copyright © The Author & King's College London 2002-2006