function iq = sim_generatewaveform_pulse_duty_cycle(duty_cycle)
%SIM_GENERATEWAVEFORM_PULSE_DUTY_CYCLE Generate IQ pulse data.

if nargin < 1
    duty_cycle = 0.5;
end

TOTAL_IQ_POINTS = 250000;
TOTAL_INT16_POINTS = TOTAL_IQ_POINTS * 2;
I_VALUE = int16(32766);

% Clamp duty cycle.
if duty_cycle < 0.0
    duty_cycle = 0.0;
end
if duty_cycle > 1.0
    duty_cycle = 1.0;
end

% Convert duty cycle to active IQ samples.
active_iq = floor(TOTAL_IQ_POINTS * duty_cycle);

% Preallocate output.
iq = zeros(1, TOTAL_INT16_POINTS, 'int16');

% Fill active I samples; Q samples stay zero.
if active_iq > 0
    iq(1:2:(active_iq * 2)) = I_VALUE;
end

% Inactive samples stay zero.
end
