0% found this document useful (0 votes)
67 views2 pages

To Write A MATLAB Program To Find The Total Response of A System Defined by A Difference Equation

This MATLAB program defines a difference equation as y(n)-y(n-1)+0.9y(n-2)=x(n). It then plots the impulse and step responses of the system for values of n from -20 to 100. Filter commands are used to generate the responses based on the difference equation definition and input signals x(n).

Uploaded by

Aniket Sankpal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views2 pages

To Write A MATLAB Program To Find The Total Response of A System Defined by A Difference Equation

This MATLAB program defines a difference equation as y(n)-y(n-1)+0.9y(n-2)=x(n). It then plots the impulse and step responses of the system for values of n from -20 to 100. Filter commands are used to generate the responses based on the difference equation definition and input signals x(n).

Uploaded by

Aniket Sankpal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

To write a MATLAB program to find the total response of a system defined by a difference equation.

%Let the difference equation be y(n)-y(n-1)+0.9y(n-2)=x(n) %To plot the impulse and step response for n = -20.-19,....100 clc; %Clear the command window

b=[1]; a=[1 -1 0.9]; n=[-20:100];

%Generating the impulse response x=[n==0]; y=filter(b,a,x); subplot(2,1,1) stem(n,y,'.') xlabel('Values of N') ylabel('h(n)') title('Impulse response') %Generating the step response x=[n>=0]; y=filter(b,a,x); subplot(2,1,2) stem(n,y,'.') xlabel('Values of N') ylabel('s(n)') title('Step response') COMMAND WINDOW OUTPUT ::PROGRAM TO FIND THE TOTAL RESPONSE FROM THE DIFFERENCE EQUATION::>

The values for the total response for given differential equation are ::4 13 24 31 -42

calculated

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy