comparison m-toolbox/classes/+utils/@math/mtxratresp2.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % MTXIIRRESP calculate rational resp by matrix product
2 %
3 % A contains numerators coefficients (a row for each filter)
4 % A contains denominators coefficients (a row for each filter)
5 %
6 % NOTE: A and B should have the same size, zero pad if necessary
7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8 function rsp = mtxratresp2(A,B,freq)
9
10 % build Z matrix
11 S = ones(size(A,2),numel(freq));
12 ss = 2.*pi.*1i.*freq;
13 for jj=2:size(S,1)
14 S(jj,:) = ss.^(jj-1);
15 end
16
17 % get numerator and denominator
18 num = A*S;
19 den = B*S;
20 % get response
21 rspm = num./den;
22 if size(A,1)>1
23 rsp = sum(rspm,1);
24 else
25 rsp = rspm;
26 end
27
28
29 end