% file: task22.m
% For the following filters:
%    - lowpass/highpass/bandpass/...
%    - order
%    - IIR or FIR
%    - flow/block diagram 
%      http://www.cis.hut.fi/Studies/T-61.246/Suodin/
B1  = [1  1  1]/3; % H(e^jw) = (1 + e^-jw + e^-j2w)/3
A1  = [1];         % order: max{order(B),order(A)}=2
figure(1); clf; myplot(B1, A1);
B2  = [1  -1];     % H(e^jw) = 1 - e^-jw
A2  = [1];
figure(2); clf; myplot(B2, A2);
B3  = [1  0  -1];  % 2nd order
A3  = [1  0   0.9];% A3 = [1 0 1] <-> not stable!
figure(3); clf; myplot(B3, A3);
B4  = [0.1  -0.2  0.3  1];  % 3rd order
A4  = [1  0.3  -0.2 0.1];   % all-pass IIR filter
figure(4); clf; myplot(B4, A4);
