162 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
LAN Programming Interface Examples
% filename must reference an 89600 Equalization filter saved as .mat
file with the header included.
% destRate is assumed to be 200e6 if missing
% output of corrFilter is in time domain.
% Typically followed with:
% writeMxgFir('a-n5182b-00211', 'cft', corrFilter);
if (nargin<1 || nargin>2)
error('[corrFilter] = loadVsaEqFilter(filename[, destRate]) --
destRate is assumed to be 200e6 if missing');
end
if (nargin<2)
destRate=200e6;
end
% load filter struct from .mat file
filterStruct=load(filename);
coeffs = double(filterStruct.Y);
if (filterStruct.XDomain==1) % frequency
rate = filterStruct.XDelta*length(coeffs); % frequency range is
also rate
% VSA software supplies centered frequency domain
else % time domain is 2
rate = 1/filterStruct.XDelta; % inverse of time step is
frequency
% convert to frequency domain
% must center frequency domain (to match what comes from the VSA
% software)
coeffs = fftshift(fft(coeffs));
end
% invert
invertedFreqDomain = 1./coeffs;
% convert to time domain (first placing the 0 frequency at the left
edge)
timeDomain=ifft(ifftshift(invertedFreqDomain));
if (filterStruct.XDomain==1) % frequency
% put time domain 0 time in center
len=length(timeDomain);
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...