comparison m-toolbox/classes/@pzmodel/abcascade.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 % ABCASCADE Cascade two filters together to get a new filter.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: ABCASCADE Cascade two filters together to get a new filter.
5 %
6 % CALL: [a,b] = abcascade(a1,b1,a2,b2)
7 %
8 % VERSION: $Id: abcascade.m,v 1.3 2010/10/29 16:09:15 ingo Exp $
9 %
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12 function [ao,bo] = abcascade(a1,b1,a2,b2)
13
14 n = length(a1);
15 m = length(a2);
16 N = m+n-1;
17
18 alpha = zeros(1, N);
19 beta = zeros(1, N);
20
21 for i=0:n-1
22 for j=0:m-1
23 alpha(i+j+1) = alpha(i+j+1) + a1(i+1)*a2(j+1);
24 beta(i+j+1) = beta(i+j+1) + b1(i+1)*b2(j+1);
25 end
26 end
27
28 ao = alpha;
29 bo = beta;
30 end
31