impulse response from transfer function in matlab

i have a transfer function given by
H(z)= 1-z^(-1)/1-z^(-1)+z^(-2)
how to find its impulse response h(n) in matlab what is the code for the same ?

 採用された回答

Star Strider
Star Strider 2016 年 1 月 12 日

2 投票

This is how I would do it:
% H(z)= 1-z^(-1)/1-z^(-1)+z^(-2)
b = [1 -1];
a = [1 -1 1];
figure(1)
impz(b,a)

7 件のコメント

pavan sunder
pavan sunder 2016 年 1 月 12 日
Thanks bro. would you also kindly help me with plotting the poles and zeros of the same transfer function in Z plane..
Star Strider
Star Strider 2016 年 1 月 12 日
Sure. Use the zplane function:
b = [1 -1];
a = [1 -1 1];
figure(2)
zplane(b,a)
pavan sunder
pavan sunder 2016 年 1 月 12 日
i tried this option but i did not get the plot;
pavan sunder
pavan sunder 2016 年 1 月 12 日
hey sorry bro.i got the plot. the mistake was was i had not entered figure command..anyways thanks ! :)
Star Strider
Star Strider 2016 年 1 月 12 日
My pleasure.
MATLAB will plot in the available figure window, so to get two plots (the first using impz and the second using zplane), you have to specify two separate figures.
M.Moksha laxmi
M.Moksha laxmi 2021 年 2 月 21 日
In the same problem what should I do if I want to plot the step response?
Star Strider
Star Strider 2022 年 1 月 12 日
Use the stepz function
% H(z)= 1-z^(-1)/1-z^(-1)+z^(-2)
b = [1 -1];
a = [1 -1 1];
figure(1)
impz(b,a)
figure(2)
stepz(b,a)
.

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

その他の回答 (1 件)

Abdul Jabbar
Abdul Jabbar 2016 年 12 月 10 日

0 投票

z^-1 -4z^-2 -2z^-4 can any one tell me that how i can find the impulse response of this function?

2 件のコメント

Petar Mostarac
Petar Mostarac 2023 年 12 月 8 日
編集済み: Petar Mostarac 2023 年 12 月 8 日
Is this a joke? :)
It is -1, -4 0 -2 and zeros to inf.
z^-1 is one sample delay, one step delay
Formarly, use basic knowladge to find H(z) in form H=b/a and then you can use:
h=impz(b,a, length_of_impulse_response)
In your question: b=[1 -4 0 -2] and a=[1 0 0 0]
If it is a joke, then is a good one :)
Paul
Paul 2023 年 12 月 8 日
Actually, the solution with impz should have: b = [0 1 -4 0 -2]

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

カテゴリ

タグ

質問済み:

2016 年 1 月 12 日

コメント済み:

2023 年 12 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by