view m-toolbox/classes/@pzmodel/abcascade.m @ 47:dd93c9ba6624 database-connection-manager

Fix Java dialog
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Tue, 06 Dec 2011 19:07:27 +0100
parents f0afece42f48
children
line wrap: on
line source

% ABCASCADE Cascade two filters together to get a new filter.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION: ABCASCADE Cascade two filters together to get a new filter.
%
% CALL:        [a,b] = abcascade(a1,b1,a2,b2)
%
% VERSION:     $Id: abcascade.m,v 1.3 2010/10/29 16:09:15 ingo Exp $
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [ao,bo] = abcascade(a1,b1,a2,b2)

  n = length(a1);
  m = length(a2);
  N = m+n-1;

  alpha = zeros(1, N);
  beta = zeros(1, N);

  for i=0:n-1
    for j=0:m-1
      alpha(i+j+1) = alpha(i+j+1) + a1(i+1)*a2(j+1);
      beta(i+j+1) = beta(i+j+1) + b1(i+1)*b2(j+1);
    end
  end

  ao = alpha;
  bo = beta;
end