view m-toolbox/classes/@pzmodel/abcascade.m @ 51:9d5c88356247 database-connection-manager

Make unit tests database connection parameters configurable
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:24:37 +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