comparison m-toolbox/classes/@pz/cz2iir.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 % CZ2IIR return a,b IIR filter coefficients for a complex zero designed using the bilinear transform.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: CZ2IIR return a,b IIR filter coefficients for a complex zero
5 % designed using the bilinear transform.
6 %
7 % CALL: [a,b] = cz2iir(z, fs)
8 %
9 % REMARK: This is just a helper function. This function should only be
10 % called from class functions.
11 %
12 % INPUTS: z - zero object
13 % fs - the sample rate for the filter
14 %
15 % VERSION: $Id: cz2iir.m,v 1.7 2011/02/18 16:48:54 ingo Exp $
16 %
17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18
19 function varargout = cz2iir(varargin)
20
21 z = varargin{1};
22 fs = varargin{2};
23
24 f0 = z.f;
25 q = z.q;
26
27 w0 = f0*2*pi;
28 w02 = w0^2;
29
30 a(1) = (-q*w02/2 - 2*q*fs*fs - w0*fs) / (q*w02);
31 a(2) = (-w02+4*fs*fs) / w02;
32 a(3) = (-q*w02/2 - 2*q*fs*fs + w0*fs) / (q*w02);
33
34 b(1) = 1;
35 b(2) = -2;
36 b(3) = -1;
37
38 varargout{1} = a;
39 varargout{2} = b;
40 end
41