📄 ga_circles.m
字号:
function ga_circles(s, values)%GA_CIRCLES Draw constant available power gain circles on a Smith Chart.% GA_CIRCLES(S, VALUES) has the following parameters:% - S: a 2x2 matrix containing the s-parameters of the device, and% - VALUES: the power values to be plotted in dB.% If VALUES is not provided, four circles are drawn from MAG or MSG in% steps of 1 dB.%% Example:% % The available power gain circles in Figure 4.3.4 in Gonzalez.% s = [ (0.552*exp( j*169/180*pi)) (0.049*exp( j* 23/180*pi)) ; ...% (1.681*exp( j* 26/180*pi)) (0.839*exp(-j* 67/180*pi)) ]% smith% ga_circles(s, 13.7:-1:6.7)%% See also: SMITH, SMITH_CIRLES %% Reference:% G. Gonzalez, "Microwave Transistor Amplifiers - Analysis and Design,"% 2nd ed., Prentice Hall, 1997.% Copyright 2008 Warren du Plessis%% This file is part of The Smith Chart Circles Toolbox.%% The Smith Chart Circles Toolbox is free software: you can redistribute it% and/or modify it under the terms of the GNU General Public License as% published by the Free Software Foundation, either version 3 of the% License, or (at your option) any later version.%% The Smith Chart Circles Toolbox is distributed in the hope that it will be% useful, but WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General% Public License for more details.%% You should have received a copy of the GNU General Public License along% with The Smith Chart Circles Toolbox. If not, see% <http://www.gnu.org/licenses/>.% Check the number of inputs.error(nargchk(1, 2, nargin));% Calculate the values of the 4 default circles to be plotted if no gains% are specified.if nargin < 2 values = maximum_gain(s) - [ 1e-4 1 2 3 ];end% Check the s-parameter matrix has the correct size.if ~isequal(size(s), [ 2 2 ]) error('The s-parameter matrix must be a 2x2 matrix.');end% Add these circles to the current plot.hold on% Calculate the Rollett stability factor.[ stable K delta ] = rollett_stability(s);% Determine the centres and radii of the circles.ga = 10.^(values/10)/abs(s(2,1))^2; % Divide by abs(s(2,1))^2 here to save % computations below.centre = ga*conj(s(1,1) - delta*conj(s(2,2)))./ ... (1 + ga*(abs(s(1,1))^2 - abs(delta)^2));radius = sqrt(1 - 2*K*abs(s(1,2)*s(2,1))*ga + (abs(s(1,2)*s(2,1))*ga).^2)./ ... (1 + ga*(abs(s(1,1))^2 - abs(delta)^2));% Plot the circles.smith_circles(centre, abs(radius), 'm')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -