⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maximum_gain.m

📁 文件中是用于matlab画smith圆图程序包
💻 M
字号:
function max_gain = maximum_gain(s)%MAXIMUM_GAIN Calculate the maximum gain for a specified device.%   MAX_GAIN = MAXIMUM_GAIN(S) has the following parameter:%   - S: a 2x2 matrix containing the s-parameters of the device.%   The output is:%   - MAX_GAIN: The Maximum Available Gain (MAG) is computed if the device%     is unconditionally stable, or the Maximum Stable Gain (MSG) is%     computed if the device is not unconditionally stable.%%   Examples:%   % The maximum gain in Example 3.6.1 in Gonzalez.%   s = [ (0.641*exp(-j*171.3/180*pi)) (0.057*exp( j* 16.3/180*pi)) ; ...%         (2.058*exp( j* 28.5/180*pi)) (0.572*exp(-j* 95.7/180*pi)) ]%   10*log10(maximum_gain(s))  % Get the gain in decibels.%   % The maximum gain in Example 3.7.3 in Gonzalez (plots in Figure%   %  3.7.3).%   s = [ (0.5*exp(-j*180/180*pi)) (0.08*exp( j* 30/180*pi)) ; ...%         (2.5*exp( j* 70/180*pi)) ( 0.8*exp(-j*100/180*pi)) ]%   10*log10(maximum_gain(s))  % Get the gain in decibels.%%   See also: ROLLETT_STABILITY, GA_CIRCLES, GP_CIRCLES%%   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, 1, nargin));% 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% Calculate the Rollett stability factor.[ stable K ] = rollett_stability(s);% Calculate the maximum gain for each possible case.if stable    % The MAG because the device is unconditionally stable.    max_gain = abs(s(2,1)/s(1,2))*(K - sqrt(K^2 - 1));else    % The MSG because the device is not unconditionally stable.    max_gain = abs(s(2,1)/s(1,2));end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -