The numerator returned from ord2 function is not directly compatible with tf2zpk function.

조회 수: 5 (최근 30일)
Background
Let's say there's a design requirement to build an overdamped closed loop system, such that second order LTI LPF ZIC prototype transfer function is choosen with omega_n = 1 rad/s and zeta = 2.
[num,den] = ord2(1,2)
sys = tf(num,den)
Then the output on the command window will be
num =
1
den =
1 4 1
sys =
Transfer function:
1
-------------
s^2 + 4 s + 1
Problem
This is a trouble if i want to convert it directly to zpk model.
[num,den] = ord2(1,2)
[z,p,k] = tf2zpk(num,den)
sys = zpk(z,p,k)
The output on the command window will be
num =
1
den =
1 4 1
z =
0
0
p =
-3.7321
-0.2679
k = 1
sys =
Transfer function:
s^2
-------------------
(s+3.732) (s+0.2679)
This is clearly different as we now have zeros in the transfer function.
Proposed Solution
The num returned by ord2 should be [0 0 1] instead of just 1.
I guess the problem was overlooked because they came from different toolboxes, ord2 came from Control System Toolbox while tf2zpk came from Signal Processing Toolbox.
And also the prototype given by ord2 is only LPF, there are other prototypes such as HPF, APF (all-pass filter), BPF, BSF.
  댓글 수: 1
James Richard
James Richard 2022년 7월 31일
편집: James Richard 2022년 7월 31일
My current solution would be
[num,den] = ord2(1,2)
sys = tf(num,den)
sys = zpk(sys)
But by doing this way i have to extract z, p, k again from the sys using zpkdata if i want to use it. It's just one extra step, but may be worth to explain it here.
[z, p, k] = zpkdata(sys)
I'm not sure how to format my whole post here, I just want to share my problem so that someone could google it and let other answer if they think they have better solution.

댓글을 달려면 로그인하십시오.

채택된 답변

Paul
Paul 2022년 7월 31일
편집: Paul 2022년 7월 31일
Hi James,
I'm not sure this really is a problem; all functions are working as documented. A shorter way to get the z,p,k of the continuous time representation is
[num,den] = ord2(1,2);
[z,p,k] = tf2zp(num,den)
z = 0×1 empty double column vector
p = 2×1
-3.7321 -0.2679
k = 1
For sure, be careful when mixing functionality from different toolboxes.
  댓글 수: 1
James Richard
James Richard 2022년 7월 31일
Ok my fault. It's clearly documented. This is not because of mixing functionally. But my wrong intuition.
Who whould've tought that just small chamge in letter of k between tf2zpk and tf2zp could change night and day.
It should be renamed into tf2zpkpos tf2zpkneg or something better...

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by