WienHammerIdentNonPar

WienHammerIdentNonPar - end end Yf = y(3:N+2); % construct...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
%% Nonparametric identification of wiener hammerstein system. % Obtain inputs and outputs of model clear all u=normrnd(0,2,1,500); % A white gaussian input sequence u with length %400 0 mean and standard deviation 2 ut=normrnd(0,2,1,200); %input for testing. e=normrnd(0,.2,1,400); % A white gaussian with zero mean and standart de %viation .2 with length 400. it is error term e = zeros(1,400); % this is added after all. actually it should have % been done before v = zeros(1,500); w = zeros(1,500); y = zeros(1,500); K = zeros(200,200);Ker = zeros(200,200); N = 200; r = 7; ny = 2; nu = 2; % N: # of training data a = [.7;.5]; b = [.8;.3]; % u = zeros(1,500);u(1,1) = 1; for k = 1 : 497 v(k+1) = a(1)*v(k) + a(2)*u(k); w(k+1) = sin(v(k+1)); % v(k+1)/(1+v(k+1)); % y(k+2) = b(1)*y(k+1) + b(2)*w(k+1); if( k>7) x(:,k) = [y(k:-1:k-ny) u(k-1:-1:k-nu) ]'; end end %% construct kernel and other submatrices % Kernel matrix for i = 1:200 for j = 1:200 K(i,j) = exp(-((u(i)-u(j))^2)/2);
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: end end Yf = y(3:N+2); % construct overall matrix C = 1000; % Penalty term bigEqMat = [ 0 ones(200,1)' ;... ones(200,1) K + (1/C)*eye(200,200) ]; rigSide = [0 Yf]'; finSolution = bigEqMat\rigSide; d = finSolution(1,1) alph = finSolution(2:end); %% just check it. can you really get estimated y values y_reg = ones(200,1)*d + (K + (1/C)*eye(200,200))*alph; rrr = (y_reg - y(3:202)'); max(rrr); % well it is found to be OK !!! %% check whether the obtained model gives satisfactory outputs for k = 1:200 for i = 1:200 Ker(i,k) = exp(-((u(i)-u(200+k))^2)/2); end y_es(1,200+k+2) = alph'*Ker(:,k) +d; end % aaa = y_es(201:400,1)-y(202:401,1); % figure(2) % plot(aaa); grid on figure(1); plot(u); title('input') figure(2); plot(v); title(' v values'); figure(3); plot(w); title(' w values'); figure(4); plot(y); title(' y : output values'); figure(5); plot(y_es); title(' y_es: models estimated outputs'); f...
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 / 2

WienHammerIdentNonPar - end end Yf = y(3:N+2); % construct...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online