Hi All,
I have a problem on an infiniium 54180 (yes a pretty old scope) that I was hoping to resolve. The scope has bandwidth of 500MHz and a sampling frequency of 1GS/s I'm new to using these scopes so I apologize if this is a simple question. However, I tried the programmer's guide but could not resolve the issue. My problem as clear in the title, is that I cannot read back the interpolated data from the scope, although I turn the interpolation filter on. Here's the MATLAB code that I am using (adapted from the code on file exchange in matlab central). visaObj is just the scope.
fprintf(visaObj,'*RST; :AUTOSCALE');
fprintf(visaObj,':STOP');
fprintf(visaObj,':WAVEFORM:SOURCE CHAN1');
fprintf(visaObj,':ACQUIRE:COUNT 8');
fprintf(visaObj,':ACQUIRE:COMPLETE 100');
fprintf(visaObj,':ACQUIRE:MODE INTERPOLATE');
fprintf(visaObj,:ACQUIRE:POINTS 1024);
% Now tell the instrument to digitize channel1
fprintf(visaObj,':DIGITIZE CHAN1');
% Wait till complete
operationComplete = str2double(query(visaObj,'*OPC?'));
while ~operationComplete
operationComplete = str2double(query(visaObj,'*OPC?'));
end
fprintf(visaObj,':WAVEFORM:FORMAT WORD');
fprintf(visaObj,':WAVEFORM:BYTEORDER LSBFirst');
preambleBlock = query(visaObj,':WAVEFORM:PREAMBLE?');
fprintf(visaObj,':WAV:DATA?');
waveform.RawData = binblockread(visaObj,'int16'); fread(visaObj,1);
%fprintf(visaObj,':CHANNEL1:DISPLAY ON');
% process data
% store all this information into a waveform structure for later use
preambleBlock = regexp(preambleBlock,',','split');
waveform.Points = str2double(preambleBlock{3});
waveform.XOrigin = str2double(preambleBlock{6}); % in seconds
waveform.XReference = str2double(preambleBlock{7});
waveform.YIncrement = str2double(preambleBlock{8}); % V
waveform.YOrigin = str2double(preambleBlock{9});
waveform.YReference = str2double(preambleBlock{10});
waveform.VoltsPerDiv = (maxVal * waveform.YIncrement / 8); % V
waveform.Offset = ((maxVal/2 - waveform.YReference) * waveform.YIncrement + waveform.YOrigin); % V
waveform.SecPerDiv = waveform.Points * waveform.XIncrement/10 ; % seconds
waveform.Delay = ((waveform.Points/2 - waveform.XReference) * waveform.XIncrement + waveform.XOrigin); % seconds
% Generate X & Y Data
waveform.XData = (waveform.XIncrement.*(1:length(waveform.RawData))) - waveform.XIncrement;
waveform.YData = (waveform.YIncrement.*(waveform.RawData - waveform.YReference)) + waveform.YOrigin;
I display a 200MHz sine wave signal on the scope and it looks good because of the interpolation filter. Now, if I plot the data I get back from the scope, the sine wave looks bumpy similar to what it looks like on the scope with the filter turned off. (Only 5 samples per sine wave cycle, so not looking so good).
Does anybody have insight as to why this is happening ? I would also appreciate it if any errors are pointed out in the code. Thanks a lot !
I have a problem on an infiniium 54180 (yes a pretty old scope) that I was hoping to resolve. The scope has bandwidth of 500MHz and a sampling frequency of 1GS/s I'm new to using these scopes so I apologize if this is a simple question. However, I tried the programmer's guide but could not resolve the issue. My problem as clear in the title, is that I cannot read back the interpolated data from the scope, although I turn the interpolation filter on. Here's the MATLAB code that I am using (adapted from the code on file exchange in matlab central). visaObj is just the scope.
fprintf(visaObj,'*RST; :AUTOSCALE');
fprintf(visaObj,':STOP');
fprintf(visaObj,':WAVEFORM:SOURCE CHAN1');
fprintf(visaObj,':ACQUIRE:COUNT 8');
fprintf(visaObj,':ACQUIRE:COMPLETE 100');
fprintf(visaObj,':ACQUIRE:MODE INTERPOLATE');
fprintf(visaObj,:ACQUIRE:POINTS 1024);
% Now tell the instrument to digitize channel1
fprintf(visaObj,':DIGITIZE CHAN1');
% Wait till complete
operationComplete = str2double(query(visaObj,'*OPC?'));
while ~operationComplete
operationComplete = str2double(query(visaObj,'*OPC?'));
end
fprintf(visaObj,':WAVEFORM:FORMAT WORD');
fprintf(visaObj,':WAVEFORM:BYTEORDER LSBFirst');
preambleBlock = query(visaObj,':WAVEFORM:PREAMBLE?');
fprintf(visaObj,':WAV:DATA?');
waveform.RawData = binblockread(visaObj,'int16'); fread(visaObj,1);
%fprintf(visaObj,':CHANNEL1:DISPLAY ON');
% process data
% store all this information into a waveform structure for later use
preambleBlock = regexp(preambleBlock,',','split');
waveform.Points = str2double(preambleBlock{3});
waveform.XOrigin = str2double(preambleBlock{6}); % in seconds
waveform.XReference = str2double(preambleBlock{7});
waveform.YIncrement = str2double(preambleBlock{8}); % V
waveform.YOrigin = str2double(preambleBlock{9});
waveform.YReference = str2double(preambleBlock{10});
waveform.VoltsPerDiv = (maxVal * waveform.YIncrement / 8); % V
waveform.Offset = ((maxVal/2 - waveform.YReference) * waveform.YIncrement + waveform.YOrigin); % V
waveform.SecPerDiv = waveform.Points * waveform.XIncrement/10 ; % seconds
waveform.Delay = ((waveform.Points/2 - waveform.XReference) * waveform.XIncrement + waveform.XOrigin); % seconds
% Generate X & Y Data
waveform.XData = (waveform.XIncrement.*(1:length(waveform.RawData))) - waveform.XIncrement;
waveform.YData = (waveform.YIncrement.*(waveform.RawData - waveform.YReference)) + waveform.YOrigin;
I display a 200MHz sine wave signal on the scope and it looks good because of the interpolation filter. Now, if I plot the data I get back from the scope, the sine wave looks bumpy similar to what it looks like on the scope with the filter turned off. (Only 5 samples per sine wave cycle, so not looking so good).
Does anybody have insight as to why this is happening ? I would also appreciate it if any errors are pointed out in the code. Thanks a lot !