%% HW-7 Problem 1 - Plot frequency response

%%% as, bs are coefficient vectors for the analog filter
%%% az, bz are coefficient vectors for the digital filter
%%% Determine your as, bs, az, bz = ?

T=3;
[hs,ws]=freqs(bs,as);
[hz,wz]=freqz(bz,az);

figure(1)
subplot(2,1,1)
semilogx(ws*T/pi,20*log10(abs(hs)),wz/pi,20*log10(abs(hz)))
legend('H_s(c)','H(z)')
xlabel('Normalized Frequency (\times\pi rad/sample)')
ylabel('Magnitude (dB)')
grid on

subplot(2,1,2)
semilogx(ws*T/pi,180*angle(hs)/pi,wz/pi,180*angle(hz)/pi)
legend('H_s(c)','H(z)')
xlabel('Normalized Frequency (\times\pi rad/sample)')
ylabel('Phase (degress)')
grid on



