function data = read_IQ(sys)

base=['LLRF:', sys, ':'];

pvs={'ACQ:ADC0'; 'ACQ:ADC1'; 'ACQ:ADC2'; 'ACQ:ADC3'};

data.raw = lcaGet(strcat(base, pvs));
data.raw = data.raw(:, 1:end-1)';

data.cav1 = data.raw(:,1) + i*data.raw(:,3);
data.cav2 = data.raw(:,2) + i*data.raw(:,4);

data.Ts = lcaGet([base, 'SCALAR:AVGLEN'])*1e-6;

data.t = [0:length(data.cav1)-1]*data.Ts;

% Do some plotting
figure(1); clf
subplot(211)
plot(data.t*1e3, abs(data.cav1));
title(sprintf('Cavity 1, std = %f', std(abs(data.cav1))));
ylabel('Amplitude (arb. units)');
xlabel('Time (ms)');
subplot(212);
plot(data.t*1e3, unwrap(angle(data.cav1))/pi*180);
xlabel('Time (ms)');
ylabel('Phase (degrees)');
title(sprintf('std = %f degrees', std(unwrap(angle(data.cav1))/pi*180)));

figure(2); clf
subplot(211)
plot(data.t*1e3, abs(data.cav2));
title(sprintf('Cavity 2, std = %f', std(abs(data.cav2))));
ylabel('Amplitude (arb. units)');
xlabel('Time (ms)');
subplot(212);
plot(data.t*1e3, unwrap(angle(data.cav2))/pi*180);
xlabel('Time (ms)');
ylabel('Phase (degrees)');
title(sprintf('std = %f degrees', std(unwrap(angle(data.cav2))/pi*180)));
