FQ2FAC is a private function and is called by ngconv.m which can be found in the folder 'noisegenerator'. It calculates polynomial coefficients from given poles and Zeros. Inputs (from ngconv.m): - f : frequency of apole or zero - q : quality factor of a pole or zero Outputs: - polzero: a vector of resulting polynomial coefficients A Monsky 24-07-07 $Id: fq2fac.m,v 1.2 2008/08/01 13:19:42 ingo Exp $
0001 % FQ2FAC is a private function and is called by ngconv.m which can be found in the 0002 % folder 'noisegenerator'. 0003 % It calculates polynomial coefficients from given poles and Zeros. 0004 % 0005 % Inputs (from ngconv.m): 0006 % - f : frequency of apole or zero 0007 % - q : quality factor of a pole or zero 0008 % 0009 % Outputs: 0010 % - polzero: a vector of resulting polynomial coefficients 0011 % 0012 % A Monsky 24-07-07 0013 % 0014 % $Id: fq2fac.m,v 1.2 2008/08/01 13:19:42 ingo Exp $ 0015 % 0016 0017 function polzero = fq2fac(f,q) 0018 0019 n = length(f); 0020 polzero = zeros(n,3); 0021 for i = 1:n 0022 if isnan(q(i)) 0023 polzero(i,1:2) = [1 1/(2*pi*f(i))]; 0024 else 0025 polzero(i,1:3) = [1 1/(2*pi*f(i)*q(i)) 1/((2*pi*f(i))*(2*pi*f(i)))]; 0026 end 0027 end 0028 0029 end 0030