ltifilt - sm2 = sm2 + b(1,j)*u(1,t-j+1);...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% This function finds output of linear time invariant system. given input % number of cycles and filter coefficents. % N: # of cycles % u: input to lti filter % b: numerator coefficients of lti filter % a: denumerator coefficients of lti filter % function [y] = ltifilt(N,u,b,a) Nt = N; u =u; for t = 1:Nt 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
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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&gt;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); % sinc(u(1,t-i+1))*(u(1,t-i+1)^2); % end y(1,t) = sm1 + sm2 ; %+ e(1,t); end end figure(1);stem(y()); title('y : outputs')...
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.

Ask a homework question - tutors are online