필터 지우기
필터 지우기

Does c2d function has some limitations? Not working properly

조회 수: 7 (최근 30일)
Mike B
Mike B 2014년 6월 8일
답변: Radha Krishna Maddukuri 2014년 10월 29일
Hi all.
I have a continuous model and want to use c2d function to transfer it in discrete for further digital implementation in processor.
This is the part of the code:
Tsample = 1e-4;
H = tf([(2*pi*50)^2], [1 2*(2*pi*50) (2*pi*50)^2]);
Hd = c2d(H, Tsample, 'foh');
Depending on the Tsample I get different transfer functions, which is according to theory :)
But when I do comparison between continuous and discrete transfer function in Simulink I get different response (amplitude is different (red and green signal)). If I decrease Tsample more (e.g. 50e-6) amplitude difference gets even higher.

답변 (1개)

Radha Krishna Maddukuri
Radha Krishna Maddukuri 2014년 10월 29일
While the TF and ZPK representations are compact and convenient for display purposes, they are not ideal for system manipulation and analysis for several reasons:
  • Working with TF and ZPK models often results in high-order polynomials whose evaluation can be plagued by inaccuracies.
  • The TF and ZPK representations are inefficient for manipulating MIMO systems and tend to inflate the model order.
For more information and an example, please check the web link: Using the Right Model Representation .
So a fix for your particular example would be to use State-Space Representation instead of Transfer Function:
>> Tsample1 = 1e-4;
>> Tsample2 = 1e-3;
>> num = [(2*pi*50)^2];
>> den = [1 2*(2*pi*50) (2*pi*50)^2];
>> H = tf(num,den);
>> sys = ss(tf(num,den));
>> Hd1 = c2d(sys,Tsample1,'foh');
>> Hd2 = c2d(sys,Tsample2,'foh');
>> bode(H,Hd1,Hd2);
Now you can see that using different sample times should still produce similar results.

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by