Question

Practical 2: • A. Solve the following difference equations using the sequential method: y[k] – y[k – 1] = x[X] + x[k – 1] whe
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please feel free to ask doubts in the comment sectio.
Since this not feasible for solving with hands beause finding (0.8)^20 by hand is not a good idea so I guess you wanted the solutions using MATLAB but if you wanted handwritten solutions just tell me in comments and I will upload hand written solutions too.

1.

close all;
clear;
clc;

y = 0;
k = 0:25;
x = (0.8).^k;
for n=2:25
   y(n) = y(n-1) + x(n) +x(n-1);
end


stem(0:20,x(1:21));
xlabel("n");
hold on
stem(0:20,y(1:21));
title("Plot for input and output");
legend("x(n)","y(n)");

Plot for input and output - yon) 8 P 12

2.

close all;
clear;
clc;

syms z n x(n) y(n) X Y;
eqn = y(n) + 2.5*y(n-1)+y(n-2) == x(n) + x(n-1);
eqn_z = ztrans(eqn);
eqn_z = subs(eqn_z,[ztrans(y(n), n, z) ztrans(x(n), n, z)],[X Y]);
eqn_z = subs(eqn_z,[y(-1) y(-2) x(-1)],[0 0 0]);
Y = solve(eqn_z,Y);
H = simplify(Y/X);
disp("The Transfer function in z domain = ");
pretty(H)
assume(n>0);
x(n) = (0.8)^n;
Xx = ztrans(x);
Y = subs(Y,X,Xx);
yn = iztrans(Y);
n_range = 0:20;
stem(n_range,subs(x,n,n_range));
xlabel("n");
hold on;
stem(n_range,subs(yn,n,n_range));
title("Plot for input and output");
legend("x(n)","y(n)");

The Transfer function in z domain = 2 2 2 + 5z + 2 22 (z + 1)

Plot for input and output + - ) yin) 0.5 20

Plot for input and output - yon) 8 P 12

The Transfer function in z domain = 2 2 2 + 5z + 2 22 (z + 1)

Add a comment
Know the answer?
Add Answer to:
Practical 2: • A. Solve the following difference equations using the sequential method: y[k] – y[k...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT