Mercurial > hg > ltpda
comparison m-toolbox/classes/@pz/rp2iir.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 % RP2IIR Return a,b coefficients for a real pole designed using the bilinear transform. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: RP2IIR Return a,b coefficients for a real pole designed using | |
5 % the bilinear transform. | |
6 % | |
7 % CALL: filt = rpole(p, fs) | |
8 % | |
9 % REMARK: This is just a helper function. This function should only be | |
10 % called from class functions. | |
11 % | |
12 % INPUT: p - pole object | |
13 % fs - the sample rate for the filter | |
14 % | |
15 % VERSION: $Id: rp2iir.m,v 1.7 2011/02/18 16:48:54 ingo Exp $ | |
16 % | |
17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
18 | |
19 function varargout = rp2iir(varargin) | |
20 | |
21 p = varargin{1}; | |
22 fs = varargin{2}; | |
23 | |
24 f0 = p.f; | |
25 w0 = f0*2*pi; | |
26 a(1) = w0 / (2*fs + w0); | |
27 a(2) = a(1); | |
28 b(1) = 1; | |
29 b(2) = (w0-2*fs) / (w0+2*fs); | |
30 | |
31 varargout{1} = a; | |
32 varargout{2} = b; | |
33 end | |
34 |