EasyManua.ls Logo

Keysight Technologies X Series - Page 295

Keysight Technologies X Series
398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 295
Creating and Downloading Waveform Files
Programming Examples
buf = floor(bufSize/format);
fullChunks = floor(length(data)/buf);
partialChunk = length(data)-(fullChunks*buf);
sfmt = 'int32';
if format==1
sfmt = 'int8';
elseif format==2
sfmt = 'int16';
end
stop=0;
for i=0:(fullChunks-1)
start = 1+(i*buf);
stop = (i+1)*buf;
fwrite(fid,data(start:stop),sfmt);
end
if partialChunk>0
fwrite(fid,data(stop+1:end),sfmt);
end
end
function [data, rms] = FormatWaveform( iqWave )
% Scale the waveform to DAC values
[a,b] = size(iqWave);
if a>b
iqWave = iqWave';
end
maxV = max(abs([real(iqWave) imag(iqWave)]));
if maxV==0 maxV=1; end % Prevent divide by zero
scale = 32767/maxV;
iqWave = round( scale*iqWave );

Table of Contents

Other manuals for Keysight Technologies X Series

Related product manuals