Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Convert frequency response data to simulink block
Date: Mon, 17 Nov 2008 22:45:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <gfss5g$ja$1@fred.mathworks.com>
References: <g9nhkd$t0g$1@fred.mathworks.com> <aa9087fa-066e-458f-b5b8-041c2ec73afd@z6g2000pre.googlegroups.com> <g9oq8c$occ$1@fred.mathworks.com> <g9os5m$m96$1@fred.mathworks.com> <g9p0rm$o6j$1@fred.mathworks.com> <g9p1i4$3ge$1@fred.mathworks.com> <g9pb3q$pmi$1@fred.mathworks.com> <g9rh90$sh0$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226961904 618 172.30.248.37 (17 Nov 2008 22:45:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 17 Nov 2008 22:45:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1605223
Xref: news.mathworks.com comp.soft-sys.matlab:501304



> H = mag.*exp(j*phase);
> G = idfrd(H,w);  %w is fequency in rad/s
> (make sure the phase is in rad.)
> 
> Then you may estimate paramteric models using G as data. If you want 
> continuous-time models, you can set the sample time to zero in G (G.Ts=0), 
> or use "process models" (see M4 below).
> 
> M1 = oe(G, [2 2 1]); %get output error model: y = B/F*u+e, with 2 poles and 
> one zero
> M2 = pem(G,4); % 4th order state-space model
> M3 = arx(G, [2 2 1]); %arx model: Ay = Bu+e
> M4 = pem(G,'p2dz'); % get a continuous-time process model

My version of Matlab doesn't seem to accept IDFRD objects for oe, pem, or arx.  I'm using version MatLab 6.5 and the system identification toolbox version 5.0.  pem() complains that OutputData must be a 2D matrix.  arx() complains that NN must be the same number of columns as inputs.  Am I missing a step, or do I need to user a newer version matlab?