Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Experiment No.

9:
Implementation of Difference Equations

Introduction
An equation that shows the relationship between consecutive values of a sequence and the differences
among them is known as Difference Equation.

A difference equation is any equation that contains a difference of a variable. The classification within
the difference equations depends on the following factors. • Order of the equation. The order of the
equation is the highest order of difference contained in the equation.

A difference equation is one of several tools for expressing the output of a linear time-invariant (LTI)
system as a function of the input. Difference equations are widely used in computational applications to
implement signal-processing algorithms.

Objective
The main objectives of this experiment are:

1. To implement the Difference equation in MATLAB.


2. Learn to use the 'filtic' and 'filter' command.

Design and Caluclations


Example:01

n=[1:50];
den=[1,-1.143,0.4128];
num=[0.0675,0.1349,0.675];
x=zeros(1,50);
Zi=filtic(num,den,[1,2]);
y=filter(num,den,x,Zi);
stem(n,y);
xlabel('t');
ylabel('f(t)');
title('Implementation of Difference Equation');
Issues
No issues were faced during this experiment.

Conlcusion
• A difference equation is one of several tools for expressing the output of a linear time-invariant (LTI)
system as a function of the input.
• In discrete-time systems, essential features of input and output signals appear only at specific instants
of time, and they may not be defined between discrete time steps or they may be constant. These
systems are also called the sequential systems. tn, xtn, xn or x(n) are used to represent the input.
They are described by difference equations.

Applications
• Difference equations are widely used in computational applications to implement signal-processing
algorithms.
• Numerical methods to solve partial differential equation.
• Fourier series.
• Algebra and Analysis.
Lab Assignment Solution
Question:01

n=[1:50];
den=[1,-0.5];
num=[2];
x1=stepseq(0,1,50);
x2=(-1/2).^n;
x=x1.*x2;
Zi=filtic(num,den,[3]);
y=filter(num,den,x,Zi);
stem(n,y);
xlabel('t');
ylabel('f(t)');
title('Implementation of Difference Equation');

Question:02

n=[1:50];
den=[1,-0.75,0.125];
num=[2];
x1=stepseq(0,1,50);
x2=2;
x=x1.*x2;
Zi=filtic(num,den,[1,-1]);
y=filter(num,den,x,Zi);
stem(n,y);
xlabel('t');
ylabel('f(t)');
title('Implementation of Difference Equation');

You might also like