comparison m-toolbox/classes/+utils/@math/fq2ri2.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 % FQ2RI2 Convert frequency/Q pole/zero representation into real
2 % and imaginary conjugate pairs. Returns [ri conj(ri)]
3 %
4 % ri= fq2ri2(f0, Q)
5 %
6 % M Hewitson 26-01-07
7 %
8 %
9 % $Id: fq2ri2.m,v 1.2 2008/10/24 06:19:23 hewitson Exp $
10 %
11
12 function ri= fq2ri2(f0, Q)
13
14 if(nargin==0)
15 disp('usage: ri = fq2ri2(f0, Q)')
16 return
17 elseif(nargin==1)
18 ri = (1/(2*pi*f0));
19 elseif(nargin==2)
20 if Q <= 0.5
21 disp('working on Q < 0.5') %ri =1/(2*pi*f0);
22 else
23 w0 = 2*pi*f0;
24 G = 1/(w0*w0);
25 re = -w0/(2*Q);
26 im = w0*sqrt(4*Q*Q-1)/(2*Q);
27 tri = complex(re,im);
28 ri = G.*[tri conj(tri)]';
29 end
30 end
31 end
32 % END