Home > m > noisegenerator > private > conv_noisegen.m

conv_noisegen

PURPOSE ^

CONV_NOISEGEN calls the matlab function conv.m to convolute poles and

SYNOPSIS ^

function [b,a] = conv_noisegen(pol,zer)

DESCRIPTION ^

 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.m,v 1.5 2008/02/22 11:12:46 hewitson Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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.m,v 1.5 2008/02/22 11:12: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

Generated on Mon 31-Mar-2008 13:54:54 by m2html © 2003