Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 157
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(phj*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
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
% resample to desired rate if necessary
if (abs(destRate-rate)>1e-6)
% note that this resample function only works with integer rates
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...