NGCONV is called by the function LTPDA_NOISEGEN it takes the pole zero model pzm (user input to LTPDA_NOISEGEN) as input and returns as outputs: - a: numerator coefficients - b: denominator coefficients of the target transfer function A Monsky 24-07-07 $Id: ngconv.m,v 1.3 2008/08/01 13:19:42 ingo Exp $
0001 % NGCONV is called by the function LTPDA_NOISEGEN 0002 % it takes the pole zero model pzm (user input to LTPDA_NOISEGEN) 0003 % as input and returns as 0004 % outputs: 0005 % - a: numerator coefficients 0006 % - b: denominator coefficients 0007 % of the target transfer function 0008 % A Monsky 24-07-07 0009 % 0010 % $Id: ngconv.m,v 1.3 2008/08/01 13:19:42 ingo Exp $ 0011 0012 function [a,b] = ngconv(pzm) 0013 0014 zs = pzm.zeros; 0015 ps = pzm.poles; 0016 0017 f_zer = zeros(length(zs)); 0018 q_zer = zeros(length(zs)); 0019 for j=1:length(zs) 0020 z = zs(j); 0021 f_zer(j,1) = z.f; 0022 q_zer(j,1) = z.q; 0023 %if isnan(q_zer(j)) 0024 % q_zer(j,1) = 0; 0025 %end 0026 %zv(j,1:2) = [f q]; 0027 end 0028 0029 f_pol = zeros(length(ps)); 0030 q_pol = zeros(length(ps)); 0031 for j=1:length(ps) 0032 p = ps(j); 0033 f_pol(j,1) = p.f; 0034 q_pol(j,1) = p.q; 0035 %if isnan(q_pol(j)) 0036 % q_pol(j,1) = 0; 0037 %end 0038 end 0039 0040 %%% calculate factors from f and q 0041 pol = ao.fq2fac(f_pol,q_pol); 0042 zer = ao.fq2fac(f_zer,q_zer); 0043 0044 %%% 0045 [b,a] = ao.conv_noisegen(pol,zer); 0046 end 0047 0048