Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc;
- clear all;
- x=ones(1,8);
- windowSize = 5;
- h=(1/windowSize)*ones(1,windowSize);
- a=1;
- y=filter(h,a,x);
- figure;
- stem(x, '--b');
- hold on;
- stem(y, '--r');
- grid;
- xlabel('n')
- title('Signal x filtered through h')
- legend( 'Signal x' ,'Filtered Signal y');
- z=filter(h,a,y);
- figure;
- stem(x, '--b');
- hold on;
- stem(z, '--g');
- grid;
- xlabel('n')
- title('Signal y filtered through h')
- legend( 'Signal y' ,'Filtered Signal z');
- w=filter(h,a,z);
- figure;
- stem(x, '--b');
- hold on;
- stem(w, '--k');
- grid;
- xlabel('n')
- title('Signal z filtered through h')
- legend( 'Signal z' ,'Filtered Signal w');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement