qub_idlstim.h.html mathcode2html   
 Source file:   qub_idlstim.h
 Converted:   Tue Apr 17 2012 at 11:03:38
 This documentation file will not reflect any later changes in the source file.

$$\phantom{******** If you see this on the webpage then the browser could not locate *********}$$
$$\phantom{******** jsMath/easy/load.js or the variable root is set wrong in this file *********}$$
$$\newcommand{\vector}[1]{\left[\begin{array}{c} #1 \end{array}\right]}$$ $$\newenvironment{matrix}{\left[\begin{array}{cccccccccc}} {\end{array}\right]}$$ $$\newcommand{\A}{{\cal A}}$$ $$\newcommand{\W}{{\cal W}}$$

/* Copyright 2008-2011 Research Foundation State University of New York   */

/* This file is part of QUB Express.                                      */

/* QUB Express is free software; you can redistribute it and/or modify    */
/* it under the terms of the GNU General Public License as published by   */
/* the Free Software Foundation, either version 3 of the License, or      */
/* (at your option) any later version.                                    */

/* QUB Express is distributed in the hope that it will be useful,         */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of         */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          */
/* GNU General Public License for more details.                           */

/* You should have received a copy of the GNU General Public License,     */
/* named LICENSE.txt, in the QUB Express program directory.  If not, see  */
/* <http://www.gnu.org/licenses/>.                                        */

#ifndef QUB_IDLSTIM_H
#define QUB_IDLSTIM_H

#include "qubfast.h"

#ifdef __cplusplus
extern "C" {
#endif

QUBFAST_API void*  qub_idlstim_create(double *amps, int amp_count, int add_deltas, double amp_delta, double min_dur_ms, double sampling_ms);
  // Returns a new stimulus idealizer.
  // @param amps: array of known stimulus levels
  // @param amp_count: number of known stimulus levels
  // @param add_deltas: nonzero if the idealizer can find new levels
  // @param amp_delta: minimum distance between added levels
  // @param min_dur_ms: events shorter than this will be joined to their neighbor
  // @param sampling_ms: sampling interval

QUBFAST_API void   qub_idlstim_destroy(void *idlstim);
  // Frees the resources used by a stimulus idealizer.

QUBFAST_API void   qub_idlstim_add(void *idlstim, float *samples, int count);
  // Feeds sampled data to a stimulus idealizer.

QUBFAST_API void   qub_idlstim_done_add(void *idlstim);
  // After you have added all data, prepares the stimulus idealizer for output (get_*())

QUBFAST_API int    qub_idlstim_get_amp_count(void *idlstim);
  // After done_add(), returns the number of distinct levels

QUBFAST_API int    qub_idlstim_get_amps(void *idlstim, double *amps);
  // After done_add(), fills in amps[:amp_count] with all the levels (idealization class amps)

QUBFAST_API int    qub_idlstim_get_next_dwells(void *idlstim, int offset_in_data, int sample_count,
					       int *firsts, int *lasts, int *classes, float *durations);
  // After done_add(), fills in the dwells corresponding to the next sample_count samples.
  // @param offset_in_data: offset of the first sample requested, in the data file
  // @param sample_count: length of data chunk, in samples
  // @param firsts: array[sample_count] to hold dwell first sample index
  // @param lasts: array[sample_count] to hold dwell last sample index
  // @param classes: array[sample_count] to hold dwell class index
  // @param durations: array[sample_count] to hold dwell duration [ms], or NULL



#ifdef __cplusplus
}
#endif

#endif