fin = fopen('03d19000.abf', 'r'); fdatin = fopen('output.dat', 'r'); %Actual number of ADC samples fseek(fin, 10, 'bof'); lActualAcqLength = fread(fin, 1, 'long'); %Block number of start of Data section fseek(fin, 40, 'bof'); lDataSectionPtr = fread(fin, 1, 'long'); %Interval between multiplexed A/D samples (µs) fseek(fin, 122, 'bof'); fADCSampleInterval = fread(fin, 1, 'float'); %Sampling frequency in Hz for channel 0 fSamplingFrequency = 1000000/(2 * fADCSampleInterval); %Number of points to grab lPointsToGrab = 10000000; %lPointsToGrab = lActualAcqLength/2; %Last Time in sec fLastTime = lPointsToGrab * 2 * fADCSampleInterval / 1000000; %Fetch two-byte multiplexed ADC values from output.dat fseek(fin, 0, 'bof'); fADCValues = fread(fdatin, lPointsToGrab, 'short'); format compact; fADCToUUFactor = 3.125e-008; fADCToUUShift = 0; fUUValue = fADCValues * fADCToUUFactor + fADCToUUShift; fclose(fin); fclose(fdatin); lActualAcqLength lDataSectionPtr fADCSampleInterval fSamplingFrequency fLastTime %index = 1:lPointsToGrab; %c = [index' fUUValue]; %sprintf('%15d %15e\n', c') %specgram(fUUValue,512,500)