Mercurial > hg > ltpda
comparison m-toolbox/classes/@ao/fq2fac.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 % FQ2FAC is a private function and is called by ngconv.m which can be found in the | |
2 % folder 'noisegenerator'. | |
3 % It calculates polynomial coefficients from given poles and Zeros. | |
4 % | |
5 % Inputs (from ngconv.m): | |
6 % - f : frequency of apole or zero | |
7 % - q : quality factor of a pole or zero | |
8 % | |
9 % Outputs: | |
10 % - polzero: a vector of resulting polynomial coefficients | |
11 % | |
12 % A Monsky 24-07-07 | |
13 % | |
14 % $Id: fq2fac.m,v 1.2 2008/08/01 13:19:42 ingo Exp $ | |
15 % | |
16 | |
17 function polzero = fq2fac(f,q) | |
18 | |
19 n = length(f); | |
20 polzero = zeros(n,3); | |
21 for i = 1:n | |
22 if isnan(q(i)) | |
23 polzero(i,1:2) = [1 1/(2*pi*f(i))]; | |
24 else | |
25 polzero(i,1:3) = [1 1/(2*pi*f(i)*q(i)) 1/((2*pi*f(i))*(2*pi*f(i)))]; | |
26 end | |
27 end | |
28 | |
29 end | |
30 |