


GETUPPERFREQ gets the frequency of the highest pole or zero in the model.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: GETUPPERFREQ gets the frequency of the highest pole or zero in
the model.
CALL: f = getupperFreq(pzm);
VERSION: $Id: getupperFreq.m,v 1.3 2008/01/07 18:13:10 ingo Exp $
HISTORY: 04-04-2007 M Hewitson
Creation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

0001 function f = getupperFreq(pzm, varargin) 0002 % GETUPPERFREQ gets the frequency of the highest pole or zero in the model. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: GETUPPERFREQ gets the frequency of the highest pole or zero in 0007 % the model. 0008 % 0009 % CALL: f = getupperFreq(pzm); 0010 % 0011 % VERSION: $Id: getupperFreq.m,v 1.3 2008/01/07 18:13:10 ingo Exp $ 0012 % 0013 % HISTORY: 04-04-2007 M Hewitson 0014 % Creation 0015 % 0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0017 0018 VERSION = '$Id: getupperFreq.m,v 1.3 2008/01/07 18:13:10 ingo Exp $'; 0019 0020 % Check if this is a call for parameters 0021 if nargin == 2 0022 if isa(pzm, 'pzmodel') && ischar(varargin{1}) 0023 in = char(varargin{1}); 0024 if strcmp(in, 'Params') 0025 f = plist; 0026 return 0027 elseif strcmp(in, 'Version') 0028 f = VERSION; 0029 return 0030 end 0031 end 0032 end 0033 0034 poles = get(pzm, 'poles'); 0035 zeros = get(pzm, 'zeros'); 0036 np = length(poles); 0037 nz = length(zeros); 0038 f = 0; 0039 for j=1:np 0040 pole = poles(j); 0041 fc = get(pole, 'f'); 0042 if fc > f 0043 f = fc; 0044 end 0045 end 0046 0047 for j=1:nz 0048 zero = zeros(j); 0049 fc = get(zero, 'f'); 0050 if fc > f 0051 f = fc; 0052 end 0053 end 0054 0055 0056 0057 % END