clc;
close all;
clear;

fc =  1000;
wc=2*pi*fc;
fs = 10000;
Ts=1/fs;
f  = 1:fs/2;

B=[0 0 1];
A=[1/wc^2 sqrt(2)/wc 1];

SYS_c = tf(B,A);
[MAG0,PHASE0]=bode(SYS_c,2*pi*f);
SYS_d_zoh = c2d(SYS_c,Ts,'zoh');
[MAG,PHASE]=bode(SYS_d_zoh, 2*pi*f);

figure;
semilogx(f, 20*log10(abs(squeeze(MAG0))+eps), 'b.-');
hold on;
semilogx(f, 20*log10(abs(squeeze(MAG))+eps), 'c');
grid on;
axis([100 fs/2 -100 0]);
legend('Analog filter', 'Zero-order hold');
hold off;
