Discrete system solving with MATLAB
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ismail
am 29 Nov. 2012
Beantwortet: Ajay Kumar
am 8 Feb. 2021
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 Kommentar
Mansoor Khalid
am 25 Mai 2019
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).
Akzeptierte Antwort
Azzi Abdelmalek
am 29 Nov. 2012
Bearbeitet: Azzi Abdelmalek
am 29 Nov. 2012
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 Kommentare
Azzi Abdelmalek
am 29 Nov. 2012
Bearbeitet: Azzi Abdelmalek
am 29 Nov. 2012
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
am 29 Nov. 2012
Bearbeitet: Azzi Abdelmalek
am 29 Nov. 2012
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)
Weitere Antworten (5)
Ismail
am 30 Nov. 2012
1 Kommentar
Azzi Abdelmalek
am 30 Nov. 2012
Ismail I'am not doing all your homework, you have to do some efforts.
Ismail
am 30 Nov. 2012
2 Kommentare
Sara Hafeez
am 30 Nov. 2012
once you know the above its very easy to use it for the other question also.
Md. Anwar Hossain
am 3 Apr. 2019
Yn{n}=5{x[n]}^2 This equation solve for mat lab work plz help me
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!