ImpulseResponse

# ImpulseResponse - sinc(u(1,t-i 1(u(1,t-i 1)^2 end y(1,t =...

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

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 a = [2.789 -4.591 5.229 -4.392 2.553 -.8679] ; a2=[1 -a]; % ai s b = [1 .8 .3 .4] ; N=200; r=7; m=3; % bi s % now we will get the input output data. The last 200 datapoints will be % used for training u = zeros(1,500); e = zeros(1,500); u(1,1) = 1; u for t = 1:500 if (t==1) y(1,t) = b(1,t)*u(1,1) ; % sinc(u(1,1))*(u(1,1)^2) + e(1,t); % end sm1 = 0; for i = 1:t-1 sm1 = sm1 + a(1,i)*y(1,t-i); end sm2 = 0; if(t<4) for j = 1:t sm2 = sm2 + b(1,j)*u(1,t-j+1); %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); %sinc(u(1,t- i+1))*(u(1,t-i+1)^2); % end end y(1,t) = sm1+sm2 ; %+ e(1,t); end if (t>6) sm1 = 0; for i = 1:6 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);

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: % sinc(u(1,t-i+1))*(u(1,t-i+1)^2); % end y(1,t) = sm1 + sm2 ; %+ e(1,t); end % if (t>r)% no need for this "if" here % x(:,t) = [y(t-1:-1:t-n) u(t:-1:t-m) ]'; % end end figure(1);stem(y(1:200)); title('y : outputs') figure(2);impz(b,a2,200); title(' response of "impz(b,a2)" ') % for t = 1:400 % if (t==1) % y(1,t) = b(1,t)*sinc(u(1,1))*u(1,1)^2 + e(1,t); % end % % if (1<t&&t<=6) % sm1 = 0; % for i = 1:t-1 % sm1 = sm1 + a(1,i)*y(1,t-i); % end % sm2 = 0; % if(t<4) % for j = 1:t % 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)*sinc(u(1,t-i+1))*u(1,t-i+1)^2; % end % end % y(1,t) = sm1+sm2 + e(1,t); % end % if (t>6) % sm1 = 0; % for i = 1:6 % sm1 = sm1 + a(1,i)*y(1,t-i); % end % sm2 = 0; % for i = 1:4 % sm2 = sm2 +b(1,i)*sinc(u(1,t-i+1))*u(1,t-i+1)^2; % end % y(1,t) = sm1 + sm2 + e(1,t); % end % end % Impulse response of hammerstein model % figure(2) % plot(y) % figure(3) % stem(y)...
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

ImpulseResponse - sinc(u(1,t-i 1(u(1,t-i 1)^2 end y(1,t =...

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

View Full Document
Ask a homework question - tutors are online