LoadTeac16File.ipf 11/14/98 Written by: James Prouty, ICS Igorian Chant Software http://www.europa.com/~jamesp/igorianChant.html Contributed by: Dr. Barry R. Dworkin Professor of Behavioral and Neuroscience Pennsylvania State University College of Medicine Hershey PA 17033 (USA) LoadTeac16File.ipf contains the LoadTeacFile() macro which reads data from a TEAC DAT 16-channel data recorder saved to a binary files by TEAC's "QuickVu" program (a PC program). The macro uses the GBLoadWave XOP to load channels 1..16 into waves named "wave0" ... "wave15". Amplitude calibration constants are not applied; the raw data is transferred into the waves and the sampling frequency is used to set their X scaling. The first channel of the recorder can be configured as an analog or digital channel; if digital is selected, be aware that the two least significant bits are used as a signalling mechanism and should be removed prior to analysis of that channel's data. The QuickVu file format includes a header which is described by the following C-language template (Intel byte ordering). The LoadTeacFile() macro stores the header values in variables and strings in the root:teacHeader data folder, using the same name as used in the header description. This procedure has been tested on the Macintosh version of Igor Pro 3.12, and should also work on the Windows 95/98/NT4 version as well. typedef struct{ // ASCII part char ascii[400]; // ASCII part // identifier and version number char eof; // end of file mark (0x1a) char ver; // version number // recorded time on the tape char year; // year of the date char month; // month of the date char day; // day of the date char hour; // hour of the time char minute; // minute of the time char second; // second of the time // recorded ID and counter unsigned short acounter; // A counter at recording started char id; // ID at recording started unsigned short pcounter; // P counter at recording started // recorded data informations char recCh[16]; // downloaded channel char mpx; // original mpx at recording time char speed; // tape speed (0:x1, 1:x2) unsigned short skip; // skip number to create data file unsigned long dtsize; // data size in word float sampF; // sampling frequency of the filed data // input range char iRange[16]; // input range for each // data file attribution char byte_swap; // flag for byte-swap char mask_low2; // flag for mask lower 2-bits char phase_corr; // flag for phase correction char dec_filter; // flag for decimation filter // dummy char dmy[51]; // dummy }NewQVHeader;