How to enter vector coefficients to z-transform

8 ビュー (過去 30 日間)
TeraWatt
TeraWatt 2023 年 11 月 20 日
回答済み: Paul 2023 年 11 月 21 日
I have this z-tf:
Hz = g *(1 + 2*z^-1 + z^-2) / ( 1 + a1*z^-1 + a2*z^-2)
where g = [2,2.2,2.3] , a1 = [2, 5,8] and a2 =[ 1,0.3,0.4]
how can I get all 4's Hz (TF) directly by using the vector coeficients?
  2 件のコメント
Paul
Paul 2023 年 11 月 20 日
Hi TeraWatt,
Seems like there should only be three transfer functions.
What is the desired form? A single system with three inputs and three outputs? An 3-element array of single-input/single-outpu transfer functions? Something else?
TeraWatt
TeraWatt 2023 年 11 月 21 日
I would like to see the numerator and denomitaor as multiple of z^(-1).
The system will receive three inputs and should respond with three outputs , each one independent from the other two

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2023 年 11 月 20 日
編集済み: Walter Roberson 2023 年 11 月 20 日
z = tf('z')
z = z Sample time: unspecified Discrete-time transfer function.
g = [2,2.2,2.3] .';
a1 = [2, 5,8] .';
a2 =[ 1,0.3,0.4] .';
HZ = arrayfun(@(G,A1,A2) G * (1 + 2*z^-1 + z^-2) / ( 1 + A1*z^-1 + A2*z^-2), g, a1, a2, 'uniform', 0);
HZ = vertcat(HZ{:})
HZ = From input to output... 2 z^6 + 4 z^5 + 2 z^4 1: --------------------- z^6 + 2 z^5 + z^4 2.2 z^6 + 4.4 z^5 + 2.2 z^4 2: --------------------------- z^6 + 5 z^5 + 0.3 z^4 2.3 z^6 + 4.6 z^5 + 2.3 z^4 3: --------------------------- z^6 + 8 z^5 + 0.4 z^4 Sample time: unspecified Discrete-time transfer function.
  1 件のコメント
TeraWatt
TeraWatt 2023 年 11 月 21 日
編集済み: TeraWatt 2023 年 11 月 21 日
Thanks very much. it works.
One more thing, How to force the elements of the numerator and denominator as multiple of z^(-1)?

サインインしてコメントする。

その他の回答 (1 件)

Paul
Paul 2023 年 11 月 21 日
g = [2,2.2,2.3];
a1 = [2, 5,8];
a2 =[ 1,0.3,0.4];
HZ = tf(zeros(3),'Ts',-1);
for ii = 1:3
HZ(ii,ii) = tf(g(ii)*[1 2 1],[1 a1(ii) a2(ii)],-1,'Variable','z^-1');
end
HZ
HZ = From input 1 to output... 2 + 4 z^-1 + 2 z^-2 1: ------------------- 1 + 2 z^-1 + z^-2 2: 0 3: 0 From input 2 to output... 1: 0 2.2 + 4.4 z^-1 + 2.2 z^-2 2: ------------------------- 1 + 5 z^-1 + 0.3 z^-2 3: 0 From input 3 to output... 1: 0 2: 0 2.3 + 4.6 z^-1 + 2.3 z^-2 3: ------------------------- 1 + 8 z^-1 + 0.4 z^-2 Sample time: unspecified Discrete-time transfer function.

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by