Construct an mfir from coefficients %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: fromA DESCRIPTION: Construct an mfir from coefficients CALL: f = fromA(f, pli) PARAMETER: pli: Parameter list object HISTORY: 09-06-2008 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % Construct an mfir from coefficients 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % FUNCTION: fromA 0005 % 0006 % DESCRIPTION: Construct an mfir from coefficients 0007 % 0008 % CALL: f = fromA(f, pli) 0009 % 0010 % PARAMETER: 0011 % pli: Parameter list object 0012 % 0013 % HISTORY: 09-06-2008 M Hewitson 0014 % Creation 0015 % 0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0017 0018 function f = fromA(f, pli) 0019 0020 VERSION = '$Id: fromA.m,v 1.7 2008/09/04 13:37:14 ingo Exp $'; 0021 0022 ii = mfir.getInfo('mfir', 'From A'); 0023 % Set the method version string in the minfo object 0024 ii.setMversion([VERSION '-->' ii.mversion]); 0025 0026 % Add default values 0027 pl = combine(pli, ii.plists); 0028 0029 a = find(pl, 'a'); 0030 fs = find(pl, 'fs'); 0031 0032 % Checking the coefficients are listed in rows 0033 if size(a,1)~=1 0034 a = a'; 0035 end 0036 0037 % Zero pad coefficients to avoid zero length history 0038 if numel(a) <= 1 0039 a = [a 0]; 0040 end 0041 0042 f.setName('A', 'internal'); 0043 f.setFs(fs); 0044 f.setA(a); 0045 f.setGd((f.ntaps+1)/2); 0046 f.setHistout(zeros(1,f.ntaps-1)); % initialise output history 0047 0048 % Add history 0049 f.addHistory(ii, pl, [], []); 0050 0051 end % End fromA