Professional Documents
Culture Documents
CLASS:ECE SECTION:C
AIM: To find the convolution of two functions x(n) and h(n) to find y(n) using several matlab
functions.
THEORY:
CONVOLUTION:convolution is the method in which is used to find the system response when
the system function is known.let x(n) be the input to the system and h(n) be the system
function,then y(n) is the output response which is obtained by the convolution of x(n) and
h(n).
Y(n)=x(n)*h(n).
Y(n)=sigma of(product of x(k) and h(n-k))[k=0 to n-1]
1)STATIC AND DYNAMIC CONDITIONS: A system is said to be static if its output at any
instant is depends on output samples at the same time but not on past or future.otherwise system is
dynamic .
2) CAUSAL AND NON CAUSAL SYSTEMS: A system is said to be causal if the output at anytime
depends only on present and past but not on future inputs.if the output depends on future inputs it is
noncausal system.
3) LINEAR AND NONLINEAR SYSTEMS: If the system satisfies the superposition principle and
homogenity principle it is linear.superposition theorem states that the response of a system to a weighted
sum of inputs is equal to corresponding weighted sum of outputs of the system to each of individual input
signals then the system is linear otherwise it is nonlinear.
4) TIME VARIANT AND TIME INVARIANT SYSTEM: A System is said to be time invariant if the
characteristics of the system doesnot change with time.For time variant systems characteristics of the
system changes with time.That is input sequence is shifted to k-samples.
5) FIR AND IIR SYSTEMS : If the system has finite impulse duration the system is called finite
impulse response system.An infinite response system has an impulse response of infinite duration .
6) STABLE AND UNSTABLE SYSTEMS: An LTI system is stable if it produces bounded output
sequence for every bounded input sequence .If for some bounded input sequence x(n) ,the output is
infinite , the system is said to be unstable.
*subplot( ):used to draw many sub graphs or plots in one figure only.
%program 2.3
%convolution
clf;
n=0:14;
h=[3 2 1 -2 1 0 -4 0 3];
x=[1 -2 3 -4 3 2 1];
y=conv(h,x);
figure(15);
subplot(2,1,1);stem(n,y);
x1=[x zeros(1,8)];
y1=filter(h,1,x1);
subplot(2,1,2);stem(n,y1);
xlabel(‘time index’);ylabel(‘amplitude’);
title(‘convolution’);
GRAPH1:
PROGRAM2:
%program 3.2
%convolution
clf;
n=0:6;
h=[4 1 3 2];
x=[1 2 3 4];
y=conv(h,x);
figure(17);
subplot(2,1,1);stem(n,y);
x1=[x zeros(1,3)];
y1=filter(h,1,x1);
subplot(2,1,2);stem(n,y1);
xlabel('time index');
ylabel('amplitude');
title('convolution');
GRAPH2:
Result:Hence the convolution of two functions x(n) and h(n) is thus calculated using conv( )
and the system response y(n) is obtained in 2 cases as shown above.
GITAM UNIVERSITY
CLASS:ECE SECTION:C
AIM: Write a program to generate two different input sequences x(n) and x(n-t) and to compare and plot the
corresponding output sequences y1(n) and y2(n) and the differential equation
y1(n)-y2(n+t).
THEORY:
2) CAUSAL AND NON CAUSAL SYSTEMS: A system is said to be causal if the output at anytime
depends only on present and past but not on future inputs.if the output depends on future inputs it is
noncausal system.
3) LINEAR AND NONLINEAR SYSTEMS: If the system satisfies the superposition principle and
homogenity principle it is linear.superposition theorem states that the response of a system to a weighted
sum of inputs is equal to corresponding weighted sum of outputs of the system to each of individual input
signals then the system is linear otherwise it is nonlinear.
4) TIME VARIANT AND TIME INVARIANT SYSTEM: A System is said to be time invariant if
the characteristics of the system doesnot change with time.For time variant systems characteristics of the
system changes with time.That is input sequence is shifted to k-samples.
5) FIR AND IIR SYSTEMS : If the system has finite impulse duration the system is called finite
impulse response system.An infinite response system has an impulse response of infinite duration .
6) STABLE AND UNSTABLE SYSTEMS: An LTI system is stable if it produces bounded output
sequence for every bounded input sequence .If for some bounded input sequence x(n) ,the output is
infinite , the system is said to be unstable.
Filter (),subplot(),plot().
PROGRAM :
%program p3.1
%To generate input sequences
d=10;
a=3;
b=-2;
x=a*cos(2*pi*0.1*n)+b*cos(2*pi*0.4*n);
xd=[zeros(1,d) x];
ic=[0 0];
yd=filter (num,den,xd,ic);
d=y-yd(1+d : 41+d );
figure(1);
subplot(2,1,1);
stem(n,x);
subplot(2,1,2);
stem(n,xd(1:41));
figure(2);
subplot(3,1,1);
stem(n,y);
subplot(3,1,2);
stem(n,yd(1:41));
subplot(3,1,3);
stem(n,d);
grid;
GRAPHS:
Graph for input sequences :
Graph for output sequences :
RESULT: Hence the two different sequences x(n) and x(n-t) are generated and the
corresponding sequences are plotted.
GITAM UNIVERSITY
CLASS:ECE SECTION:C
AIM: Write a program to generate two different input sequences x(n) and x(n-t) and to compare and plot the
corresponding output sequences y1(n) and y2(n) and the differential equation
y1(n)-y2(n+t).
THEORY:
1)STATIC AND DYNAMIC CONDITIONS: A system is said to be static if its output at any
instant is depends on output samples at the same time but not on past or future.otherwise system is
dynamic .
2) CAUSAL AND NON CAUSAL SYSTEMS: A system is said to be causal if the output at anytime
depends only on present and past but not on future inputs.if the output depends on future inputs it is
noncausal system.
3) LINEAR AND NONLINEAR SYSTEMS: If the system satisfies the superposition principle and
homogenity principle it is linear.superposition theorem states that the response of a system to a weighted
sum of inputs is equal to corresponding weighted sum of outputs of the system to each of individual input
signals then the system is linear otherwise it is nonlinear.
4) TIME VARIANT AND TIME INVARIANT SYSTEM: A System is said to be time invariant if
the characteristics of the system doesnot change with time.For time variant systems characteristics of the
system changes with time.That is input sequence is shifted to k-samples.
5) FIR AND IIR SYSTEMS : If the system has finite impulse duration the system is called finite
impulse response system.An infinite response system has an impulse response of infinite duration .
6) STABLE AND UNSTABLE SYSTEMS: An LTI system is stable if it produces bounded output
sequence for every bounded input sequence .If for some bounded input sequence x(n) ,the output is
infinite , the system is said to be unstable.
7)TIME SHIFTING PROPERTY: If the fourier transform of x(n) is X(e^jw) then
Filter (),subplot(),plot().
PROGRAM :
%program p3.1
%To generate input sequences
d=10;
a=3;
b=-2;
x=a*cos(2*pi*0.1*n)+b*cos(2*pi*0.4*n);
xd=[zeros(1,d) x];
ic=[0 0];
yd=filter (num,den,xd,ic);
d=y-yd(1+d : 41+d );
figure(1);
subplot(2,1,1);
stem(n,x);
subplot(2,1,2);
stem(n,xd(1:41));
figure(2);
subplot(3,1,1);
stem(n,y);
subplot(3,1,2);
stem(n,yd(1:41));
subplot(3,1,3);
stem(n,d);
grid;
GRAPHS:
RESULT: Hence the two different sequences x(n) and x(n-t) are generated and the
corresponding sequences are plotted.
GITAM UNIVERSITY
GITAM INSTITUTE OF TECHNOLOGY
DEPARTMENT OF ELECTRONICS AND
COMMUNICATION ENGINEERING
NAME:P.SUSHMITHA
ROLL NO:1210408344
CLASS:ECE SECTION:C
AIM: To Write a matlab program to compute the response of low pass filter defined by y(n)=1/6[x(n)+x(n-1)+x(n-
2)+x(n-3)+x(n-4)+x(n-5) for the input x(n)=cos(2pi 0.05t)+cos(2pi0.4t) and plot the x(n) and response of the filter
THEORY:
A system is said to be static if its output at any instant n depends on input samples at the same time and in any other case
it is dynamic
y(n)=ax(n)[static system]
y(n)=x(n-1)+x(n-2)[dynamic system
If the output of the system depends only on the present and past inputs it is a causal system
y(n)=F[x(n),x(n-1),x(n-2),x(n-3)...............]
If the output depends on the future inputs then the system is said to be non causal or anticipity
y(n)=x(n)+x(n-1) [causal]
y(n)=x(2n)[non causal]
If the system satisfies the superposition principle then it is a linear system and if not non linear
T[a1x1(n)+a2x2(n)]=a1T[x1(n)]+a2T1[x2(n)]
A system is said to be time variant if the characteristics of the system dosent change with time
GRAPHS:
RESULT:
Hence the discrete time system response in time domain are generated and their corresponding output waveforms
are plotted.
GITAM UNIVERSITY
CLASS:ECE SECTION:C
AIM:
To write a MAT LAB program to compute the outputs of the system-1 which is characterized by the
differential equation
y(n)=0.5x(n)+0.27x(n-1) +0.77x(n-2)
y(n)=0.45x(n)+0.5x(n-1)+0.45x(n-2)+0.53y(n-2)-0.46y(n-2)
THEORY:
If for a system input is x(n) and the output is y(n) {X[z] and Y[z] are the corresponding z-transforms}
then the behavior of the system is determined by transfer function as
H(z) = Y(z)/X(z)
1)STATIC AND DYNAMIC SYSTEMS: A system is said to be static if its output at any instant is
depends on output samples at the same time but not on past or future.otherwise system is dynamic .
2) CAUSAL AND NON CAUSAL SYSTEMS: A system is said to be causal if the output at anytime
depends only on present and past but not on future inputs.if the output depends on future inputs it is noncausal system.
3) LINEAR AND NONLINEAR SYSTEMS: If the system satisfies the superposition principle
and homogenity principle it is linear.superposition theorem states that the response of a system to a weighted
sum of inputs is equal to corresponding weighted sum of outputs of the system to each of individual input
signals then the system is linear otherwise it is nonlinear.
5) FIR AND IIR SYSTEMS : If the system has finite impulse duration the system is called finite
impulse response system.An infinite response system has an impulse response of infinite duration .
6) STABLE AND UNSTABLE SYSTEMS: An LTI system is stable if it produces bounded output
sequence for every bounded input sequence .If for some bounded input sequence x(n) ,the output is infinite ,
the system is said to be unstable.
%program
%Generate the given input sequence and output sequences when this input is subjected to given systems
clf;
n=0:299;
x1=cos(2*pi*10*n/256);
x2=cos(2*pi*100*n/256);
x=x1+x2;
den1=[1];
y1=filter(num1,den1,x);
figure(1);
subplot(2,1,1);stem(n,x);
ylabel('Amplitude A');
subplot(2,1,2);stem(n,y1);
ylabel('Amplitude A');
y2=filter(num2,den2,x);
figure(2);
subplot(2,1,1);
stem(n,x);
xlabel('Time Index n');
ylabel('Amplitude A');
subplot(2,1,2);
stem(n,y2);
ylabel('Amplitude A');
Thus by using a matlab program,the outputs of a system for two different given systems and a given input
are obtained and plotted.
GITAM UNIVERSITY
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
*subplot( ):used to draw many sub graphs or plots in one figure only.
*filter( ):
%program 2.6
%complex exponential
clf;
n=0:50;
z1=-1/2+j*(pi/10);
z2=-1/6+j*(pi/5);
z3=-1/120+j*(pi/3);
k=2;
x1=k*exp(z1*n);
x2=k*exp(z2*n);
x3=k*exp(z3*n);
subplot(6,1,1); stem(n,real(x1));
subplot(6,1,2); stem(n,real(x2));
subplot(6,1,3); stem(n,real(x3));
title(‘real part’);
subplot(6,1,4); stem(n,imag(x1));
subplot(6,1,5); stem(n,imag(x2));
subplot(6,1,6);stem(n,imag(x3));
GRAPH1: