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