I am trying to capture the data from a Lecroy 12 bit oscilloscope using Matlab.
I create the visa object "scope", set the format length to "word" (16 bit) and then use "fread" to get the waveform data as 16 bit signed integers:
fwrite(scope,'comm_format Def9,word,bin'); % The only relevant thing here is the "word" setting
fwrite(scope,'C1:Wf?'); % This gets the waveform from channel 1 on the scope
[wf]=fread(scope,SampleSize,'int16');
The problem is that the data that is captured has 8-bit noise on it. I attached a picture that shows a zoomed in portion of the waveform. You can see there is a signal that would be the full 12 bit resolution of the scope, but there seem to be glitches occasionally that are digitized to 8 bits. These glitches do not appear on the scope, only on the captured data.
Here is my sample data:
Does anyone know what causes this and how I can correct it?