Mercurial > hg > ltpda
view m-toolbox/classes/@miir/mkallpass.m @ 5:5a49956df427 database-connection-manager
LTPDAPreferences panel for new LTPDADatabaseConnectionManager
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 16:20:06 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
% MKALLPASS returns an allpass filter miir(). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % DESCRIPTION: MKALLPASS returns an allpass filter miir(). % % CALL: f = mkallpass(f, pl) % % VERSION: $Id: mkallpass.m,v 1.2 2010/10/29 16:09:14 ingo Exp $ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function f = mkallpass(f, pl) fs = find(pl, 'fs'); method = find(pl, 'method'); D = find(pl, 'delay'); N = find(pl, 'N'); % Build filter coefficients switch method case 'thirlen' for k=0:N a(k+1) = (-1.0)^k * factorial(N)/(factorial(k)*factorial(N-k)); for n=0:N a(k+1) = a(k+1) * (D-N+n)/(D-N+k+n); end end a = a/sum(a); b(1) = 1; otherwise error(['Unrecognised method [' method ']']); end % Set filter properties f.name = 'bandpass'; f.fs = fs; f.a = a; f.b = b; f.histin = zeros(1,f.ntaps-1); % initialise input history f.histout = zeros(1,f.ntaps-1); % initialise output history end