Keysight Technologies X-Series Programming Manual page 157

Signal generators
Hide thumbs Also See for X-Series:
Table of Contents

Advertisement

Programming Examples
LAN Programming Interface Examples
fprintf(t, ':FETCh:EVM21?\n');
xSteps = readArrayOfDoubles(t);
fclose(t);
freqStep = xSteps(1 + 9*2 + 1);
oversample = 1/xSteps(1 + 8*2 +1);
% /10 compensates for issue with PSA (should be /20)
% this issue will be corrected in a future release
linmag = 10.^(magDb./10);
% *2 compensates for issue with PSA (should be *1)
% this issue will be corrected in a future release
phaseRad = phaseDeg./(360/(2*pi)).*2;
coeffs = linmag.*cos(phaseRad)+j*linmag.*sin(phaseRad);
rate = oversample*round(freqStep*length(coeffs)); % frequency range
is also rate
% we now have a centered frequency domain version of the channel
response
% invert so that we will cancel the channel response
invertedFreqDomain = 1./coeffs;
% convert to time domain (first placing the 0 frequency at the left
edge)
timeDomain=ifft(ifftshift(invertedFreqDomain));
% put time domain 0 time in center
len=length(timeDomain);
if (mod(length(timeDomain), 2)==1) % odd
else % even
end
% resample to desired rate if necessary
if (abs(destRate-rate)>1e-6)
Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
center=ceil(len/2);
centeredTime(1:(center-1)) = timeDomain(center+1:end);
centeredTime(center:len) = timeDomain(1:center);
topHalf = (length(timeDomain)/2)+1;
centeredTime(1:(topHalf-1)) = timeDomain(topHalf:end);
centeredTime(topHalf:len) = timeDomain(1:(topHalf-1));
% note that this resample function only works with integer rates
157

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents