I'm trying to implement and discretize a notch filter (Chebyshev type I) these specifications:

Ws = 2pi[2000 2500]; Wp = 2pi[1000 7000]; Rp = 0.5; Rs = 40;

But when I try to use discretization methods, Tustin has a weird phase graph, and ZOH has also a weird behaviour. I couldn't find anything online that would explain those behaviours. Could anyone help me?

enter image description here Discretization matlab code:

% continuos to discrete
Ws = 2*pi*[2000 2500];
Wp = 2*pi*[1000 7000];
Rp = 0.5;
Rs = 40;
[n,Wp] = cheb1ord(Wp,Ws,Rp,Rs,'s');
[b,a] = cheby1(n,Rp,Wp,'stop','s');
H = tf(b,a);

Hbi = c2d(H,1/20000,'tustin');
Hzoh = c2d(H,1/20000,'zoh');
Hm = c2d(H,1/20000,'matched');
Hdp = c2d(H,1/20000,'prewarp',2*pi*2250);
%Hii = c2d(H,1/20000,'impulse');
options = bodeoptions;
options.FreqUnits = 'Hz'; % or 'rad/second', 'rpm', etc.
bode(H,'b',Hzoh,'r',Hbi,'m',Hm,'g', Hdp, 'y',{2*pi*100 2*pi*10000}, options), grid
legend('Continuous','ZOH','Tustin','Matched','Tustin w/ pre-warping')

Thanks in advance!

  • $\begingroup$ Why are you using bode() for the discrete transfer functions? That's only for your initial t.f., the rest need freqz(). $\endgroup$ – a concerned citizen May 28 at 8:49
  • $\begingroup$ mathworks.com/help/control/ug/discretizing-a-notch-filter.html Actually I was following this matlab documentation, that uses bode after c2d $\endgroup$ – Caroline May 28 at 12:21
  • $\begingroup$ Why don't design it directly in the discrete domain ? $\endgroup$ – Hilmar May 28 at 13:29
  • $\begingroup$ @Hilmar, that's because I'm doing a study specifically on these transformation methods. Do you know why I'm having these behaviours? $\endgroup$ – Caroline May 28 at 14:51
  • $\begingroup$ @Caroline Hmm, looks like Octave can't do that. Maybe there are numerical problems? Try not using kHz, but Hz, to tame the numbers. $\endgroup$ – a concerned citizen May 28 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.