Download X-Series Signal Generators Programming Guide

Transcript
Programming Examples
LAN Programming Interface Examples
centeredTime(topHalf:len) = timeDomain(1:(topHalf-1));
end
% resample to desired rate if necessary
if (abs(destRate-rate)>1e-6)
% note that this resample function only works with integer rates
resampledTime = resample(centeredTime, destRate, rate, 30);
resampledTime = resampledTime.*(rate/destRate);
else
resampledTime = centeredTime;
end
% clip off the center 256 (if necessary)
if (length(resampledTime)>256)
% the peak point is assumed to be the center
[maxval, index] = max(abs(resampledTime));
center=index;
left = center-127;
right = left+255;
clippedTime=resampledTime((left):(right));
else
clippedTime = resampledTime;
end
corrFilter=clippedTime;
end
function array = readArrayOfDoubles(fid)
line = fgets(fid);
array = sscanf(line, '%g%*c');
end
160
Keysight EXG and MXG X-Series Signal Generators Programming Guide