MATLAB: Contour plot in Smith chart – how to do it

contour plotinterpolationplotting

I got a set of measured load-pull (LP) data from an amplifier, which I'd like to plot as contours in the Smith chart (an example on the desired end result: http://www.mwrf.com/files/30/21651/fig_02.gif )
I've put out a .txt file with the LP measurements on my public DropBox if anyone want to have a go at it ( http://dl.dropbox.com/u/13366636/lp_data.txt )
I import the data from the *.txt file as following:
% Measured loads are inside |G| = [0.1,0.8], <G = [0 180]
A = importdata('lp_data.txt');
Gmag = A.data(:,2); % magnitude of load reflection coeff.
Gphase = A.data(:,3); % phase of load reflection coeff., degrees
Gamma = Gmag.*exp(1i*Gphase*pi/180); % complex load reflection coeff
Pout = A.data(:,5); % measured output power, dBm
Gain = A.data(:,6); % measured power gain, dB
PAE = A.data(:,8); % measured power added efficiency, %
DC2RF = A.data(:,9); % measured drain efficiency, %
But from here on I really don't know how to proceed to be able to plot the LP data as contours. I had a look at the second last example at http://www.mathworks.se/help/techdoc/creating_plots/f10-2524.html but my problem is what to do about the Z-matrix (or even maybe how to make the proper X and Y matrices as well?). I haven't made measurements at all possible complex loads, so I assume I must perform some kind of interpolation in order for this to work, but as mentioned, here I'm clueluess.
Anyone who got any suggestions for where to start?
Best regards, dm

Best Answer

Not sure what your X, Y, and Z are, but I assume it's something like DC2RF (Z) as a function of Gmag and Gphase. In that case, something like this might work:
Greal = Gmag.*cosd(Gphase);
Gimag = Gmag.*sind(Gphase);
[X,Y] = meshgrid(linspace(min(Greal),max(Greal)),linspace(min(Gimag),max(Gimag)));
F = TriScatteredInterp(Greal,Gimag,DC2RF);
Z = F(X,Y);
h = polar([-pi pi], [0 1]);
delete(h)
hold on
contour(X,Y,Z,30)