IC-7410 Rig Control Program and Soft66LC4 (6)

IQraw

Here is a raw IQ data plot for 12 cycles, which contain 484 samples. We are going to obtain parameters to correct the gain and the phase errors. First, the DC offset.

% awk 'BEGIN {n=484} {a=a+$1; b=b+$2} END {print a/n,b/n}' data1c.txt
-246.618 -222.262

We assume, after correcting the DC offset, that I’=A*cos(wt) and Q’=B*sin(wt+C). Then we have (I’,Q’)=([A,0],[B*sin(C)+B*cos(C)]) (cos(wt),sin(wt)). By inverting the 2×2 matrix, we have (I,Q)=([B*cos(C),0],[-B*sin(C),A]) (I’,Q’), where I and Q are ideal (and normalized) IQ signals, namely cos(wt) and sin(wt).

Noting that /I’I’/=(1/2)*A^2, /Q’Q’/=(1/2)*B^2, and /I’Q’/=(1/2)*A*B*sin(C), we have A=sqrt(2*/I’I’/), B=sqrt(2*/Q’Q’/), and sin(C)=(2/(A*B))*/I’Q’/, where /*/ is defined to be the average over the period.

% awk 'BEGIN {n=484;d1=-246.618;d2=-222.262} {a=a+($1-d1)*($1-d1); b=b+($2-d2)*($2-d2)} END {print a/n,b/n}' data1c.txt
2.24414e+08 1.89215e+08

Therefore, /I’I’/=2.24414e+08, and /Q’Q’/=1.89215e+08, which means A=21185.6, and B=19453.3.

% awk 'BEGIN {n=484;d1=-246.618;d2=-222.262} {a=a+($1-d1)*($2-d2)} END {print a/n}' data1c.txt
6.3263e+07

Next, /I’Q’/=6.3263e+07, which means sin(C)=0.30701, or C=0.31204[rad]=17.879[deg].

And finally, we get B*cos(C)=18513.86, and -B*sin(C)=-5972.26.

If we multiply a constant, 1/B*cos(C), to the matrix ([B*cos(C),0],[-B*sin(C),A]) so that I’ becomes immediately I, as we assumed in our previous articles, we have:

(I,Q)=([1,0],[-tan(C),A/(B*cos(C))]) (I’,Q’)=([1,0],[-0.32258,1.1443]) (I’,Q’)

My first guess by observations was that “C1 to be -0.32 and C2 to be 1.14”, and it proves that I guess very exactly!

IC-7410 Rig Control Program and Soft66LC4 (5)

soft66waterfall3

Let’s see now if the following simple adjustment is effective with the frequencies other than LO+600Hz.

if(channels == 2) {
  for(int i =0; i < NFFT; i+=2) {
      audio_signal[i]   = samples[i] + 400.0;
      audio_signal[i+1] = -0.32*samples[i] + 1.14*samples[i+1];
  }
}

The RF frequency is varied with 1kHz step, and the center is at 7020kHz. You can observe the images as faint green dots on the waterfall, but on the whole it looks reasonably fine, doesn’t it?

You can see the waterfall without the adjustment in my previous article.