comparison m-toolbox/classes/@rational/respCore.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 % RESPCORE returns the complex response of one rational object.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: RESPCORE returns the complex response of one rational object
5 % as a data-vector. This function should only be used by the
6 % resp method of the ltpda_tf class.
7 %
8 % CALL: r = respCore(obj, f);
9 %
10 % VERSION: $Id: respCore.m,v 1.4 2010/03/15 15:49:53 ingo Exp $
11 %
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13
14 function r = respCore(varargin)
15
16 %%% Get Inputs
17 obj = varargin{1};
18 f = varargin{2}; % Row vector
19
20 %%% Compute response
21 s = 2*pi*1i*f;
22 numr = polyval(obj.num, s);
23 denr = polyval(obj.den, s);
24 r = numr./denr; % Row vector
25
26 end
27