WienIdentForSmallInputs

# WienIdentForSmallInputs - % Identification of Wiener model....

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % Identification of Wiener model. Be carefull with this simulation. Breakaway point nonlinearity is used % By using small signals the filter and a gain is estimated by changing the % role of inputs and outputs. No noise is used thats why nice results are % obtained. In % order to obtain v_t values (is it v_t?) the estimated filter is used. The % output of this estimated filter is multiplied by a gain and is added to % the overall output. Later on this is done: the output of the estimated % filter and the overall system's output are plotted against each other and % that way the nonlinearity is obtained. But still be carefull with the % fact that there is no noise. %% -------- Try it for various nonlinearities. ---------------------------- clear all u=.15*normrnd(0,2,1,1000); % A white gaussian input sequence u with length %1000 0 mean and standard deviation 2 ut=.1*normrnd(0,2,1,200); %input for testing. % e=normrnd(0,.2,1,1000); % A white gaussian with zero mean and standart de %viation .2 with length 1000. it is error term z =zeros(1,1000); a = [2.09 -2.063 1.209 -.4656 .1164 -.02975] ; % ai s b = [1 .8 .3 .4] ; N=400; r=7; m=6; % sg = 5; % bi s % now we will get the input output data. The last 200 datapoints will be % used for training % for t = 1:1000 if (t==1) z(1,t) = b(1,t)*u(1,1); e = z(1,t); if (-10&lt;e &amp;&amp; e&lt;10) y(1,t) = -2*(z(1,t)); % following was before: sinc(z(1,t))*z(1,t)^2 ;% no +e(1,t); % b(1,t)*sinc(u(1,1))*(u(1,1)^2) + e(1,t); end if (e&lt;-10 &amp;&amp; e&gt;-20) y(1,t)= .5*(z(1,t)) -5 ; end if (e&lt;20 &amp;&amp; e&gt;10) y(1,t)= .5*(z(1,t)) +5 ; end if(e&gt;20) y(1,t) = 1*(z(1,t))-5 ; end if(e&lt;-20) y(1,t) = 1*(z(1,t))+5 ; end end if (1&lt;t&amp;&amp;t&lt;=6) sm1 = 0; for i = 1:t-1 sm1 = sm1 + a(1,i)*z(1,t-i); % sm1 = sm1 + a(1,i)*y(1,t-i); end sm2 = 0; if(t&lt;4) for j = 1:t sm2 = sm2 + b(1,j)*u(1,t-j+1); % sm2 = sm2 + b(1,j)*sinc(u(1,t-j+1))*(u(1,t-j+1)^2); end else for i = 1:4 sm2 = sm2 + b(1,i)*u(1,t-i+1); % sm2 = sm2 +b(1,i)*sinc(u(1,t-i+1))*(u(1,t-i+1)^2); end end z(1,t) = sm1 + sm2 ; e = z(1,t); if (-10&lt;e &amp;&amp; e&lt;10) y(1,t) = -2*(z(1,t)); % following was before: sinc(z(1,t))*z(1,t)^2 ;% no +e(1,t); % b(1,t)*sinc(u(1,1))*(u(1,1)^2) + e(1,t); end if (e&lt;-10 &amp;&amp; e&gt;-20) y(1,t)= .5*(z(1,t)) -5 ; end if (e&lt;20 &amp;&amp; e&gt;10) y(1,t)= .5*(z(1,t)) +5 ; end if(e&gt;20) y(1,t) = 1*(z(1,t))-5 ; end if(e&lt;-20) y(1,t) = 1*(z(1,t))+5 ; end end if (t&gt;6) sm1 = 0; for i = 1:6 sm1 = sm1 + a(1,i)*z(1,t-i); % sm1 = sm1 + a(1,i)*y(1,t-i); end sm2 = 0; for i = 1:4 sm2 = sm2 + b(1,i)*u(1,t-i+1); % sm2 = sm2 +b(1,i)*sinc(u(1,t-i+1))*(u(1,t-i+1)^2); end...
View Full Document

## This note was uploaded on 07/04/2011 for the course ECE 501 taught by Professor Deniz during the Spring '11 term at Istanbul Universitesi.

### Page1 / 7

WienIdentForSmallInputs - % Identification of Wiener model....

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online