You are on page 1of 26

GITAM UNIVERSITY

GITAM INSTITUTE OF TECHNOLOGY

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING

NAME:NIVESH ROLL NO:1210408342

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]

DISCRETE TIME SYSTEMS ARE CLASSIFIED INTO :-

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

X(n) ---------X(e^jw) then X(n-k)------- e^-jwk X(e^jw)

MATLAB FUNCTIONS USED:

*conv( ):used to find the convolution of two functions.

*subplot( ):used to draw many sub graphs or plots in one figure only.

*zeros( ):to assign the values in a location as zero.

*filter( ):used to make any modifications required.

*xlabel( ) & ylabel( ):to label the x and y axis.

*title( ):to title the program and graph.


PROGRAM1:

%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

GITAM INSTITUTE OF TECHNOLOGY

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

NAME:N.SATISHKUMAR ROLL NO:1210408343

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:

DISCRETE TIME SYSTEMS ARE CLASSIFIED INTO :-


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

X(n) ---------X(e^jw) then X(n-k)------- e^-jwk X(e^jw)

MATLAB FUNCTIONS USED:

Filter (),subplot(),plot().

PROGRAM :

%program p3.1
%To generate input sequences

clf; % clear the figure

n= 0:40; % duration of samples

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];

num=[2.2403   2.4908   2.2403];

den=[1   -0.4   0.75];

ic=[0 0];

y=filter (num ,den,x,ic );

yd=filter (num,den,xd,ic);

d=y-yd(1+d : 41+d );

figure(1);

subplot(2,1,1);

stem(n,x);

xlabel ('time index'); % label to X-axis

ylabel ('amplitude'); % label to Y-axis

title('input sequence'); %name of the program

subplot(2,1,2);

stem(n,xd(1:41));

xlabel ('time index'); % label to X-axis

ylabel ('amplitude'); % label to Y-axis

title('shifted input sequence'); %name of the program

figure(2);

subplot(3,1,1);
stem(n,y);

xlabel ('time index'); % label to X-axis

ylabel ('amplitude'); % label to Y-axis

title('output sequence'); %name of the program

subplot(3,1,2);

stem(n,yd(1:41));

xlabel ('time index'); % label to X-axis

ylabel ('amplitude'); % label to Y-axis

title('shifted output sequence'); %name of the program

subplot(3,1,3);

stem(n,d);

xlabel ('time index'); % label to X-axis

ylabel ('amplitude'); % label to Y-axis

title('difference of two otputs'); %name of the program

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

GITAM INSTITUTE OF TECHNOLOGY

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

NAME:N.SATISHKUMAR ROLL NO:1210408343

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:

DISCRETE TIME SYSTEMS ARE CLASSIFIED INTO :-

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

X(n) ---------X(e^jw) then X(n-k)------- e^-jwk X(e^jw)

MATLAB FUNCTIONS USED:

Filter (),subplot(),plot().

PROGRAM :

%program p3.1
%To generate input sequences

clf; % clear the figure

n= 0:40; % duration of samples

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];

num=[2.2403   2.4908   2.2403];

den=[1   -0.4   0.75];

ic=[0 0];

y=filter (num ,den,x,ic );

yd=filter (num,den,xd,ic);

d=y-yd(1+d : 41+d );

figure(1);
subplot(2,1,1);

stem(n,x);

xlabel ('time index'); % label to X-axis

ylabel ('amplitude'); % label to Y-axis

title('input sequence'); %name of the program

subplot(2,1,2);

stem(n,xd(1:41));

xlabel ('time index'); % label to X-axis

ylabel ('amplitude'); % label to Y-axis

title('shifted input sequence'); %name of the program

figure(2);

subplot(3,1,1);

stem(n,y);

xlabel ('time index'); % label to X-axis

ylabel ('amplitude'); % label to Y-axis

title('output sequence'); %name of the program

subplot(3,1,2);

stem(n,yd(1:41));

xlabel ('time index'); % label to X-axis

ylabel ('amplitude'); % label to Y-axis

title('shifted output sequence'); %name of the program

subplot(3,1,3);
stem(n,d);

xlabel ('time index'); % label to X-axis

ylabel ('amplitude'); % label to Y-axis

title('difference of two otputs'); %name of the program

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
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

MATLAB FUNCTIONS USED:


filter(num, den,x);
PROGRAM
%program p2.1
%generation of input sequence
clf;
n=0:19;
x=cos(2*pi*0.05n)+cos(2*pi*0.4n);
num=[1/6];
den=[1];
y=filter(num,den,x);
figure(1);
subplot(2,1,1); stem(n,x);
subplot(2,1,2); stem(n,y);
xlabel(‘time sequence’);
ylabel(‘amplitude,);

GRAPHS:
RESULT:
Hence the discrete time system response in time domain are generated and their corresponding output waveforms
are plotted.
GITAM UNIVERSITY

GITAM INSTITUTE OF TECHNOLOGY

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

DIGITAL SIGNAL PROCESSING LABORATORY

NAME:N.PURNA CHANDU ROLL NO:1210408341

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)

and system-2 which is governed by

y(n)=0.45x(n)+0.5x(n-1)+0.45x(n-2)+0.53y(n-2)-0.46y(n-2)

for the input signal

x(n)=cos(20*π*n/256)+cos(200*π*n/256) for 0≤n≤299.

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)

Based on the behavior system behavior a system can be classified as follows.

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.

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.

MATLAB FUNCTIONS USED:

1)filter(num,den,inputsequence variable): To get system response for a given transfer function.

2)stem(no.of values,input sequence variable): To trace a discrete time plot.

3)subplot(quadrant no): To divide the area of the plot.


PROGRAM:

%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;

num1=[0.5 0.27 0.77];

den1=[1];

y1=filter(num1,den1,x);

figure(1);

subplot(2,1,1);stem(n,x);

xlabel('Time index n');

ylabel('Amplitude A');

title('input sequence X(n)');

subplot(2,1,2);stem(n,y1);

xlabel('Time index n');

ylabel('Amplitude A');

title('Output sequence Y1(n)');

num2=[0.45 0.5 0.45];

den2=[1 -0.53 0.46];

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);

xlabel('Time Index n');

ylabel('Amplitude A');

title('Output sequence Y2(n)’);


GRAPHS:
RESULT:

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

NAME: SANTOSH ROLL NO: 1210408345

CLASS: ECE SECTION: C

AIM:TO FIND THE GENERATION OF COMPLEX EXPONENTIAL SEQUENCES WITH DIFFERENT


WIDTHS

THEORY: exponential sequence is represented as “x[n]= ke zn”;K is


amplitude ,z is real or complex form, n is time index of sequence

MATLAB FUNCTIONS USED:

*subplot( ):used to draw many sub graphs or plots in one figure only.

*zeros( ):to assign the values in a location as zero

*filter( ):

*xlabel( ) & ylabel( ):to label the x and y axis.

*title( ):to title the program and graph.


PROGRAM1:

%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));

xlabel(‘time index’); ylabel(‘amplitude’);

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:

Result: Hence the complex exponential sequence is verified

You might also like