

% Formatting

fSize = 16;

for i = 1:2

    subplot(2,1,i);

    set(gca,'FontSize',fSize);

end



n = 0:N;

subplot(211);

stem(n,b);

xlim([0 N]);

ylim([-0.1 0.2]);

xlabel('n');

ylabel('Amplitude');

grid on;

title('Filter impulse response h[n]');



subplot(212);

[H w] = freqz(b,1,N);

f = 125/N*(0:N-1);

H = 10*log10(abs(H));

plot(f,H);

xlim([min(f) max(f)]);

grid on;

xlabel('Frequency (Hz)');

ylabel('Filter gain,  (dB)');

ylim([-60 20]);

title('Filter transfer function |H(f)|');



