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