IQ Capture Data to Absolute Power Level
This is a sample Matlab/Octave program that shows how Raw IQ capture data can be related to an Absolute power level.
%Copy data into captureData array
%Separate the data and build the complex IQ vector.
%First column contains Q and the second I
quadphase = captureData(:,1);
inphase = captureData(:,2);
IQData = (inphase+1i*quadphase);
%Send SCPI Command [:SENSe]:iQ:SAMPle:CALibration:CONFiguration?
%and get absolute reference offset
absolute_ref_offset = -2.007958;
fs = 13.3e6;%Sampling frequency
n = 1024; %number of samples
%Perform fft
y = abs(fft(IQData, n));
y = fftshift(y);
%Scale fft output
y = y/n;
%To power
y = 20 * log10(y);
%To Absolute power level
y = y + absolute_ref_offset;
%Peak Value
peak = max(y);
f = fs*(-n/2:n/2-1)/n;
plot(f, y);
xlabel("Frequency in Hz"); % x-axis label
ylabel("Power in dBm"); % y-axis label