Question
matlab and comment please
In this exercise we learn how to solve constant-coefficient difference equation using Mat lab. Also, we investigate the respo
only need (D)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

(D) MATLAB CODE:

clc
clear all
close all

syms n z
% By the application of Z-Transform to given difference equation
% we got the transfer function H(z) as given below

H(z) = (1.62+1.8*z^(-1)+2*z^(-2))/(1+0.9*z^(-1)+0.81*z^(-2));

u(n) = heaviside(n)+(1/2)*kroneckerDelta(n,0);% Unit step sequence
r(n) = n*u(n); % Unit Ramp
x(n) = r(n) - r(n-25); % Given input x[n]

X(z) = ztrans(x(n),n,z);    % Z-Transform of x[n]
Y(z) = H(z)*X(z);
y(n) = iztrans(Y(z),z,n);

n = 0:24;

subplot(2,1,1)   % Plot of x[n]
stem(n,x(n))
xlabel('n')
title('x[n]')

subplot(2,1,2)   % Plot of y[n]
stem(n,y(n))
xlabel('n')
title('y[n]')

OUTPUT:

x[n] 25 20 15 10 5 25 20 15 10 n y[n] 50 45 40 35 30 25 20 15 10 25 20 15 10

Add a comment
Know the answer?
Add Answer to:
matlab and comment please only need (D) In this exercise we learn how to solve constant-coefficient...
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
  • Solve using MATLAB (1) Consider the difference equation given follows as у(п) — — 0.9у(п -...

    Solve using MATLAB (1) Consider the difference equation given follows as у(п) — — 0.9у(п - 1) — 0.81у(n — 2) + 1.62г(п) + 1.82(п — 1) + 2ar (п — 2), п > 0. Find and plot x(n) and y(n) and hence find the energy of y(n) for the following cases (а) 2(п) — 8(п — 2) (b) 2(п) — и(п) 6(п — 3) _ (с) г(п) — и(п)u(-п + 23) _ (d) x(n)r(n) - r(n - 25), where...

  • matlab please matlab please (4) Consider the system described by the following difference equation y(n)1.77y(n-1)-0.81y(n 2)a(n)-...

    matlab please matlab please (4) Consider the system described by the following difference equation y(n)1.77y(n-1)-0.81y(n 2)a(n)- 0.5(n -1) (a) Assuming a unit-step input, and using a long enough section of the input constant output y(n) is observed for large n, hence plot the output and determine the value of this constant called G so that a Note: G, y(n) for n0o. (b) Determine and plot the transient response given by: n(n) = y(n)- Go (c) Find the energy of the...

  • follows (3) Consider the difference equation given as у(п) %3 0.75у(п — 2) + z(п) —...

    follows (3) Consider the difference equation given as у(п) %3 0.75у(п — 2) + z(п) — 2(n — 1) — z(п — 2). (a) Draw the block diagram of the above difference equation in terms of adders, multi pliers and delay blocks (b) How many multiplications and additions do we need per sample? (c) Find the output y(n) for an input x(n) = S(n). What is this response called? Is the system stable? unit-step input. (d) Find the response due...

  • Please solve using the Discrete-Time Fourier Transform: Given a filter described by the difference equation y[n]...

    Please solve using the Discrete-Time Fourier Transform: Given a filter described by the difference equation y[n] = x[n] + 2x[n - 1] + x[n - 3] where x[n] is the input signal and y[n] is the output signal. a) Find H[n] the impulse response of the filter. b) Plot the impulse response c) Find the value of H( Ω) for the following values of Ω = 0, pi, pi/2, and pi/4

  • please matlab code result is important 5. Consider a system with a cascade connection of two...

    please matlab code result is important 5. Consider a system with a cascade connection of two causal LTI systems: • Frequency response of the first system is H, (e) 1-2 and The impulse response of the second system is h, [n] = 5()'u[n] The input to the system is x[n], the output of the first system is w[n) and the output of the overall (complete) system is yn). a. Find the difference equation relating i. The input x[n) to the...

  • #5 is only I need in which we need to plot it on Matlab and I...

    #5 is only I need in which we need to plot it on Matlab and I don't know how to plot it. Project 1 A Vibration Insulation Problem Passive isolation systems are sometimes used to insulate delicate equipment from unwanted vibrations. For example, in order to insulate electrical monitoring equipment from vibrations present in the floor of an industrial plant, the equipment may be placed on a platform supported by flexible mountings resting on the floor. A simple physical model...

  • please explain how to do step 5 in matlab commands. med at x=c. 2 The first derivative Ne Scr We investigate the function f(x) 4 12x3+9x2. >> x-linspace (-3,3) >> y-41x.^4-12*x.^3 &gt...

    please explain how to do step 5 in matlab commands. med at x=c. 2 The first derivative Ne Scr We investigate the function f(x) 4 12x3+9x2. >> x-linspace (-3,3) >> y-41x.^4-12*x.^3 >> plot (x,y), grid 9*x."2; + A plot over the interval I-3,3] reveals an apparent "flat section"' with no visible relati extrema. To produce a plot that reveals the true structure of the graph, we replot over the interval [-1,2]: >> x=linspace (-1,2); >> y= 4 * x. ^4-12*x.^3...

  • QUESTION 5 please. 4. MATLAB can solve second order equations numerically, but it needs to convert...

    QUESTION 5 please. 4. MATLAB can solve second order equations numerically, but it needs to convert it to a sys- tem first. We haven't covered systems yet, but we can make use of them (entirely in MAT- LAB) to solve this problem. The help page https://www.mathworks.com/help/symbolic/ solve-differential-equation-numerically-1.html shows how to do this. Follow those steps to get the solution to day +9y = cos(3) dt2 y(0) = 0 v(0) = 0 Plot this and your solution from the previous part...

  • SOLVE USING MATLAB ONLY AND SHOW FULL CODE. PLEASE TO SHOW TEXT BOOK SOLUTION. SOLVE PART D ONLY

    SOLVE USING MATLAB ONLY AND SHOW FULL CODE. PLEASE TO SHOW TEXT BOOK SOLUTION. SOLVE PART D ONLY Apply Euler's Method with step sizes h # 0.1 and h 0.01 to the initial value problems in Exercise 1. Plot the approximate solutions and the correct solution on [O, 1], and find the global truncation error at t-1. Is the reduction in error for h -0.01 consistent with the order of Euler's Method? REFERENCE: Apply the Euler's Method with step size...

  • IF THE POLES OF THE LOCATED AT. b) H(근) のUSE-MATLAS TO PLOT IHI»)! oAT KIN OF A FILTER IS IT? ...

    stuck on this question, please show all your work step by step, thank you. IF THE POLES OF THE LOCATED AT. b) H(근) のUSE-MATLAS TO PLOT IHI»)! oAT KIN OF A FILTER IS IT? 171 53 lilustrative Examples 5.3 ILLUSTRATIVE EXAMPLES Example 5.3-1: The following difference equation is known as the first- order trapezoidal integration rule in numerical analysis: n) - ) n-O (531) Find: The transfer function. The impulse response. The output if the input is the unit step...

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