In file No file:

int dacConvertData (short* buf, float* data, int chnnum, int len)

Converts data arrays stored in channel format into DAC buffer format

Documentation

Converts data arrays stored in channel format into DAC buffer format. The DAC buffer must be of length (number of channels) * (number of data points). The buffer should be initialized to zero before the first call. The data array represents a single channel. Since the DAC requires the data sample-by-sample rather than channel-by-channel, the typical conversion operration is performed as follows:
    for (k = 0; k < len; k++) {
       val = floor (dac_conversion_factor * data[k]);
       if (fabs(val) >= dac_max) {
          buf[k * number_of_channels + chnnum] = 
                            (val > 0) ? dac_max : -dac_max;
       }
       else {
          buf[k * number_of_channels + chnnum] = (short) val;
       }
    }
    

Returns:
0 if successful, <0 otherwise
Parameters:
buf - data buffer for an epoch
data - Channel data array
chnnum - DAC channel number
len - length of data buffer
Author:
CP, June 99
See Also:
DAC API, Arbitrary Waveform Generator

alphabetic index hierarchy of classes


Please send questions and comments to sigg_d@ligo-wa.caltech.edu


generated by doc++