Discrete system solving with MATLAB

Hello ! question : y[n]+1/4*y[n-1]-1/8y[n-2]=x[n] this discrete system , how do i solve it with matlab ? must i do z transform ? what is z transform code ? we will do h(z)=y(z)/x(z) and we find roots..??

1 件のコメント

Mansoor Khalid
Mansoor Khalid 2019 年 5 月 25 日
Consider an input of a signal given as x(n)={1,2,3} and the impulse response of a system given as h(n)={4,5,6} for 0< equal n < equal 3 find and sketch the output y(n).

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

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 29 日
編集済み: Azzi Abdelmalek 2012 年 11 月 29 日

1 投票

you will need initials condition y(0) and y(-1); because Matlab don't allow negative index we 'll consider y(2) and y(1) as initials conditions
y(1)=0;
y(2)=0
k=0:20;
x=exp(-2*k); %your input system;
for n=3:numel(k)
y(n)=-(1/4)*y(n-1)+(1/8)*y(n-2)+x(n-2)
end
hold on
stem(k(1:end-2),y(3:end),'r');
Or you can use lsim command
N=[1 0 0];D=[1 1/4 -1/8];
te=1 % Sample time
model=tf(N,D,te);
lsim(model,x,k,[0 0])

3 件のコメント

Ismail
Ismail 2012 年 11 月 29 日
thank you very much your answer , but also i want to find h(z) ? how do i find h(z) with y[n]+1/4*y[n-1]-1/8y[n-2]=x[n] in this equation ((( h(z)=y(z)/x(z) if we solve hand ,we will find this response for h(z) ; 8z^2 / 8z^2-2z-1 =h(z) i want to find it with matlab ?
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 29 日
編集済み: Azzi Abdelmalek 2012 年 11 月 29 日
You are looking for impulse response which means that the input is the Kronecker delta x=[1 0 0 0 0 0 ...]
you can also use the impulse function
N=[1 0 0];D=[1 1/4 -1/8];
te=1 % Sample time
model=tf(N,D,te);
impulse(model)
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 29 日
編集済み: Azzi Abdelmalek 2012 年 11 月 29 日
Ah I did'nt well read your comment. I also did'nt understand your question, you transfer function H(z) is already given by model
N=[1 0 0];D=[1 1/4 -1/8];
te=1 % Sample time
model=tf(N,D,te)

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

その他の回答 (5 件)

Ismail
Ismail 2012 年 11 月 29 日

0 投票

haha Mr.Abdelmaek ,you are very good so thank you very much really, you save me get 0 mark at homework signal and system course ,really thank you :)
Ismail
Ismail 2012 年 11 月 30 日

0 投票

ok , now how will i conversion z transform to unit step function ? i must find result like ; h[n]=(0.25)^nu[n]+(0.5)^nu[n]
Thank you

1 件のコメント

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 30 日
Ismail I'am not doing all your homework, you have to do some efforts.

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

Ismail
Ismail 2012 年 11 月 30 日

0 投票

yeah i am trying do it but i don't know using matlab in signal systems ,because my university give education using matlab in electrical circuit :(..

2 件のコメント

Sara Hafeez
Sara Hafeez 2012 年 11 月 30 日
once you know the above its very easy to use it for the other question also.
Sara Hafeez
Sara Hafeez 2012 年 11 月 30 日
you will be using step instead of impulse then.

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

Md. Anwar Hossain
Md. Anwar Hossain 2019 年 4 月 3 日

0 投票

Yn{n}=5{x[n]}^2 This equation solve for mat lab work plz help me
Ajay Kumar
Ajay Kumar 2021 年 2 月 8 日

0 投票

y(n)=e^-2n

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2012 年 11 月 29 日

回答済み:

2021 年 2 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by