Home > classes > @pole > private > pfq2ri.m

pfq2ri

PURPOSE ^

Convert frequency/Q pole/zero representation into real

SYNOPSIS ^

function ri= pfq2ri(f0, Q)

DESCRIPTION ^

 Convert frequency/Q pole/zero representation into real
 and imaginary conjugate pairs. Returns [ri conj(ri)]

 ri= pfq2ri(f0, Q)

 M Hewitson 02-04-07


 $Id: pfq2ri.html,v 1.14 2008/03/31 10:27:36 hewitson Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function ri= pfq2ri(f0, Q)
0002 
0003 % Convert frequency/Q pole/zero representation into real
0004 % and imaginary conjugate pairs. Returns [ri conj(ri)]
0005 %
0006 % ri= pfq2ri(f0, Q)
0007 %
0008 % M Hewitson 02-04-07
0009 %
0010 %
0011 % $Id: pfq2ri.html,v 1.14 2008/03/31 10:27:36 hewitson Exp $
0012 %
0013 
0014 if(nargin==0)
0015   disp('usage: ri = fq2ri2(f0, Q)')
0016   return
0017 elseif(nargin==1 || nargin==2 && isnan(Q))
0018     ri = -(1/(2*pi*f0));
0019 elseif(nargin==2 && Q>=0)
0020     if Q < 0.5
0021       disp('Q < 0.5! Splitting to two real poles;')
0022       ri = [-(1/(2*pi*f0)) -(1/(2*pi*f0))];
0023     else
0024       w0  = 2*pi*f0;
0025       G   = 1/(w0*w0);
0026       re  = G.*-w0/(2*Q);
0027       im  = G.*w0*sqrt(4*Q*Q-1)/(2*Q);
0028       tri = complex(re,im);
0029       ri  = [tri; conj(tri)];
0030     end
0031 end
0032 
0033 
0034 
0035 % END

Generated on Mon 31-Mar-2008 12:20:24 by m2html © 2003