Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 165
Programming Examples
LAN Programming Interface Examples
if (rate ~= destRate)
timeDomainFilter = resample(double(timeDomainFilter), destRate,
rate, 30);
timeDomainFilter = timeDomainFilter.*(rate/destRate);
end
if (length(timeDomainFilter)>maxTaps)
[maxval, index] = max(abs(timeDomainFilter));
center=index;
left = center-(maxTaps/2-1);
if (left<1)
left=1;
end
right = left+(maxTaps-1);
while (right > length(timeDomainFilter))
right = right-1;
end
timeDomainFilter = timeDomainFilter((left):(right));
end
rateAdjustedFilter = timeDomainFilter;
% open tcp connection
t=tcpip(host, 5025);
t.OutputBufferSize=1024*1024; % plenty big for filters
% write file contents
fopen(t);
%for writing to a file instead to see what is being output
%t=fopen('test', 'w');
% send command with filename
fprintf(t, '%s', horzcat(':MEM:DATA:FIR "', instrumentFilename,
'",'));
% send type
if (isreal(timeDomainFilter))
fprintf(t, '%s', 'REAL,');
else % convert complex to a real array
fprintf(t, '%s', 'COMP,');
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...