Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 163
Programming Examples
LAN Programming Interface Examples
if (mod(length(timeDomain), 2)==1) % odd
center=ceil(len/2);
centeredTime(1:(center-1)) = timeDomain(1:end);
centeredTime(center:len) = timeDomain(1:center);
else % even
topHalf = (length(timeDomain)/2)+1;
centeredTime(1:(topHalf-1)) = timeDomain(topHalf:end);
centeredTime(topHalf:len) = timeDomain(1:(topHalf-1));
end
else % already centered in time domain
centeredTime = timeDomain;
end
if (abs(destRate-rate)>1e-6)
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)
[maxval, index] = max(abs(resampledTime));
center=index;
left = center-127;
right = left+255;
clippedTime=resampledTime((left):(right));
else
clippedTime = resampledTime;
end
corrFilter=clippedTime;
end
Example 4: Downloading a FIR filter in Matlab to the MXG
This example uses Matlab to control the X-Series signal generators over the
TCP-IP (LAN) interface. This example takes a filter in Matlab and writes it to a
FIR file in the MXG. This example can be can be used in combination with
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...