% Given Zload, Zsource (which is 50 ohms here), Ql and Qc, % calculate the XL and XC values of the LsCp or CpLs network % than will match Zload to Zsource, using the equations % developed with MATLAB's Symbolic Match toobox (and % subsequently placed into the function calls, below). % from gamma, calculate Zload (and its real and imaginary % parts. Imag_gamma(swr_index,i) = rho*sin(radian_delta*(i-1)) Real_gamma(swr_index,i) = rho*cos(radian_delta*(i-1)) the x and y coordinates of each data point). % Will plot a point every 2 degrees around the SWR, % So that delta, in radians, is:įor i = 1:181 % plotting 360 degrees % calculate the real and imaginary components of gamma. % Define the SWRs of the circles that will be plotted. % Plot power loss of a low-pass L-Network % around circles of constant swr. MATLAB experts undoubtedly will find better ways of implementing what I MATLAB dilettante, which I am sure is reflected in my code, below. (Let me add - unlike Dick, who is a true MATLAB expert, I am a
Matlab smith chart code#
The code responsible for plotting the data is at the end of the These values (and their Qs), L-network power dissipation was calculated L and C was then calculated for each impedance, and from Various Smith Chart "circles of constant SWR" in 2 degree The load impedances were calculated from gamma found while stepping around Refer to this post for the equations used for calculating L and C, and Various loads to 50 ohms, given frequency and component Qs. I do this by calculating the L-network L and C values required to match Low-pass configurations of two-element lossy L-Networks.
This code analyzesīoth the series-L/parallel-C and parallel-C/series-L (LsCp and CpLs) Power-dissipation data I've displayed, above. Script below, I call surfc in the form of surfc(X,Y,Z):īelow is the complete MATLAB script I used to generate the The actual 3-D plot is made using MATLAB's surfc.
Matlab smith chart pdf#
Smith_rab_v2.m (refer to the documentation PDF contained in the S-Parameter Utilities download).Ģ. The code begins by customizing the Smith Chart plot parameters for Set(ht, 'Color', 'FontSize',12) Notes on the plotting code, above:ġ. Set(handles.surf(1,2), 'Linewidth',2) % nice fat contours lines! Handles.surf(1,:) = surfc(real_gamma,imag_gamma,Percent_Loss) Set(handles.cb(1).Label, 'String', 'Percent Power Loss'. Set(handles.cb(1), 'Color', SP.colors.outer_text. Set(handles.Axes_Smith(4), 'visible', 'on'. Handles.smith(4) = smith_rab_v2(handles.Axes_Smith(4),SP) Handles.figure(4) = figure( 'NumberTitle', 'Off'. SP.Q_pts = % number of points in a Q contour SP.LW_swr = 2 % LW= line width for SWR Circles SP.swr_circles = % set to for no SWR circles SP.LW = 1 % LW= line width for Smith coordinates % Plot 3-d smith chart % First, set Smith Chart parameters for smith_rab_v2.m, % per its documentation: It invokes surfc in the form surfc(X,Y,Z), per the description, above.
Below is the code to create a Smith Chart plot of data in 3-D.