% ex8.3 % FIR filter h=fir1(40,0.5); [h1,f1] = freqz(h,1,512,1); % IIR filter [b,a]=butter(20,0.5); [h2,f2] = freqz(b,a,512,1); % Plot on same axes plot(f1,20*log10(abs(h1)+eps),f2,20*log10(abs(h2)+eps)); xlabel('Frequency'); ylabel('Magnitude (dB)');