296 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Creating and Downloading Waveform Files
Programming Examples
% Calcurate waveform RMS
rms = sqrt(mean(abs(iqWave).^2)) / 32767;
% account for pulse duty cycle
pw = sum(abs(iqWave)>0);
dutyCycle = pw/length(iqWave);
rms = rms/dutyCycle;
% Interlace the I & Q vectors
data = [real(iqWave);imag(iqWave)];
data = data(:)';
end
function mkr = FormatMarkers( markers )
% The markers are placed in the 4 LSBs of a byte
% in this order M4 M3 M2 M1
[c,d] = size(markers);
if c>d
markers = markers';
[c,d] = size(markers);
end
mkr = (markers(1,:)~=0);
if c>1
mkr = mkr + 2*(markers(2,:)~=0);
end
if c>2
mkr = mkr + 4*(markers(3,:)~=0);
end
if c>3
mkr = mkr + 8*(markers(4,:)~=0);
end
end
function hdrCmd = CreateHeaderCommand( file_name, rms, header )
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...