160 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
LAN Programming Interface Examples
fprintf(t, 'calc:DDEM:DATA2:HEAD? "XDelta"\n');
timeStep = readArrayOfDoubles(t);
rate = ceil(1 / timeStep - 1e-9);
% mirror coefficients
coeffs = coeffs(length(coeffs):-1:1);
% convert to frequency coefficients (null group delay with
ifftshift)
coeffs = fft(ifftshift(coeffs));
% invert phase in frequency domain
mag = abs(coeffs);
ang = -angle(coeffs);
coeffs = mag.*cos(ang)+1i*mag.*sin(ang);
% display the frequency domain version again
fprintf(t, ':DISPlay:DDEM:TRAC2:FEED "Ch Frequency Response1"\n');
fprintf(t, ':DISPlay:DDEM:TRAC2:FORMat MLOG\n');
fprintf(t, ':DISPlay:DDEM:TRAC2:Y:AUTO:ONCE\n');
% must center frequency domain (to match what comes in frequency
domain)
coeffs = fftshift(coeffs);
fclose(t);
% convert to time domain (first placing the 0 frequency at the left
edge)
timeDomain=ifft(ifftshift(coeffs));
centeredTime = fftshift(timeDomain);
if (abs(destRate-rate)>1e-6)
% this simple resample function may be insuffient for some rates
resampledTime = resample(centeredTime, destRate, rate, 30);
resampledTime = resampledTime.*(rate/destRate);
else
resampledTime = centeredTime;
end
%%%
% display resulting corrections
if displayCorr~=0
fcorr = fftshift(fft(resampledTime));
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...