CONV_NOISEGEN calls the matlab function conv.m to convolute poles and zeros from a given pzmodel The function is a private one and is called from ngconv.m in the noisegenerator folder. Inputs (from ngconv.m): - pol - zero Outputs: - b: denominator coefficients of transfer function - a: numerator coefficients of transfer function A Monsky 24-07-07 $Id: conv_noisegen.html,v 1.12 2008/03/31 10:27:46 hewitson Exp $
0001 function [b,a] = conv_noisegen(pol,zer) 0002 % CONV_NOISEGEN calls the matlab function conv.m to convolute poles and 0003 % zeros from a given pzmodel 0004 % 0005 % The function is a private one and is called from ngconv.m in the 0006 % noisegenerator folder. 0007 % 0008 % Inputs (from ngconv.m): 0009 % - pol 0010 % - zero 0011 % 0012 % Outputs: 0013 % - b: denominator coefficients of transfer function 0014 % - a: numerator coefficients of transfer function 0015 % A Monsky 24-07-07 0016 % 0017 % $Id: conv_noisegen.html,v 1.12 2008/03/31 10:27:46 hewitson Exp $ 0018 % 0019 0020 [m,k] = size(pol); 0021 [n,l] = size(zer); 0022 0023 coefb = pol(1,:); 0024 0025 for i = 2:m 0026 coefb = conv(coefb, pol(i,:)); 0027 end 0028 0029 b = nonzeros(coefb); 0030 0031 if n~=0 0032 coefa = zer(1,:); 0033 for i = 2:n 0034 coefa = conv(coefa, zer(i,:)); 0035 end 0036 a = nonzeros(coefa); 0037 else 0038 a = 1; 0039 end 0040 0041 %normalize to bn = 1 0042 m = length(b); 0043 normfac = b(m); 0044 b = b/normfac; 0045 a = a/(normfac*sqrt(2)); 0046 0047