MATLAB: Converting Analog Filter into Digital Filter

analog filterdigital filterfilterfilter designMATLAB

Hello. I'm trying to design a simple Digital Filter. The transfer function of the filter is: 1 / s + alpha Where 'alpha' is a parameter (0.2).
Hence the Cutoff frequency is 0.2Hz.
I use the following code:
alpha = 0.2;
fs = 200; % Sample Frequency [Hz]
% Laplace Domain
B = 1;
A = [1, alpha];
w = 0:0.2:(fs / 2);
h = freqs(B, A, w);
figure;
plot(w, abs(h .* conj(h)));
% Digital Filter
[b, a] = bilinear(B, A, fs);
figure;
freqz(b, a, 1000);
As you can see, in the Freqs plot it works well. the Cutoff frequency is indeed 0.2Hz.
Yet it's not in the Digital Filter.
I tried using 'impinvar' as well with the same results.
How can I design the most accurate digital equivalent of this filter?
I'm using MATLAB R2011a.
Thanks.

Best Answer

sys_cont = tf(B,A);
sys_disc = c2d(sys_cont,1/fs);
bode(sys_cont,sys_disc,w);
HTH,
Arnaud