Sunteți pe pagina 1din 97

PP

DSP LAB (17ECL57)

LABORATORY MANUAL
V Semester B.E.
(Academic Year: 2019-20)

DEPARTMENT OF ELECTRONICS &


COMMUNICATION ENGINEERING
SAHYADRI
College of Engineering & Management
Adyar, Mangaluru - 575007
STUDENT DETAILS

NAME

USN

BATCH

SECTION

STAFF DETAILS

NAME OF THE FACULTY Roopashree

NAME OF THE INSTRUCTOR Likhith Kumar

EVALUATION

MAXIMUM MARKS MARKS OBTAINED

WEEKLY
EVALUATION*

LAB CIE

TOTAL
*OBE Sheet Evaluation

Signature of the Faculty

DEPARTMENT OF ELECTRONICS &


COMMUNICATION ENGINEERING
SAHYADRI
College of Engineering & Management
Adyar, Mangaluru - 575007
17ECL57: DSP LABORATORY

I. INTRODUCTION TO OCTAVE
GNU Octave is a high-level interpreted language, primarily intended or numerical

computations. It provides capabilities for the numerical solution of linear and nonlinear

problems, and for performing other numerical experiments. It also provides extensive graphics

capabilities for data visualization and manipulation. Octave is normally used through its

interactive command line interface, but it can also be used to write non- interactive programs. The

Octave language is quite similar to OCTAVE so that most programs are easily portable.

Octave has extensive tools for solving common numerical linear algebra problems,

finding the roots of nonlinear equations, integrating ordinary functions, manipulating polynomials,

and integrating ordinary differential and differential-algebraic equations. It is easily extensible and

customizable via user-defined functions written in Octave's own language, or using dynamically

loaded modules written in C++, C, Fortran, or other languages.

GNU Octave is also freely redistributable software. You may redistribute it and/or modify

it under the terms of the GNU General Public License (GPL) as published by the Free Software

Foundation.

Octave was written by John W. Eaton and many others. Because Octave is free software

you are encouraged to help make Octave more useful by writing and contributing additional

functions for it, and by reporting any problems you may have.

QTOCTAVE

QTOCTAVE is a front-end user interface for the Octave. It simplifies the use

of Octave for user who are not familiar with the original, command line based version of

Octave.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 1


17ECL57: DSP LABORATORY

Fig. 1 – Screen Shot of QtOctave (A GUI for GNU Octave)

BASIC STEPS TO RUN A PROGRAM USING QTOCTAVE :


1. Start QtOctave
Make sure necessary packages are installed. You can see the list of packages installed, by
typing the command “pkg list” in the octave terminal.
2. Type the program
You can use either the command line interface of octave terminal or editor window.
3. Using editor window.
This is always preferred when you have a set of commands to be executed. Open the editor
window and type your program in the editor.
4. Save the file as <filename.m> format (this will be the default format). (You may not
observe syntax highlighting in the beginning – this seems to be a bug. Next time you
restart the QtOctave syntax highlighting will work).
5. Run the Program.
In the editor window, open Run>run or use F5 to run the program.
6. View the result in the octave terminal of figure windows depending on your program.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 2


17ECL57: DSP LABORATORY

II. SIGNAL PROCESSING BASICS USING OCTAVE


A computer or digital signal processor can process only discrete signal. When the signal is
discrete in time and amplitude (high or low) we call it, digital signal. To process the analog
signal as it is, without digitizing, the computers require infinite memory and processing
capacity.
I. Discrete Time Signals.
A discrete time signal will be denoted by x(n) where n is integer value and it represents
discrete instances in time.
x(n) = {x(n)} = { . . ., x(-2), x(-1), x(0), x(1), x(2), . . . }
here the range of n is. . . -2,-1,0,1,2, ….
In Octave/OCTAVE, we can represent a finite duration sequence by a row vector of
appropriate values. However such vector does not have information on sample position n.
For a proper representation along with sample position we need to define n also along with
x.
eg : x(n) = {1,5,6,2,3,5,4,2}

Where denotes the position n = 0 in octave we can write the program as follows
x=[1 5 6 2 3 5 4 2]
n=[-3 -2 -1 0 1 2 3 4]
to view the waveform :
stem (n,x) : (the x coordinate variable first and y coordinate variable second), the output will
be as shown in the figure.

Figure 2. discrete time signal with proper time index

In the above example if we do not explicitly use n eg : stem (x) , the result will be as shown
below . Please note that the time index starts from n = 1,2,3, …....

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 3


17ECL57: DSP LABORATORY

Figure 3. discrete time signal without explicit time index


note: an arbitrary infinite duration sequence cannot be represented in octave due to the finite
memory limitations.
II. Unit sample sequence
general form:
n= [n1:n2]; x=[(n-n0) == 0]
Eg :
>>> n=[-5:5]
n = -5 -4 -3 -2 -1 0 1 2 3 4 5
>>> x=[(n-0) == 0]
x=00000100000 //impulse at n = 0
>>> x=[(n-2) == 0]
x=00000001000 //impulse at n = 2
>>> x=[(n+3) == 0]
x=00100000000 //impulse at n = -3

III. Unit step sequence


general form:
n=[n1:n2]; x=[(n-n0) >= 0]
Eg :
>>> n=[-6:5]
n = -6 -5 -4 -3 -2 -1 0 1 2 3 4 5
>>> x=[(n-0) >= 0]
x=000000111111 //step sequence from n = 0
>>> x=[(n-3) >= 0]
x=000000000111 //step sequence from n = 3
>>> x=[(n+5) >= 0]
x=011111111111 //step sequence from n = -5

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 4


17ECL57: DSP LABORATORY

PART I
EXPERIMENTS USING OCTAVE

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 5


17ECL57: DSP LABORATORY

EXPERIMENT No. 01: Verification of sampling theorem


1.1 Objective 1.6 Program
1.2 Software Required 1.7 Results
1.3 Pre-Requisite 1.8 Discussions
1.4 Introduction 1.9 Pre-Experimentation Questions
1.5 Procedure 1.10 Post- Experimentation Questions

1.1 Objective:
To verify the sampling theorem using octave software.
1.2 Software Required:
Octave software
1.3 Pre-Requisite:
Sampling theorem.
1.4 Introduction:
• Sampling is a process of converting a continuous time signal (analog signal)
x(t) into a discrete time signal x[n], which is represented as a sequence of numbers. (A/D
converter)
•Converting back x[n] into analog (resulting in reconstruction. (D/A converter)
• Some techniques for reconstruction-
o ZOH (zero order hold) interpolation results in a staircase waveform, is
implemented by OCTAVE plotting function stairs(n,x),
o FOH (first order hold) where the adjacent samples are joined by straight lines is
implemented by OCTAVE plotting function plot(n,x),
• For x(t ) to be exactly the same as x(t), sampling theorem in the generation of x(n) from
x(t) is used. The sampling frequency fs determine the spacing between samples.
•Aliasing-A high frequency signal is converted to a lower frequency, results due to under
sampling. Though it is undesirable in ADCs, it finds practical applications in stroboscope
and sampling oscilloscopes.-
1.5 Procedure:
1. Turn on PC
2. Open the octave software already installed in a PC
3. In octave open the new script file.
4. Save the file as any name with .m extension.
5. Type the program and save it. And compile the program using run option or F5.
6. After compilation give the input and observe the output, Graph.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 6


17ECL57: DSP LABORATORY

1.6 Program:

tfinal=0.05;
t=0:0.00005:tfinal;
fd=input('Enter analog frequency');
%define analog signal for comparison
xt=cos(2*pi*fd*t);
%simulate condition for under sampling i.e., fs1<2*fd
fs1=1.3*fd;
%define the time vector
n1=0:1/fs1:tfinal;
%Generate the under sampled signal
xn=cos(2*pi*n1*fd);
%plot the analog & sampled signals
subplot(3,1,1);
plot(t,xt,'b',n1,xn,'r*-');
title('under sampling plot');
%condition for Nyquist plot
fs2=2*fd;
n2=0:1/fs2:tfinal;
xn=cos(2*pi*fd*n2);
subplot(3,1,2);
plot(t,xt,'b',n2,xn,'r*-');
title('Nyquist plot');
%condition for oversampling
fs3=5*fd;
n3=0:1/fs3:tfinal;
xn=cos(2*pi*fd*n3);
subplot(3,1,3);
plot(t,xt,'b',n3,xn,'r*-');
title('Oversampling plot');
xlabel('time');
ylabel('amplitude');
legend('analog','discrete');

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 7


17ECL57: DSP LABORATORY

1.7 Results :
Enter analog frequency 200

1.8 Discussions:
1. From the under sampling plot observe the aliasing effect. The analog signal is of 200Hz
(T=0.005s). The reconstructed (from under sampled plot) is of a lower frequency. The alias
frequency is computed as
fd - fs1 = 200-1.3*200 = 200-260= -60Hz
This is verified from the plot. The minus sign results in a 180˚ phase shift.
(For example: 3kHz & 6kHz sampled at 5kHz result in aliases of -2kHz (3k-5k) & 1kHz
(6k-5k) respectively)
2. Sampling at the Nyquist rate results in samples sin(πn) which are identically zero, i.e., we
are sampling at the zero crossing points and hence the signal component is completely
missed. This can be avoided by adding a small phase shift to the sinusoid. The above
problem is not seen in cosine waveforms (except cos(90n)). A simple remedy is to sample
the analog signal at a rate higher than the Nyquist rate.
3. The over sampled plot shows a reconstructed signal almost similar to that of the analog
signal. Using low pass filtering the wave form can be further smoothened.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 8


17ECL57: DSP LABORATORY

1.9 Pre – Experimentation Questions:


1. What is octave?
2. What are the applications of OCTAVE?
3. State sampling theorem?
4. What is meant by Nyquist rate and Nyquist criteria?
5. What is over sampling?
1.10 Post – Experimentation Questions:
1. Define plot, stem, and subplot in OCTAVE?
2. List all the functions used in the above program?
3. Briefly explain sampling theorem?
4. What is nyquist rate?
5. What is aliasing?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 9


17ECL57: DSP LABORATORY

EXPERIMENT No. 02: Linear and circular convolution of two given


sequences, Commutative, distributive and associative property of
convolution.
2.1 Objective 2.6 Program
2.2 Software Required 2.7 Results
2.3 Pre-Requisite 2.8 Discussions
2.4 Introduction 2.9 Pre- Experimentation Questions
2.5 Procedure 2.10 Post- Experimentation Questions

2.1 Objective:
To verify the properties of DFT.
2.2 Software Required:
Octave software

2.3 Pre-Requisite:
Linear Convolution and circular convolution
2.4 Introduction:
a) Linear convolution
 The output y[n] of a LTI (linear time invariant) system can be obtained by
convolving the input x[n] with the system’s impulse response h[n].

 The linear convolution sum is

 x[n] and h[n] can be both finite or infinite duration sequences.


Even if one (or both) of the sequences is infinite (say, h[n]  0.9n u[n] ), we can
analytically evaluate the convolution formula to get a functional form (closed form
solution) of y[n].
 If both the sequences are of finite duration, then we can use the OCTAVE
function ‘conv’ to evaluate the convolution sum to obtain the output y[n]. Convolution is
implemented as polynomial multiplication (refer OCTAVE help).
 The length of y[n] = xlength + hlength -1.
 The conv function assumes that the two sequences begin at n=0 and is invoked by
y=conv(x,h).
 Even if one of the sequences begin at other values of n, say n=-3,or n=2; then we need
to provide a beginning and end point to y[n] which are ybegin=xbegin+hbegin and
yend=xend+hend respectively.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 10


17ECL57: DSP LABORATORY

b). Circular convolution:

 The circular convolution sum is

Where the index <n-k>N implies circular shifting operation and <-k>N implies folding the
sequence circularly
 Steps for circular convolution are the same as the usual convolution, except all index
calculations are done "mod N" = "on the wheel".
Plot f [m] and h [−m] as shown in Fig. 2.2. (use f(m) instead of x(k))
o Multiply the two sequences
o Add to get y[m]
o "Spin" h[−m] n times Anti Clock Wise (counter-clockwise) to get h[n-m].

 x[n] and h[n] can be both finite or infinite duration sequences. If infinite
sequences, they should be periodic, and the N is chosen to be at least equal to the
period. If they are finite sequences N is chosen as >= to max(xlength, hlength).
Whereas in linear convolution N>= xlength+hlength-1.

Fig. 2.2 Plotting of f(m) and h(-m) for circular convolution

c). Commutative, distributive and associative property of linear and circular


convolution.

The linear convolution is the convolution process for the discrete time systems. The
convolution of discrete time (DT) signals possesses the following properties:
Commutative Property: x(n)*h(n) = h(n)*x(n).
Associative Property: x(n)*[h1(n) *h2(n)] = [x(n)*h1(n)] *h2(n) Distributive Property:
x(n)*[h1(n) + h2(n)] = x(n)*h1(n) + x(n)*h2(n)
The definitions and interpretations of these properties are summarized below.
Commutative Property :
The commutative property states that the order in which two sequences are convolved is
not important. Mathematically, the commutative property is x(n)*h(n) = h(n)*x(n).From a
systems point of view, this property states that a system with a unit sample response h(n)

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 11


17ECL57: DSP LABORATORY

and input x(n) behaves in exactly the same way as a system with unit sample response x(n)
and an input h(n).
Associative Property :

The convolution operator satisfies the associative property, which is


x(n)*[h1 (n) *h2(n)] = [x(n)*h1 (n)] *h2(n)
From a systems point of view, the associative property states that if two systems
with unit sample responses h1(n) and h2(n) are connected. An equivalent system is
one that has a unit sample response equal to the convolution of h1(n) and h2(n):
heq[n] =h1[n]*h2[n]
Distributive Property :

The distributive property of the convolution operator states that


x(n)*[h1(n) + h2(n)] = x(n)*h1(n) + x(n)*h2(n).
From a systems point of view, this property asserts that if two systems with unit sample
responses h 1(n) and h2(n) are connected in parallel. An equivalent system is one that has
a unit sample response equal to the sum of h1(n) and h2(n): heq[n] =h1[n]+h2[n].

2.5 Procedure:
1. Turn on PC.
2. Open the octave software already installed in a PC.
3. In octave open the new script file.
4. Save the file as any name with .m extension.
5. Type the program and save it. And compile the program using run option or F5.
6. After compilation give the input and observe the output, Graph.

2.6 Program :
a) Linear convolution of two given sequences:
x1=input('Enter first sequence')
x2=input('Enter second sequence')
y=conv(x1,x2);
disp('linear con of x1 & x2 is y=');
disp(y);
%graphical display part

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 12


17ECL57: DSP LABORATORY

subplot (2,1,1);
stem(y);
xlabel('time index n');
ylabel('amplitude ');
title('convolution output');
subplot(2,2,3);
stem(x1);
xlabel('time index n');
ylabel('amplitude ');
title('plot of x1');
subplot(2,2,4); stem(x2);
xlabel('time index n');
ylabel('amplitude ');
title('plot of x2');
b). Circular convolution of two given sequences
x=[1 2 3 4];
h=[1 2 3 4];
N=length(x);
%Compute the output
for n=0:N-1
y(n+1)=0; for
k=0:N-1
i=mod((n-k),N);
if i<0 i=i+N;
end
y(n+1)=y(n+1)+h(k+1)*x(i+1);
end
end
disp('circular convolution of x & h is y=');
disp(y);
%plot
n1=0:N-1;
stem(n1,y);
title('Circular convolution output y(n)');

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 13


17ECL57: DSP LABORATORY

c). Commutative, distributive and associative property of linear convolution.


clc;
clear all;
close all;
% inputs
x=[1 2 3 4];
h1=[2 5 6 7];
h2=[1 2 3 4];
% Commutative Property : x(n) * h1(n) =h1(n) * x(n)
y1=conv(x,h1); % y1 (n) = x(n) * h1(n)
y2=conv(h1,x); % y2 (n) = h1(n) * x(n)
if y1==y2
disp('Commutative Property is proved');
else
disp('Commutative Property is not proved');
end
%Associative Property: x(n) * [h1(n) * h2(n)] = [x(n) * h1(n)] * h2(n)
y3= conv(x,conv(h1,h2)); % y3[n] = x(n) * [h1(n) * h2(n)]
y4=conv(conv(x,h1),h2); % y4[n] = [x(n) * h1(n)] * h2(n)
if y3==y4
disp('Associative property is proved');
else
disp('associative property is not proved');
end
%Distributive Property : x(n) *[ h1(n) + h2(n)] = [x(n) * h1(n)] + [x(n) *h2(n) ]
y5=conv(x,(h1+h2)); % y5(n) = x(n) *[ h1(n) + h2(n)]
% z1 = conv(x,h1);
% z2= conv(x,h2);
y6=(conv(x,h1)+conv(x,h2)); % y6(n) = [x(n) * h1(n)] + [x(n) * h2(n) ]
if y5==y6
disp('distributive property proved');
else
disp('distributive property not proved');
end

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 14


17ECL57: DSP LABORATORY

d).Commutative, distributive and associative property of circular convolution.


clc;
clear all;
close all;
% inputs x=[1 234];
h1=[2 5 67];
h2=[1 2 3 4];
% Commutative Property
y1=circonv(x,h1);
y2=circonv(h1,x);
if y1==y2
disp('Commutative Property is proved');
else
disp('Commutative Property is not proved');
end
%Associative Property
y3= circonv(x,circonv(h1,h2));
y4=circonv(circonv(x,h1),h2);
if y3==y4
disp ('Associative property is proved');
else
disp ('associative property is not proved');
end
%Distributive Property
y5=circonv (x,(h1+h2));
y6= ((circonv (x,h1))+(circonv (x,h2)));
if y5==y6
disp ('distributive property proved');
else
disp ('distributive property not proved');
end

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 15


17ECL57: DSP LABORATORY

2.7 Results :
a) Linear convolution of two given sequences:

Enter first sequence [1 2 3 4]


x1 = 1 2 3 4
Enter second sequence [2 3 2 4]
x2 = 2 3 2 4
linear con of x1 & x2 is
y= 27 14 25 26 20 16
b). Circular convolution of two given sequences
Circular convolution of x & h is y= 26 28 26 20

c). Commutative, distributive and associative property of linear convolution.


 Commutative Property is proved
 Associative property is proved
 Distributive property proved

d). Commutative, distributive and associative property of linear convolution.


 Commutative Property is proved
 Associative property is proved
 Distributive property proved

2.8 Discussion:
Calculations:-

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 16


17ECL57: DSP LABORATORY

2.9 Pre – Experimentation Questions:


1. Write the properties of linear convolution?
2. What is the requirement for convolution?
3. What is the importance of linear convolution in signals & systems?
4. How to find the length of the output sequence of linear convolution?
5. Explain how circular convolution can be obtained?
6. Explain different properties of circular convolution?

2.10 Post – Experimentation Questions:


1. Explain how linear convolution can be obtained?
2. What is the length of the output sequence of linear convolution?
3. Give the different methods for to find convolution?
4. List out the difference between linear and circular convolution?
5. Why is zero padding used in circular convolution?
6. Give the different methods for performing circular convolution?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 17


17ECL57: DSP LABORATORY

EXPERIMENT No. 3: Auto and cross correlation of two sequences


and verification of their properties.

3.1 Objective 3.6 Program


3.2 Software Required 3.7 Results
3.3 Pre-Requisite 3.8 Discussions
3.4 Introduction 3.9 Pre-Experimentation Questions
3.5 Procedure 3.10 Post- Experimentation Questions

3.1 Objective:
To verify Auto and cross correlation of two given sequences and their properties using octave
software.

3.2 Software Required:


Octave software.
3.3 Pre-Requisite:
Properties of Auto and cross correlation
3.4 Introduction:
Auto correlation:
Correlation is mathematical technique which indicates whether 2 signals are
related and in a precise quantitative way how much they are related. A measure of similarity
between a pair of energy signals x[n] and y[n] is given by the cross

The parameter ‘l’ called ‘lag’ indicates the time shift between the pair.
Autocorrelation sequence of x[n] is given by

Some of the properties of autocorrelation are enumerated below


The autocorrelation sequence is an even function i.e.,

At zero lag, i.e., at l=0, the sample value of the autocorrelation sequence has its
maximum value (equal to the total energy of the signal x)
This is verified in Fig. 5.1, where the autocorrelation of the rectangular pulse (square)
has a maximum value at l=0. All other samples are of lower value. Also the maximum
value = 11 = energy of the pulse [1 2+12+12..]

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 18


17ECL57: DSP LABORATORY

 A time shift of a signal does not change its autocorrelation sequence. For example, let
y[n]=x[n-k]; then ryy[l] = rxx[l] i.e., the autocorrelation of x[n] and y[n] are the same
regardless of the value of the time shift k. This can be verified with a sin e and cosine
sequences of same amplitude and frequency will have identical autocorrelation functions.
 For power signal the autocorrelation sequence is given by

and for periodic signals with period N it is

and t h i s rxx[l] is also periodic with N.


Cross correlation :
 Cross Correlation has been introduced in the last experiment. Comparing the
equations for the linear convolution and cross correlation we find that

 The ordering of the subscripts xy specifies that x[n] is the reference sequence that
remains fixed in time, whereas the sequence y[n] is shifted w.r.t x[n]. If y[n] is the reference
sequence then

3.5 Procedure:
1. Turn on PC
2. Open the octave software already installed in a PC
3. In octave open the new script file.
4. Save the file as any name with .m extension.
5. Type the program and save it. And compile the program using run option or F5.
6. After compilation give the input and observe the output, Graph.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 19


17ECL57: DSP LABORATORY

3.6 Program:
Auto correlation:
n = -5:5;
N=10;
%Generate the square sequence
x = ones(1,11);
%Compute the correlation sequence
r = conv(x,fliplr(x));
disp('autocorrelation sequence r=');
disp(r);
%plot the sequences
subplot(2,1,1);
stem(n,x);
title('square sequence');
subplot(2,1,2);
k = -N:N;
stem(k, r);
title('autocorrelation output');
xlabel('Lag index');
ylabel('Amplitude');
disp('auto-correlation r=');
disp(r);
% to calculate the Energy of the input signal
e=sum(x.^2);
disp('Maximum value of energy =');
disp(e);
disp('Maximum value of energy is at the zero lag index');
disp('The auto-correlated sequence is an even sequence');

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 20


17ECL57: DSP LABORATORY

Cross correlation :

x = input('Type in the reference sequence = ');


y = input('Type in the second sequence = ');
% Compute the correlation sequence
n1 = length(y)-1;
n2 = length(x)-1;
r = conv(x,fliplr(y));
disp(‘Cross correlation output is =’);
disp(r);
k = (-n1):n2; %time vector for plotting
stem(k,r);
xlabel('Lag index');
ylabel('Amplitude');

3.7 Results
Auto correlation:

Autocorrelation sequence r = 1.0000 2.0000 3.0000 4.0000


5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000
10.0000 9.0000 8.0000 7.0000 6.0000 5.0000 4.0000
3.0000 2.0000 1.0000
Maximum value of energy = 11
Maximum value of energy is at the zero lag index
The auto-correlated sequence is an even sequence

Cross correlation :
Type the reference sequence = [1 -2 6 1]
Type the second sequence = [1 2 3 4]
Cross correlation output is =
4 -5 20 19 13 8 1

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 21


17ECL57: DSP LABORATORY

3.8 Discussions:
Calculations:-

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 22


17ECL57: DSP LABORATORY

3.9 Pre – Experimentation Questions:


1. Explain the differences between convolution and correlation?
2. List the methods for performing correlation?
3. Which are the OCTAVE functions used to perform correlation?
4. List out the properties of Auto-correlation?
5. What are even and odd signals?

3.10 Post – Experimentation Questions:


1. Explain the following functions
rand(1,N) - 0.5
fliplr(y)
xcorr(y)
2.Explain the differences between cross correlation and autocorrelation?
3.List the methods for performing cross correlation?
4.List out the applications of cross correlation?
5.Which are the OCTAVE functions used to perform cross correlation?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 23


17ECL57: DSP LABORATORY

EXPERIMENT No. 4: Solving a given difference equation.

4.1 Objective 4.6 Program


4.2 Software Required 4.7 Results
4.3 Pre-Requisite 4.8 Discussions
4.4 Introduction 4.9 Pre- Experimentation Questions
4.5 Procedure 4.10 Post- Experimentation Questions

4.1 Objective:
To obtain the impulse response/step response/steady state response/response to an arbitrary
input of a system described by the given difference equation

4.2 Software Required:


Octave software
4.3 Pre-Requisite:
Solving of difference equation
4.4 Introduction:
 A difference equation with constant coefficients describes a LTI system. For example the
difference equation y[n] + 0.8y[n-2] + 0.6y[n-3] = x[n] + 0.7x[n-1] + 0.5x[n-2] describes a
LTI system of order 3. The coefficients 0.8, 0.7, etc are all constant i.e., they are not
functions of time (n). The difference equation y[n]+0.3ny[n-1]=x[n] describes a time varying
system as the coefficient 0.3n is not constant.
 The difference equation can be solved to obtain y[n], the output for a given input x[n]
by rearranging as y[n] = x[n] + 0.7x[n-1]+0.5x[n-2]- 0.8y[n-2]-
0.6y[n-3] and solving.

 The output depends on the input x[n]

o With x[n]= δ[n], an impulse, the computed output y[n] is the impulse response.
o If x[n]=u[n], a step response is obtained.
o If x[n] = cos(wn) is a sinusoidal sequence, a steady state response is obtained
(wherein y[n] is of the same frequency as x[n], with only an amplitude gain and
phase shift-refer Fig.7.3).
o Similarly for any arbitrary sequence of x[n], the corresponding output response
y[n] is computed.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 24


17ECL57: DSP LABORATORY

 The difference equation containing past samples of output, i.e., y[n-1], y[n-2], etc leads to a
recursive system, whose impulse response is of infinite duration (IIR). For such systems the
impulse response is computed for a large value of n, say n=100 (to approximate n=∞). The
OCTAVE function filter is used to compute the impulse response/ step response/
response to any given x[n]. Note: The filter function evaluates the convolution of an
infinite sequence (IIR) and x[n], which is not possible with conv function (remember conv
requires both the sequences to be finite).
 The difference equation having only y[n] and present and past samples of input (x[n],
x[n-k]), represents a system whose impulse response is of finite duration (FIR). The
response of FIR systems can be obtained by both the ‘conv’ and ‘filter’ functions. The
filter function results in a response whose length is equal to that of the input x[n],
whereas the output sequence from conv function is of a longer length
(xlength + hlength-1).

4.5 Procedure:
1. Turn on PC
2. Open the octave software already installed in a PC
3. In octave open the new script file.
4. Save the file as any name with .m extension.
5. Type the program and save it. And compile the program using run option or F5.
6. After compilation give the input and observe the output, graph.

4.6 Program:
N=input('Length of response required=');
b=[2]; %x[n] coefficient
a=[1,0.5]; %y coefficients
%impulse input
x=[1,zeros(1,N-1)];
%time vector for plotting
n=0:1:N-1;
%impulse response
h=filter(b,a,x);
%plot the waveforms
subplot(2,1,1);

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 25


17ECL57: DSP LABORATORY

stem(n,x);
title('impulse input');
xlabel('n');
ylabel('δ(n)');
subplot(2,1,2);
stem(n,h);
title('impulse response');
xlabel('n');
ylabel('h(n)');

4.7 Results :
Length of response required=8

h= 2.0000 -1.0000 0.5000 -0.2500 0.1250 -0.0625 0.0313 -0.0156

4.8 Discussions:
Calculations:-

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 26


17ECL57: DSP LABORATORY

4.9 Pre – Experimentation Questions:


1. Explain the OCTAVE function filter?
2. How to find various responses using filter function?
3. Which built in function is used to solve a given difference equation?
4. What is frequency response? Give equation for first order system and second order system?
5. What is an LTI system?

4.10 Post – Experimentation Questions:


1. Given y(n) – 0.25y(n-1) – 0.375y(n-2) = -x(n) + 2x(n-1) find
a. Impulse response
b. Step response
c. Response of the system to the input given by x(n) = 2n u(n).
d. Steady state response.
2. What is steady state response?
3. What do you mean by real time signal? Give example.
4. Suppose we have a system with transfer function H(z) = 1 / ((z – 1.1)*(z – 0.9)). Is the
system stable or unstable?
5. What is BIBO stability? What is the condition to be satisfied foe stability?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 27


17ECL57: DSP LABORATORY

EXPERIMENT No. 5: Computation of N point DFT of a given


sequence and to plot magnitude and phase spectrum. (using
DFT equation and verify it by built-in routine).
5.1 Objective 5.6 Program
5.2 Software Required 5.7 Results
5.3 Pre-Requisite 5.8 Discussions
5.4 Introduction 5.9 Pre- Experimentation Questions
5.5 Procedure 5.10 Post- Experimentation Questions

5.1 Objective:
To compute N point DFT of a given sequence and to plot magnitude and phase spectrum.

5.2 Software Required:


OCTAVE software

5.3 Pre-Requisite:
Fundamentals of time domain and frequency domain signals.
5.4 Introduction:
Discrete Fourier Transform is a powerful computation tool which allows us to evaluate
the Fourier Transform X(ejw) on a digital computer or specially designed digital hardware.
Since X(ejw) is continuous and periodic, the DFT is obtained by sampling one period of the
Fourier Transform at a finite number of frequency points. Apart from determining the
frequency content of a signal, DFT is used to perform linear filtering operations in the
frequency domain.

5.5 Procedure:
1. Turn on PC
2. Open the octave software already installed in a PC
3. In octave open the new script file.
4. Save the file as any name with .m extension.
5. Type the program and save it. And compile the program using run option or F5.
6. After compilation give the input and observe the output, Graph.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 28


17ECL57: DSP LABORATORY

5.6 Program:
clc;
clear all;
xn=input('enter the sequence x(n)');
N=input('enter the number of points of computation ');
y=fft(xn,N);
disp(y);
mag=abs(y);
phase=angle(y);
subplot(2,2,1);
stem(xn);
title('Input Sequence x(n)');
subplot(2,2,2)
stem(mag);
xlabel('K');
ylabel('MAGNITUDE');
title('magnitude plot');
subplot(2,2,3);
stem(phase);
xlabel('K');
ylabel('phase');
title('phase plot');
z=ifft(y,N);
mag1=real(z);
subplot(2,2,4);
stem(mag1);
title('signal sequence constituted from spectrum');

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 29


17ECL57: DSP LABORATORY

5.7 Results
enter the sequence x(n) [1 1 1 1 0 0 0 0]

enter the number of points of computation 8

Columns 1 through 6

4.0000 1.0000 - 2.4142i 0 1.0000 - 0.4142i 0 1.0000 + 0.4142i

Columns 7 through 8

0 1.0000 + 2.4142

5.8Discussions:
Calculations:-

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 30


17ECL57: DSP LABORATORY

5.9 Pre – Experimentation Questions:


1. Explain DFT?
2. What are the methods of finding DFT?
3. Explain differences between DFT and FFT?
4. DFT gives discrete spectrum or continuous spectrum? Justify?
5. How to find energy of signal from its DFT?

5.10 Post – Experimentation Questions:


1. Explain how functions can be declared in MATLB?
2. Explain OCTAVE function fft(x)?
3. How can user create a OCTAVE function?
4. What is the need of FFT?
5. How efficient is the FFT?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 31


17ECL57: DSP LABORATORY

EXPERIMENT No. 6: (i) Verification of DFT properties


(like Linearity and Parsevals theorem, etc.)
(ii) DFT computation of square pulse and Sinc function etc.
6.1 Objective 6.6 Program
6.2 Software Required 6.7 Results
6.3 Pre-Requisite 6.8 Discussions
6.4 Introduction 6.9 Pre- Experimentation Questions
6.5 Procedure 6.10 Post- Experimentation Questions

6.1 Objective:
To verify following properties of DFT
(i) Linearity
(ii) Parseval’s Theorem
(iii) Convolution Property

6.2 Software Required:


OCTAVE software

6.3 Pre-Requisite:
Properties of DFT
6.4 Introduction:
 By multiplying two N-point DFTs in the frequency domain, we get the circular
convolution in the time domain.
N  DFT
y[n]  x[n]  h[n]  Y (k )  X (k )  H (k )

 Circular Convolution is made identical to linear convolution by choosing the


number of points in DFT as N ≥ xlength + hlength -1.
 For Circular Convolution, N = max (xlength, length).

6.5 Procedure:
1. Turn on PC
2. Open the octave software already installed in a PC
3. In octave open the new script file.
4. Save the file as any name with .m extension.
5. Type the program and save it. And compile the program using run option or F5.
6. After compilation give the input and observe the output, Graph.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 32


17ECL57: DSP LABORATORY

6.6 Program:
(i) Linearity and Parsevals theorem:
Linearity:

clc;
clear all;
close all;
% a1*x1(n) + a2*x2(n)<-->a1*X1(K) + a2*X2(K).
x1=[1,2,3,4];
x2=[1,1,1,1];
a1=1;
a2=1;
term1= a1.*x1 + a2.*x2;
LHS=fft(term1);
term2= fft(a1.*x1);
term3 = fft(a2.*x2);
RHS = term2 + term3;
if (LHS==RHS)
disp('Linearity property proved');
disp('LHS=');
disp(LHS);
disp('RHS=');
disp(RHS);
else
disp ('DFTs are not linear');
end
Parsevals :

clc;
clear all;
close all;
% Parseval's theorem
x=[1,2,3,4];
XK =fft (x);
en1 = sum(x.^2);
en2= (1/4)* sum(abs(XK).^2);
if (en1==en2)

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 33


17ECL57: DSP LABORATORY

disp('Parevals theorem proved');


disp('Energy=');
disp(en2);
end

(ii) square pulse and Sinc function :


square pulse :

clc;
clear all;
close all;
% generating square pulse
x1=[zeros(1,32),ones(1,64),zeros(1,32)];
X1K= fft(x1);
x2= fftshift(X1K);
subplot(2,1,1);
stem(x1);
title('time domain');
subplot(2,1,2);
plot(abs(x2));
title('frequency domain');

Sinc function :

% generating a sinc function x= -pi :


0.05 : pi;
x1=sinc(x);
X1K=fft(x1);
x2=fftshift(X1K);
subplot(2,1,1);
stem(x1);
title('time domain');
subplot(2,1,2);
plot(abs(x2));
title('frequency domain');

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 34


17ECL57: DSP LABORATORY

6.7 Results
(i) Linearity and Parsevals theorem:
Linearity :
Linearity property proved
LHS=
14.0000 + 0.0000i -2.0000 + 2.0000i -2.0000 + 0.0000i -2.0000 - 2.0000i

RHS=
14.0000 + 0.0000i -2.0000 + 2.0000i -2.0000 + 0.0000i -2.0000 - 2.0000i
Parsevals theorem:

Parevals theorem proved


Energy = 30

(ii) square pulse and Sinc function :


a) SQUARE PULSE WAVEFORM :

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 35


17ECL57: DSP LABORATORY

b) SINC PULSE WAVEFORM:

6.8 Discussions:
Calculation:-

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 36


17ECL57: DSP LABORATORY

6.9 Pre- Experimentation Questions:


1.State all properties of DFT?
2.Define sinc function?
3.Define pulse signals?
4.What is memory less system?
5.Which properties are used in FFT to reduce no of computations?

6.10 Post – Experimentation Questions:


1. Define Parsvel’s Theorem?
2. Difference between sinc and square function?
3. What does zero padding mean? Where we required this concept?
4. State convolution property of the DFT?
5. Where we could use the convolution property?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 37


17ECL57: DSP LABORATORY

EXPERIMENT No. 7: Design and implementation of FIR filter to


meet given specifications (using different window techniques).

7.1 Objective 7.6 Program


7.2 Software Required 7.7 Results
7.3 Pre-Requisite 7.8 Discussions
7.4 Introduction 7.9 Pre- Experimentation Questions
7.5 Procedure 7.10 Post- Experimentation Questions

7.1 Objective:
To design and implement a FIR filter for given specifications.
7.2 Software Required:
Octave software
7.3 Pre-Requisite:
Design of FIR filter

7.4 Introduction:
There are two types of systems – Digital filters (perform signal filtering in time domain)
and spectrum analyzers (provide signal representation in the frequency domain). The design of
a digital filter is carried out in 3 steps- specifications, approximations and implementation.

DESIGNING AN FIR FILTER (using window method):


Method I: Given the order N, cutoff frequency fc, sampling frequency fs and the window.
 Step 1: Compute the digital cut-off frequency Wc (in the range -π < Wc < π, with π
corresponding to fs/2) for fc and fs in Hz. For example let fc=400Hz, fs=8000Hz
Wc = 2*π* fc / fs = 2* π * 400/8000 = 0.1* π radians
For OCTAVE the Normalized cut-off frequency is in the range 0 and 1, where
1 corresponds to fs/2 (i.e.,fmax)). Hence to use the OCTAVE commands wc = fc /
(fs/2) = 400/(8000/2) = 0.1
Note: if the cut off frequency is in radians then the normalized frequency is computed as
wc = Wc / π
 Step 2: Compute the Impulse Response h(n) of the required FIR filter using the given
Window type and the response type (lowpass, bandpass, etc). For example given a
rectangular window, order N=20, and a high pass response, the coefficients (i.e., h[n]
samples) of the filter are computed using the OCTAVE inbuilt command ‘fir1’ as
h =fir1(N, wc , 'high', boxcar(N+1));

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 38


17ECL57: DSP LABORATORY

Note: In theory we would have calculated h[n]=hd[n]×w[n], where hd[n] is the desired
impulse response (low pass/ high pass,etc given by the sinc function) and w[n] is the
window coefficients. We can also plot the window shape as stem(boxcar(N)).
Plot the frequency response of the designed filter h(n) using the freqz function and o
Method 2: Given the pass band (wp in radians) and Stop band edge (ws in radians)
frequencies, Pass band ripple Rp and stopband attenuation As.

 Step 1: Select the window depending on the stop-band attenuation required.


Generally if As>40 dB, choose Hamming window. (Refer table )
 Step 2: Compute order N based on the edge frequencies as Transition
bandwidth = tb=ws-wp; N=ceil (6.6*pi/tb);
 Step 3: Compute the digital cut-off frequency Wc as Wc=(wp+ws)/2. Now compute
the normalized frequency in the range 0 to 1 for OCTAVE as wc=Wc/pi;
Note: In step 2 if frequencies are in Hz, then obtain radian frequencies (for computation
of tb and N) as wp=2*pi*fp/fs, ws=2*pi*fstop/fs, where fp, fstop and fs are the passband,
stop band and sampling frequencies in Hz
 Step 4: Compute the Impulse Response h(n) of the required FIR filter using N, selected
window, type of response(low/high,etc) using ‘fir1’ as in step 2 of method 1.
observe the type of response (lowpass / highpass /bandpass).

7.5 Procedure:
1. Turn on PC
2. Open the octave software already installed in a PC
3. In octave open the new script file.
4. Save the file as any name with .m extension.
5. Type the program and save it. And compile the program using run option or F5.
6. After compilation give the input and observe the output, Graph.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 39


17ECL57: DSP LABORATORY

7.6 Program:

RECTANGULAR WINDOW :

clc; %high pass filter


clear all;
close all; b=fir1(n,wp,'high',y);
lp=input('enter the passband ripple:'); [h,o]=freqz(b,1,256);
ls=input('enter the stopband ripple:'); m=20*log10(abs(h));
fp=input('enter the passband subplot(2,2,2);
frequency:'); plot(o/pi,m)
fs=input('enter the stopband ylabel('gain in db');
frequency:'); xlabel('(b)normalised freq');
f=input('enter the sampling grid on;
frequency:'); %bandpass filter
wp=2*fp/f;
ws=2*fs/f; wn=[wp,ws];
num=-20*log10(sqrt(lp*ls))-13; b=fir1(n,wn,y);
sum=14.6*(fs-fp)/f; [h,o]=freqz(b,1,256);
n=ceil(num/sum); m=20*log10(abs(h));
n1=n+1; subplot(2,2,3);
if(rem(n,2)) plot(o/pi,m)
N=0; ylabel('gain in db');
n1=n; xlabel('(c)normalised freq');
n=n-1; grid on;
end
y=boxcar(n1); %band stop filter
b=fir1(n,wn,'stop',y);
%low pass filter [h,o]=freqz(b,1,256);
b=fir1(n,wp,y); m=20*log10(abs(h));
[h,o]= freqz(b,1,256); subplot(2,2,4);
m=20*log10(abs(h)); plot(o/pi,m)
subplot(2,2,1); ylabel('gain in db');
plot(o/pi,m) xlabel('(d)normalised freq');
ylabel('gain in db'); grid on;
xlabel('(a)normalised freq');
grid on;

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 40


17ECL57: DSP LABORATORY

HAMMING WINDOW

clc; %high pass filter


clear all; b=fir1(n,wp,'high',y);
close all; [h,o]=freqz(b,1,256);
lp=input('enter the passband ripple:'); m=20*log10(abs(h));
ls=input('enter the stopband ripple:'); subplot(2,2,2);
fp=input('enter the passband frequency:'); plot(o/pi,m)
fs=input('enter the stopband ylabel('gain in db');
frequency:'); xlabel('(b)normalised freq');
f=input('enter the sampling grid on;
frequency:'); %bandpass filter
wp=2*fp/f; wn=[wp,ws];
ws=2*fs/f; b=fir1(n,wn,y);
num=-20*log10(sqrt(lp*ls))-13; [h,o]=freqz(b,1,256);
sum=14.6*(fs-fp)/f; m=20*log10(abs(h));
n=ceil(num/sum); subplot(2,2,3);
n1=n+1; if(rem(n,2)) plot(o/pi,m)
N=0; ylabel('gain in db');
n1=n; xlabel('(c)normalised freq');
n=n-1; grid on;
end y=hamming(n1); %band stop filter
b=fir1(n,wn,'stop',y);
%low pass filter [h,o]=freqz(b,1,256);
b=fir1(n,wp,y); m=20*log10(abs(h));
[h,o]= freqz(b,1,256); subplot(2,2,4);
m=20*log10(abs(h)); subplot(2,2,1); plot(o/pi,m)
plot(o/pi,m) ylabel('gain in db'); ylabel('gain in db');
xlabel('(a)normalised freq'); xlabel('(d)normalised freq');
grid on; grid on;

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 41


17ECL57: DSP LABORATORY

BARTLETT WINDOW

clc; %high pass filter


clear all;
close all; b=fir1(n,wp,'high',y);
lp=input('enter the passband ripple:'); [h,o]=freqz(b,1,256);
ls=input('enter the stopband ripple:'); m=20*log10(abs(h));
fp=input('enter the passband frequency:'); subplot(2,2,2);
fs=input('enter the stopband plot(o/pi,m)
frequency:'); ylabel('gain in db');
f=input('enter the sampling xlabel('(b)normalised freq');
frequency:'); grid on;
wp=2*fp/f; %bandpass filter
ws=2*fs/f; wn=[wp,ws];
num=-20*log10(sqrt(lp*ls))-13; b=fir1(n,wn,y);
sum=14.6*(fs-fp)/f; [h,o]=freqz(b,1,256);
n=ceil(num/sum); m=20*log10(abs(h));
n1=n+1; if(rem(n,2)) subplot(2,2,3);
N=0; plot(o/pi,m)
n1=n; n=n- ylabel('gain in db');
1; end xlabel('(c)normalised freq');
y=bartlett(n1); grid on :
%low pass filter %band stop filter
b=fir1(n,wp,y); b=fir1(n,wn,'stop',y);
[h,o]= freqz(b,1,256); [h,o]=freqz(b,1,256);
m=20*log10(abs(h)); m=20*log10(abs(h));
subplot(2,2,1); subplot(2,2,4);
plot(o/pi,m) ylabel('gain plot(o/pi,m)
in db'); ylabel('gain in db');
xlabel('(a)normalised freq'); xlabel('(d)normalised freq');
grid on; grid on;

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 42


17ECL57: DSP LABORATORY

HANNING WINDOW

clc; %high pass filter


clear all;
close all; b=fir1(n,wp,'high',y);
lp=input('enter the passband ripple:'); [h,o]=freqz(b,1,256);
ls=input('enter the stopband ripple:'); m=20*log10(abs(h));
fp=input('enter the passband frequency:'); subplot(2,2,2);
fs=input('enter the stopband plot(o/pi,m)
frequency:'); ylabel('gain in db');
f=input('enter the sampling xlabel('(b)normalised freq');
frequency:'); grid on:
wp=2*fp/f; %bandpass filter
ws=2*fs/f; wn=[wp,ws];
num=-20*log10(sqrt(lp*ls))-13; b=fir1(n,wn,y);
sum=14.6*(fs-fp)/f; [h,o]=freqz(b,1,256);
n=ceil(num/sum); m=20*log10(abs(h));
n1=n+1; if(rem(n,2)) subplot(2,2,3);
N=0; plot(o/pi,m)
n1=n; n=n- ylabel('gain in db');
1; end xlabel('(c)normalised freq');
y=hanning(n1); grid on;
%low pass filter %band stop filter

b=fir1(n,wp,y); b=fir1(n,wn,'stop',y);
[h,o]= freqz(b,1,256); [h,o]=freqz(b,1,256);
m=20*log10(abs(h)); m=20*log10(abs(h));
subplot(2,2,1); plot(o/pi,m) subplot(2,2,4);
ylabel('gain in db'); plot(o/pi,m)
xlabel('(a)normalised freq'); ylabel('gain in db');
grid on; xlabel('(d)normalised freq');
grid on;

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 43


17ECL57: DSP LABORATORY

7.7 Results :
Rectangular window :
enter the passband ripple:0.05
enter the stopband ripple:0.04
enter the passband frequency:1500
enter the stopband frequency:2000
enter the sampling frequency:9000

Graph:

Fig 7.1 Frequency response of rectangular window


Hamming window :
enter the passband ripple:0.05 enter
the stopband ripple:0.001 enter the
passband frequency:1200 enter the
stopband frequency:1700 enter the
sampling frequency:9000

Graph:

Fig 7.2 Frequency response of hamming window

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 44


17ECL57: DSP LABORATORY

Bartlett window :
enter the passband ripple:0.05
enter the stopband ripple:0.04
enter the passband frequency:1500
enter the stopband frequency:2000
enter the sampling frequency:9000
Graph:

Fig 7.3 Frequency response of barlet window

Hanning window :
enter the passband ripple:0.03
enter the stopband ripple:0.01
enter the passband
frequency:1400
enter the stopband
frequency:2000
enter the sampling frequency:8000
Graph:

Fig 7.4 Frequency response of hanning window

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 45


17ECL57: DSP LABORATORY

7.8 Discussions:
Calculations:-

7.9 Pre – Experimentation Questions:


1.What is a Filter? What are its specifications?
2.Mention the types of filters?
3.Compare analog and digital filters?
4.Define a FIR filter?
5.What are the important properties of FIR filter?

7.10 Post – Experimentation Questions:


1. What are the window techniques used?
2. Why the Kaiser window is important?
3. What is Gibb’s Phenomenon?
4. How do you calculate the length of Kaiser Window?
5. What are the functions used in designing a FIR filter in OCTAVE?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 46


17ECL57: DSP LABORATORY

EXPERIMENT No. 8: Design and implementation of IIR filter to


meet given specifications.

8.1 Objective 8.6 Program


8.2 Software Required 8.7 Results
8.3 Pre-Requisite 8.8 Discussions
8.4 Introduction 8.9 Pre- Experimentation Questions
8.5 Procedure 8.10 Post- Experimentation Questions

8.1 Objective:
To design and implement an IIR filter for given specifications.
8.2 Software Required:
Octave software
8.3 Pre-Requisite:
Design of IIR filter
8.4 Introduction:
There are two methods of stating the specifications as illustrated in previous program. In
the first program, the given specifications are directly converted to digital form and the designed
filter is also implemented. In the last two programs the butterworth and chebyshev filters are
designed using bilinear transformation (for theory verification).

Method I: Given the order N, cutoff frequency fc, sampling frequency fs and the IIR
filter type (butterworth, cheby1, cheby2).

 Step 1: Compute the digital cut-off frequency Wc (in the range -π < Wc < π, with π
corresponding to fs/2) for fc and fs in Hz. For example let fc=400Hz, fs=8000Hz
Wc = 2*π* fc / fs = 2* π * 400/8000 = 0.1* π radians. For OCTAVE the Normalized
cut-off frequency is in the range 0 and 1, where 1 corresponds to fs/2 (i.e.,fmax)).
Hence to use the OCTAVE commands wc = fc / (fs/2) =400/(8000/2) = 0.1

Note: if the cut off frequency is in radians then normalized frequency is computed as wc
= Wc / π
 Step 2: Compute the Impulse Response [b,a] coefficients of the required IIR filter and
the response type (lowpass, bandpass, etc) using the appropriate butter, cheby1,
cheby2 command. For example given a butterworth filter, order N=2, and a high pass
response, the coefficients [b,a] of the filter are computed using the OCTAVE inbuilt
command ‘butter’ as [b,a] =butter(N, wc , 'high');

Method 2: Given the pass band (Wp in radians) and Stop band edge (Ws in radians)
frequencies, Pass band ripple Rp and stopband attenuation As.
 Step 1: Since the frequencies are in radians divide by π to obtain normalized frequencies
to get wp=Wp/pi and ws=Ws/pi. If the frequencies are in Hz (note: in this case the

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 47


17ECL57: DSP LABORATORY

sampling frequency should be given), then obtain normalized frequencies as


wp=fp/(fs/2), ws=fstop/(fs/2), where fp, fstop and fs are the passband, stop band and
sampling frequencies in Hz
 Step 2: Compute the order and cut off frequency as [N, wc] = BUTTORD(wp, ws, Rp,
Rs)
 Step 3: Compute the Impulse Response [b,a] coefficients of the required IIR
filter and the response type as [b,a] =butter(N, wc , 'high');

IMPLEMENTATION OF THE IIR FILTER


1. Once the coefficients of the IIR filter [b,a] are obtained, the next step is to simulate
an input sequence x[n], say input of 100, 200 & 400 Hz (with sampling frequency
of fs), each of 20/30 points. Choose the frequencies such that they are >, < and = to fc.
2. Filter the input sequence x[n] with Impulse Response, to obtain the output of the
filter y[n] using the ‘filter’ command.
3. Infer the working of the filter (low pass/ high pass, etc).

8.5 Procedure:
1. Turn on PC
2. Open the octave software already installed in a PC
3. In octave open the new script file.
4. Save the file as any name with .m extension.
5. Type the program and save it. And compile the program using run option or F5.
6. After compilation give the input and observe the output, Graph.

8.6 Program :
(i) Chebyshev Filter :
 Chebyshev LPF

clc;
close all; clear all;
format long
rp=input('enter the passband ripple');
rs=input('enter the stopband ripple');
wp=input('enter the passband frequency');
ws=input('enter the stopband frequency');
fs=input('enter the sampling frequency');
w1=2*wp/fs;

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 48


17ECL57: DSP LABORATORY

w2=2*ws/fs;

[n,wn]=cheb1ord(w1,w2,rp,rs);
[b,a]=cheby1(n,rp,wn);

w=0:0.01:pi;

[h,om]=freqz(b,a,w);

m=20*log10(abs(h));

an=angle(h);

subplot(2,1,1);

plot(om/pi,m);

ylabel('gain in db-->');

xlabel('(a) normalised frequency-->');


subplot(2,1,2);

plot(om/pi,an);

xlabel('(b) normalised frequency-->');


ylabel('phase in radians-->');

 CHEBYSHEV HPF
clc;
close all;
clear all;
format long
rp=input('enter the passband ripple');
rs=input('enter the stopband ripple');
wp=input('enter the passband frequency');
ws=input('enter the stopband frequency');
fs=input('enter the sampling frequency');
w1=2*wp/fs;
w2=2*ws/fs;
[n,wn]=cheb1ord(w1,w2,rp,rs);
[b,a]=cheby1(n,rp,wn,'high');
w=0:0.01:pi;
[h,om]=freqz(b,a,w);

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 49


17ECL57: DSP LABORATORY

m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel('gain in db-->');
xlabel('(a) normalised frequency-->');
subplot(2,1,2);
plot(om/pi,an);
xlabel('(b) normalised frequency-->');
ylabel('phase in radians-->');

 CHEBYSHEV BPF

clc;
clear all; close all;
format long
lp=input('Enter the passband attenuation:');
ls=input('Enter the stopband attenuation:');
wp=input('Enter the passband frequency:');
ws=input('Enter the stopband frequency:');
fs=input('Enter the sampling frequency:');
w1=2*wp/fs;
w2=2*ws/fs;
[n]=cheb1ord(w1,w2,lp,ls); wn=[w1 w2]
[b,a]=cheby1(n,lp,wn,'bandpass');
w=0:0.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h); figure(1);
subplot(2,1,1);
title('Butterworth Low Pass Filter');
plot(om/pi,m);
grid on;
ylabel('Gain in db-->');
xlabel('(a)Normalised frequency-->');

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 50


17ECL57: DSP LABORATORY

subplot(2,1,2);
plot(om/pi,an);
xlabel('(b)Normalised frequency-->');
ylabel('Phase in radians-->');
grid on

 CHEBYSHEV BSF

clc;
clear all;
close all;
format long
lp=input('Enter the passband attenuation:');
ls=input('Enter the stopband attenuation:');
wp=input('Enter the passband frequency:');
ws=input('Enter the stopband frequency:');
fs=input('Enter the sampling frequency:');
w1=2*wp/fs;
w2=2*ws/fs;
[n]=cheb1ord(w1,w2,lp,ls);

wn=[w1 w2]
[b,a]=cheby1(n,lp,wn,'stop');
w=0:0.01:pi;

[h,om]=freqz(b,a,w);
m=20*log10(abs(h));

an=angle(h);
figure(1);
subplot(2,1,1);
title('Chebyshev bandstop Filter');
plot(om/pi,m);
grid on;
ylabel('Gain in db-->');
xlabel('(a)Normalised frequency-->');
subplot(2,1,2);
plot(om/pi,an);

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 51


17ECL57: DSP LABORATORY

xlabel('(b)Normalised frequency-->');
ylabel('Phase in radians-->');
grid on;

(ii) BUTTERWORTH FILTER :

 Butterworth LPF :
Clc;
close all;
format long
lp=input('Enter the passband attenuation:');
ls=input('Enter the stopband attenuation:');
wp=input('Enter the passband frequency:');
ws=input('Enter the stopband frequency:');
fs=input('Enter the sampling frequency:');
w1=2*wp/fs;
w2=2*ws/fs;
[n,wn]=buttord(w1,w2,lp,ls);
[b,a]=butter(n,wn);
w=0:0.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
figure(1);
subplot(2,1,1);
title('Butterworth Low Pass Filter');
plot(om/pi,m);
grid on;
ylabel('Gain in db-->');
xlabel('(a)Normalised frequency-->');
subplot(2,1,2);
plot(om/pi,an);
xlabel('(b)Normalised frequency-->');
ylabel('Phase in radians-->');
grid on;

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 52


17ECL57: DSP LABORATORY

 Butterworth HPF :
clc;
clear all; close all;
format long
lp=input('Enter the passband attenuation:');
ls=input('Enter the stopband attenuation:');
wp=input('Enter the passband frequency:');
ws=input('Enter the stopband frequency:');
fs=input('Enter the sampling frequency:');
w1=2*wp/fs;
w2=2*ws/fs;
[n,wn]=buttord(w1,w2,lp,ls);
[b,a]=butter(n,wn,'high');
w=0:0.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
figure(1);
subplot(2,1,1);
title('Butterworth Low Pass Filter');
plot(om/pi,m);
grid on;
ylabel('Gain in db-->');
xlabel('(a)Normalised frequency-->');
subplot(2,1,2);
plot(om/pi,an);
xlabel('(b)Normalised frequency-->');
ylabel('Phase in radians-->');
grid on

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 53


17ECL57: DSP LABORATORY

 Butter worth BPF


clc;
close all; clear all;
format long
rp=input('enter the passband ripple');
rs=input('enter the stopband ripple');
wp=input('enter the passband frequency');
ws=input('enter the stopband frequency');
fs=input('enter the sampling frequency');
w1=2*wp/fs;
w2=2*ws/fs;
[n]=buttord(w1,w2,rp,rs);
wn=[w1,w2];
[b,a]=butter(n,wn,'bandpass');
w=0:0.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel('gain in db-->');

xlabel('(a) normalised frequency-->');


subplot(2,1,2);

plot(om/pi,an);

xlabel('(b) normalised frequency-->');


ylabel('phase in radians-->');

 Butter worth BSF


clc;
clear all;
format long
rp=input('enter the passband ripple');
rs=input('enter the stopband ripple');

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 54


17ECL57: DSP LABORATORY

wp=input('enter the passband frequency');


ws=input('enter the stopband frequency');
fs=input('enter the sampling frequency');
w1=2*wp/fs;
w2=2*ws/fs;
[n]=buttord(w1,w2,rp,rs);
wn=[w1,w2];
[b,a]=butter(n,wn,'stop');
w=0:0.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel('gain in db');
xlabel('(a) normalised freq');
subplot(2,1,2);
plot(om/pi,an);
xlabel('(b) normalised freq');
ylabel('phase in radians');

8.7 Results
CHEBYSHEV HPF

enter the passband ripple 0.2


enter the stopband ripple 45
enter the passband frequency 1300
enter the stopband frequency 1500
enter the sampling frequency 10000

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 55


17ECL57: DSP LABORATORY

Graph:

CHEBYSHEV HPF
enter the passband ripple0.3
enter the stopband ripple60
enter the passband frequency1500
enter the stopband frequency2000
enter the sampling frequency9000

Graph:

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 56


17ECL57: DSP LABORATORY

CHEBYSHEV BPF
Enter the passband attenuation:0.4
Enter the stopband attenuation:35
Enter the passband frequency:2000
Enter the stopband frequency:2500
Enter the sampling frequency:10000
wn = 0.40000000000000 0.50000000000000
Graph:

CHEBYSHEV BSF
Enter the passband attenuation:0.4
Enter the stopband attenuation:46
Enter the passband frequency:1100
Enter the stopband frequency:2200
Enter the sampling frequency:6000
wn = 0.36666666666667 0.73333333333333

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 57


17ECL57: DSP LABORATORY

Graph:

Butterworth LPF
Enter the stopband attenuation: 50
Enter the passband frequency: 1200
Enter the stopband frequency: 2400
Enter the sampling frequency: 10000

Graph:

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 58


17ECL57: DSP LABORATORY

Butterworth HPF
Enter the stopband attenuation: 50
Enter the passband frequency: 1200
Enter the stopband frequency: 2400
Enter the sampling frequency: 10000
Graph:

Butterworth BPF

enter the passband ripple 0.3


enter the stopband ripple 40
enter the passband frequency 1500
enter the stopband frequency 2000
enter the sampling frequency 9000

Graph :

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 59


17ECL57: DSP LABORATORY

Butterworth BSF

enter the passband ripple 0.4


enter the stopband ripple 46
enter the passband frequency 1100
enter the stopband frequency 2200

enter the sampling frequency 6000

Graph :

8.8 Discussions:
Calculations:-

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 60


17ECL57: DSP LABORATORY

8.9 Pre – Experimentation Questions:


1. Define an IIR filter?
2. Compare Impulse invariance and bilinear transformations?
3. How do you convert analog filter prototype to a digital filter?
4. Explain how to find output of digital IIR filter in real time applications?
5. What are the advantages of IIR filter?

8.10 Post – Experimentation Questions:


1. What are the functions used in OCTAVE for designing a digital Butterworth and
Chebyshev low pass filter using BLT?
2. Draw typical responses of Chebyshev filter for order odd & even?
3. Compare FIR & IIR filters?
4. How to find output of IIR filter for real time input signal?
5. How to find output of IIR filter for long input sequence?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 61


17ECL57: DSP LABORATORY

Part B
EXPERIMENTS USING DSP PROCESSOR

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 62


17ECL57: DSP LABORATORY

TMS320C6748 DSK and Code Composer Studio


LCDK, otherwise known as Low Cost Development Kit is an easy to use development tool for
beginners and experienced users alike for creating low power and low cost embedded solutions
for biometric, analytics, audio and communication based applications. The LCDK offers you
everything to get started with your projects. L138/C6748 is a part of single core DSP value line
series. The kit includes either a TMS320c6748 DSP or an OMAPL138 application processor
with 456 MHz C674x Fixed/Floating point core. It has on chip TC, DDR2 running at 150 MHz,
NAND FLASH and SD/MM Slot, USB serial Port, Fast Ethernet Port, B Host Port(USB1.1),
USB OTG Port(USB 2.0), SATA Port, VGA Port, three Audio Ports, Composite IN(RCA Jack)
and Leopard Imaging Camera Sensor Input

LCDK FEATURES
1) TI TMS320C6748 DSP or OMAP-L138 Application Processor 456-MHz C674
Fixed/Floating point DSP
2) 456-MHz ARM926EJ RISC CPU(OMAP-L138 only) On-chip RTC

Memory :
3) 128 MByte DDR2 running at 150 MHz
4) 128 MByte 16-bit wide NAND FLASH
5) 1 Micro SD/MMC Slot

Interfaces :
One mini-USB Serial Port(on-board serial to USB) .One Fast Ethernet Port(10/100 Mbps)
with status LEDs . One USB Host port(USB1.1) . One mini-USB OTG port (USB 2.0) .
One SATA Port (3Gbps). One VGA Port (15 pin D-SUB). One Composite Video Input
(RCA Jack) . One Leopard Imaging Camera Sensor Input (36-pin ZIP connector) . Three
AUDIO Ports (1 LINE IN & 1 LINE OUT & 1 MIC IN)

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 63


17ECL57: DSP LABORATORY

TMS320C6748 DSK KIT:

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 64


17ECL57: DSP LABORATORY

TMS320C6748 DSK KIT BLOCK DIAGRAM:

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 65


17ECL57: DSP LABORATORY

EXPERIMENT No. 9: Linear convolution of two sequences

9.1 Objective 9.6 Program


9.2 Apparatus Required 9.7 Results
9.3 Pre-Requisite 9.8 Discussions
9.4 Introduction 9.9 Pre- Experimentation Questions
9.5 Procedure 9.10 Post- Experimentation Questions

9.1 Objective:
To perform linear convolution of given two sequences
9.2 Apparatus Required:
Code composer studio 6.1.2 LCDKC6748 development kit mini USB,5v power adapter
9.3 Pre-Requisite:
Linear Convolution of two sequence

9.4 Introduction:
 The output y[n] of a LTI (linear time invariant) system can be obtained by
convolving the input x[n] with the system’s impulse response h[n].
 The output y[n] of a LTI (linear time invariant) system can be obtained by
convolving the input x[n] with the system’s impulse response h[n].

 The linear convolution sum is

 x[n] and h[n] can be both finite or infinite duration sequences.


Even if one (or both) of the sequences is infinite (say, h[n]  0.9n u[n] ), we can
analytically evaluate the convolution formula to get a functional form (closed form
solution) of y[n].
 If both the sequences are of finite duration, then we can use the OCTAVE
function ‘conv’ to evaluate the convolution sum to obtain the output y[n]. Convolution is
implemented as polynomial multiplication (refer OCTAVE help).
The length of y[n] = xlength + hlength -1.
 The conv function assumes that the two sequences begin at n=0 and is invoked by
y=conv(x,h).
 Even if one of the sequences begin at other values of n, say n=-3,or n=2; then we need
to provide a beginning and end point to y[n] which are ybegin=xbegin+hbegin and
yend=xend+hend respectively
 The linear convolution sum is

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 66


17ECL57: DSP LABORATORY

x[n] and h[n] can be both finite or infinite duration sequences.


 Even if one (or both) of the sequences is infinite (say, h[n]  0.9n u[n] ), we can
analytically evaluate the convolution formula to get a functional form (closed form solution)
of y[n].
 If both the sequences are of finite duration, then we can use the OCTAVE function
‘conv’ to evaluate the convolution sum to obtain the output y[n]. Convolution is
implemented as polynomial multiplication (refer OCTAVE help).
 The length of y[n] = xlength + hlength -1.
 The conv function assumes that the two sequences begin at n=0 and is invoked by
y=conv(x,h).
Even if one of the sequences begin at other values of n, say n=-3,or n=2; then we need to
provide a beginning and end point to y[n] which are ybegin=xbegin+hbegin and
yend=xend+hend respectively

9.5 Procedure:
1. Open the Code Composer Studio by double-clicking on the Code Composer Studio 6.1.2
icon on the desktop.
2. Make sure the DSP kit is turned on
3. If you are launching the 6.1.2 for the first time, a WELCOME window will appear, the
user has to click on the CCS box to launch the project explorer window.
4. Click on the “Project” at the MENU bar & select New ccs project.
5. Target type LCDKC6748 AND also select LCDK and from the options select
LCDKC6748.
6. In the Connection, select Texas Instruments XDS100v3 USB Emulator.
7. Give project name. and select empty project (with main.c).
8. Wright the program on the main.c window.
9. Build the program using the Build icon
10. Compile the program using the ‘Project-compile’ icon.
11. Run the program using resume icon.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 67


17ECL57: DSP LABORATORY

9.6 Program:
#include<stdio.h>
main ()
{
int x[20],h[20],y[40],i=0,j=0,len1=0,len2=0,len=0;
printf(“ENTER THE LENGTH OF INPUT SAMPLES \n”);
scanf(“%d”,&len1);
printf(“ENTER THE LENGTH OF h SAMPLES\n”);
scanf(“%d”,&len2);

printf(“ENTER THE FIRST SEQUENCE\n”);


for(j=0;j<len1;j++)
scanf(“%d”,&x[j]);
printf(“ENTER THE SECOND SEQUENCE\n”);
for (j=0;j<len2;j++)
scanf(“%d”,&h[j]);
printf(“\n LINEAR CONVOLUTION OUTPUT IS:\n”);
if (len1>len2)
len=len1;
else if (len1<len2)
len=len2;
else
len=len1;
for(j=0;j<(2*len-len1-1);j++)
x[len1+j]=0;
for(j=0;j<(2*len-len2-1);j++)
h[len2+j]=0;
for(i=0;i<(len1+len2)-1;i++)
{ y[i]=0;
for(j=0;j<=i; j++)
y[i]+=x[j]*h[i-j];
printf(“%d\n”,y[i]);
}}

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 68


17ECL57: DSP LABORATORY

9.7 Results:
ENTER THE LENGTH OF INPUT SAMPLES
4
ENTER THE LENGTH OF h SAMPLES
4
ENTER THE FIRST SEQUENCE
1
2
3
4
ENTER THE SECOND SEQUENCE
1
2
3
4

LINEAR CONVOLUTION OUTPUT


1 4 10 20 25 24 16

9.8 Discussions:
Calculations:-

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 69


17ECL57: DSP LABORATORY

9.9 Pre – Experimentation Questions:


1. Write the properties of linear convolution?
2. What is the requirement for convolution?
3. What is the importance of linear convolution in signals & systems?
4. How to perform linear convolution using circular convolution?
5. Why we need linear convolution?

9.10 Post – Experimentation Questions:


1. Explain how linear convolution can be obtained?
2. Explain different properties of convolution?
3. What is the length of the output sequence of linear convolution?
4. Give the different methods for to find convolution?
5. What is the difference between convolution & correlation?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 70


17ECL57: DSP LABORATORY

EXPERIMENT No. 10: Circular convolution of two sequences

10.1 Objective 10.6 Observation


10.2 Apparatus Required 10.7 Results
10.3 Pre-Requisite 10.8 Discussions
10.4 Introduction 10.9 Pre- Experimentation Questions
10.5 Procedure 10.10 Post- Experimentation Questions

10.1 Objective:
To perform circular convolution of given two sequences
10.2 Apparatus Required:
Code composer studio 6.1.2 LCDKC6748 development kit mini USB,5v power adapter
10.3 Pre-Requisite:
Circular convolution of two sequences
10.4 Introduction:
 As seen in the last experiment, the output y[n] of a LTI (linear time invariant)
system can be obtained by convolving the input x[n] with the system’s impulse response
h[n].
 The Circular Convolution is used to study the interaction of two signals that are periodic.

 The circular convolution sum is

Where the index <n-k>N implies circular shifting operation and <-k>N implies folding the
sequence circularly
 x[n] and h[n] can be both finite or infinite duration sequences. If infinite
sequences, they should be periodic, and the N is chosen to be at least equal to the
period. If they are finite sequences N is chosen as >= to max(xlength, hlength).
Whereas in linear convolution N>= xlength+hlength-1.

10.5 Procedure:
1. Open the Code Composer Studio by double-clicking on the Code Composer Studio 6.1.2
icon on the desktop.
2. Make sure the DSP kit is turned on
3. If you are launching the 6.1.2 for the first time, a WELCOME window will appear, the
user has to click on the CCS box to launch the project explorer window.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 71


17ECL57: DSP LABORATORY

4. Click on the “Project” at the MENU bar & select New ccs project.
5. Target type LCDKC6748 AND also select LCDK and from the options select
LCDKC6748.
6. In the Connection, select Texas Instruments XDS100v3 USB Emulator.
7. Give project name. and select empty project (with main.c).
8. Wright the program on the main.c window.
9. Build the program using the Build icon
10. Compile the program using the ‘Project-compile’ icon.
11. Run the program using resume icon.

10.6 Programs:-
#include<stdio.h>
#include<math.h>
int y[20];
main()
{
int N=6;
int p;
intn,m;
int x[15]={1,1,1,1};
int h[15]={1,2,3,4};
for(m=0;m<N;m++)
{ y[m]=0;
for(n=0;n<N;n++)
{
if(-n+m<0)
{
p=-n+m+N;
}
else
p=-n+m;
y[m]+=x[n]*h[p];
}

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 72


17ECL57: DSP LABORATORY

printf("circular convolution");
printf("%d\n",y[m]);
}
}

10.7 Results :
CIRCULAR CONVOLUTION OUTPUT IS :
35 35 30 20 30
10.8 Discussions:
Calculations:-

10.9 Pre – Experimentation Questions:


1. Distinguish between Linear Convolution and circular convolution of two sequences?
2. Explain how circular convolution can be obtained?
3. What is the requirement for convolution?
4. What is the importance of circular convolution in signals & systems?
5. What is the length of the output sequence of circular convolution?

10.10 Post – Experimentation Questions:


1. Explain different properties of circular convolution?
2. List out the difference between linear and circular convolution?
3. Why is zero padding used in circular convolution?
4.Give the different methods for performing circular convolution?
5.Give the different methods for to find convolution?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 73


17ECL57: DSP LABORATORY

EXPERIMENT No. 11: N-POINT DFT OF A GIVEN SEQUENCE

11.1 Objective 11.6 Program


11.2 Apparatus Required 11.7 Results
11.3 Pre-Requisite 11.8 Discussions
11.4 Introduction 11.9 Pre- Experimentation Questions
11.5 Procedure 11.10 Post- Experimentation Questions

11.1 Objective:
To compute the N (=4/8/16) point DFT of the given sequence

11.2 Apparatus Required:


Code composer studio 6.1.2 LCDKC6748 development kit mini USB,5v power adapter
11.3 Pre-Requisite:
DFT of N- point of a given sequence
11.4 Introduction:

11.5 Procedure:
1. Open the Code Composer Studio by double-clicking on the Code Composer Studio 6.1.2
icon on the desktop.
2. Make sure the DSP kit is turned on
3. If you are launching the 6.1.2 for the first time, a WELCOME window will appear, the
user has to click on the CCS box to launch the project explorer window.
4. Click on the “Project” at the MENU bar & select New ccs project.
5. Target type LCDKC6748 AND also select LCDK and from the options select
LCDKC6748.
6. In the Connection, select Texas Instruments XDS100v3 USB Emulator.
7. Give project name. and select empty project (with main.c).
8. Wright the program on the main.c window.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 74


17ECL57: DSP LABORATORY

9. Build the program using the Build icon


10. Compile the program using the ‘Project-compile’ icon.
11. Run the program using resume icon.

11.6 Program:
#include<stdio.h>
#include<math.h>
#define pi 3.14
main()
{
float XR[10],XI[10],x[10],sum1,sum2;
inti,N,n,k;
printf(“enter the length of the sequence\n”);
scanf(“%d”,&N);
printf(“enter the sequence\n”);
for(i=0;i<N;i++)
scanf(“%f”,&x[i]);
for(k=0;k<N;k++)
{
sum1=0;
sum2=0;
for(n=0;n<N;n++)
{
sum1+= x[n]*cos((2*pi*k*n)/N);
sum2+=x[n]*sin((2*pi*k*n)/N);
}
XR[k]=sum1;
X1[k]=sum2;
}
for(i=0;i<N;i++)
printf(“%f+i %f \n”,XR[i],XI[i]);
}

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 75


17ECL57: DSP LABORATORY

11.7 Results :
Enter the length of the sequence
8
Enter the sequence
1 2 3 0 4 -2 5 7
Answer :
20.000000+i0.000000
4.758184+i4.132094
-3.045350+i-6.983950
-10.780513+i-0.050660
6.000050+i-0.017520
-10.773189+i0.238967
-2.863469+i7.046662

4.917140+i4.044250

11.8 Discussions:
Calculations:-

11.9 Pre – Experimentation Questions:


1.Explain DFT?
2.What are the methods of finding DFT?
3.Explain differences between DFT and FFT?
4.DFT gives discrete spectrum or continuous spectrum? Justify?
5.How to find energy of signal from its DFT?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 76


17ECL57: DSP LABORATORY

11.10 Post – Experimentation Questions:


1. Explain how functions can be declared in OCTAVE?
2. Explain OCTAVE function fft(x)?
3. How can user create a OCTAVE function?
4. What is the need of FFT?
5. How efficient is the FFT?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 77


17ECL57: DSP LABORATORY

EXPERIMENT No. 12: Impulse response of first order and


second order system

12.1 Objective 12.6 Program


12.2 Apparatus Required 12.7 Results
12.3 Pre-Requisite 12.8 Discussions
12.4 Introduction 12.9 Pre- Experimentation Questions
12.5 Procedure 12.10 Post- Experimentation Questions

12.1 Objective:
To find the Impulse response of the given first order / second order system

12.2 Apparatus Required:


Code composer studio 6.1.2 LCDKC6748 development kit mini USB,5v power adapter
12.3 Pre-Requisite:
Impulse response of a given sequence
12.4 Introduction:

12.5 Procedure:
1. Open the Code Composer Studio by double-clicking on the Code Composer Studio 6.1.2
icon on the desktop.
2. Make sure the DSP kit is turned on
3. If you are launching the 6.1.2 for the first time, a WELCOME window will appear, the
user has to click on the CCS box to launch the project explorer window.
4. Click on the “Project” at the MENU bar & select New ccs project.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 78


17ECL57: DSP LABORATORY

5. Target type LCDKC6748 AND also select LCDK and from the options select
LCDKC6748.
6. In the Connection, select Texas Instruments XDS100v3 USB Emulator.
7. Give project name. and select empty project (with main.c).
8. Wright the program on the main.c window.
9. Build the program using the Build icon
10. Compile the program using the ‘Project-compile’ icon.
11. Run the program using resume icon.

12.6 Program:
#include<stdio.h>
main()
{
intn,k,i,order,len;
float a[20],b[20];
float h[20],sum;
printf(“enter the order :\n”);
scanf(“%d”, &order);
printf(“enter the length of sequence:\n”);
scanf(“%d”,&len);
printf(“enter the a coefficients of y(n):\n”);
for(i=0;i<(order+1);i++)
scanf(“%f”,&a[i]);
printf(“enter the a coefficicients x(n):\n”);
for(i=0;i<(order+1);i++)
scanf(“%f”,&b[i]);
for(n=0;n<len;n++)
{ sum=0;
for(k=l;k<=order;k++)
if((n-k)>=0)
sum+=a[k]*h[n-k];

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 79


17ECL57: DSP LABORATORY

if((n-k)>=0)
sum+=a[k]*h[n-k];
if(n<=order)
h[n]=b[n]-sum;
else
h[n]=-sum;
printf(“\nh[%d]=%f”,n,h[n]);
}
}

12.7 Results :
Enter the order :
2

Enter the length of sequence:


10

Enter the a coefficients of y(n):


1
-0.7478
0.2722

Enter the a coefficients x(n):

0.1311
0.2622
0.1311
h[0]=0.131100
h[1]=0.360237
h[2]=0.364799
h[3]=0.174741
h[4]=0.031373
h[5]=-0.024104
h[6]=-0.026565
h[7]=-0.013304
h[8]=-0.002718
h[9]=0.001589

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 80


17ECL57: DSP LABORATORY

12.7 Discussions:
Calculation:-

12.8 Pre – Experimentation Questions:


1. What is impulse response? Explain its significance?
2. What are the various methods available to determine the response of LTI systems?
3. Define the transfer function of an LTI system?
4. What is BIBO stability? What is the condition to be satisfied foe stability?
5. What do you mean by real time signal? Give example.?

12.9 Post – Experimentation Questions:


1. What is impulse function?
2. What is Non-recursive system?
3. What is Recursive system?
4. List the different types of structures for realizing FIR systems?
5. What are the factors that influence the choice of structure for realization of an LTI system?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 81


17ECL57: DSP LABORATORY

EXPERIMENT No. 13: Implementation of FIR filter


13.1 Objective 13.6 Program
13.2 Apparatus Required 13.7 Results
13.3 Pre-Requisite 13.8 Discussions
13.4 Introduction 13.9 Pre- Experimentation Questions
13.5 Procedure 13.10 Post- Experimentation Questions

13.1 Objective:
Realization of an FIR filter (any type ) to meet given specifications. The input can be a
signal from function generator / speech signal.

13.2 Apparatus Required:


Code composer studio 6.1.2 LCDKC6748 development kit mini USB,5v power adapter
13.3 Pre-Requisite:
Input is given from the signal generator of amplitude 1 v p-p and frequency
> 20 Hz. TMS kit: Plug in the signal generator o/p to line in and line out of TMS to CRO
Before compiling, Copy header files “dsk6713.h” and “dsk6713_aic23.h” from
C:\CCStudio_v3.1\c6000\dsk6713\include and paste it in the current project folder.

13.4 Introduction:
In signal processing, a finite impulse response (FIR) filter is a filter whose impulse
response (or response to any finite length input) is of finite duration, because it settles to zero
in finite time. This is in contrast to infinite impulse response (IIR) filters, which may have
internal feedback and may continue to respond indefinitely (usually decaying).
The impulse response (that is, the output in response to a Kronecker delta input) of an Nth-
order discrete-time FIR filter lasts exactly N + 1 samples (from first nonzero element through
last nonzero element) before it then settles to zero.

13.5 Procedure:
1. Open the Code Composer Studio by double-clicking on the Code Composer Studio 6.1.2
icon on the desktop.
2. Make sure the DSP kit is turned on
3. If you are launching the 6.1.2 for the first time, a WELCOME window will appear, the
user has to click on the CCS box to launch the project explorer window.
4. Click on the “Project” at the MENU bar & select Edit the New Project Launcher as in family
c6000.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 82


17ECL57: DSP LABORATORY

6. In the Connection, select Texas Instruments XDS100v3 USB Emulator.


7. Give project name. and select empty project (with main.c).
8. Wright the program on the main.c window.
9. Target configerations
 Right Click on Project[fir_filter], select Add Files
 Browse to C:/DSPLIB/support_files, select L138_LCDK_aic3106_init.h
L138_LCDK_aic3106_init.c linker_dsp.cmd vectors_intr.asm
 Select Link to Files.
 You should delete C6748.cmd, as you already have linker_dsp.cmd[C6748.cmd is
added by default when you create a new project].
 Right Click on your Project
rts6740.lib

path
 Browse for location- C:/DSPLAB/board_support_lib/inc, click on OK
C:/DSPLAB/support_files, click on OK
 I
Browse C:/DSPLAB/board_support_lib/lib/evmomapl138_bsl.lib, click on open and
finally ok.
 Exit Project Properties window by clicikng on OK, make sure you have selected
rts6740.lib as directed earlier.
10. Reset the LCDK board, Select your project, build it, debug it.
11. Connect signal Generator source to LINE IN JACK(top) and CRO/DSO to LINE OUT
JACK(bottom).
12. Tun on signal generator available at DSPLAB folder in C:/DSPLAB/Test_signal, it has a
1kHz tone as noise to voice signal and in Debug window, click on RESUME, the code
will run and you can see filtered signal on the CRO/DSO side.
13. If you don’t get anything, terminate the debug session, reset your hardware, Debug and run
once again.
14. The 1 kHz tone is removed from the signal, using FIR FILTER.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 83


17ECL57: DSP LABORATORY

13.6 Program:
#include "FIRcfg.h"
#include "dsk6713.h"
#include "dsk6713_aic23.h"
float filter_Coeff[] ={0.000000,-0.001591,-0.002423,0.000000,0.005728, 0.011139,
0.010502,-0.000000, -0.018003,-0.033416,-0.031505,0.000000,0.063010, 0.144802,
0.220534,0.262448,0.220534,0.144802,0.063010,0.000000,-0.031505,-0.033416,
-0.018003, 0 ,0.010502, 0.011139,0.005728,0.000000, -0.002423,-0.001591, 0.0};
static short in_buffer[100];
DSK6713_AIC23_Config
config = { \
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */ \
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume
*/\
0x00d8, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */
\0x00d8, /* 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone
volume*/ \
0x0011, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control */ \
0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */ \
0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */ \
0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */ \
0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */ \
0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ \};
/* main() - Main code routine, initializes BSL and generates tone */
void main()
{ DSK6713_AIC23_CodecHandle hCodec;Uint32 l_input, r_input,l_output,
r_output;

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 84


17ECL57: DSP LABORATORY

/* Initialize the board support library, must be called first


*/ DSK6713_init();
hCodec = DSK6713_AIC23_openCodec(0, &config); /* Start the codec
*DSK6713_AIC23_setFreq(hCodec, 1);
while(1)
{ /* Read a sample to the left channel */
while (!DSK6713_AIC23_read(hCodec, &l_input));
/* Read a sample to the right channel */
while (!DSK6713_AIC23_read(hCodec, &r_input));
l_output=(Int16)FIR_FILTER(&filter_Coeff,l_input);
r_output=l_output;
while (!DSK6713_AIC23_write(hCodec, l_output)); /* Send o/p to the
left channel */
while (!DSK6713_AIC23_write(hCodec, r_output)); /* Send o/p to the
right channel
*/
}
DSK6713_AIC23_closeCodec(hCodec); /* Close the codec */
}
signed int FIR_FILTER(float * h, signed int x)
{ int i=0; signed long output=0;
in_buffer[0] = x; /* new input at buffer[0] */
for(i=30;i>0;i--)
in_buffer[i] = in_buffer[i-1]; /* shuffle the buffer */
for(i=0;i<32;i++)
output = output + h[i] * in_buffer[i];
return(output);
}

13.7 Results :
The output plot is observed on the CRO. This behaves as a highpass filter.
See the effect of filtering by giving a sinusoidal input to DSP kit and slowly varying its
frequency in the range from 0 to 3.5 kHz. What is the cutoff frequency of the filter?
Change the filter co-efficients for different types of window & Cut-off frequencies

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 85


17ECL57: DSP LABORATORY

13.8 Discussions:
Calculations:-

13.9 Pre – Experimentation Questions:


1. W hat a r e th e di ff e re nt t ype s o f f ilte rs b as ed on imp ulse r esp ons e?
2. W hat a r e th e di ff e re nt t ype s o f f ilte rs b as ed on fr equ en c y r espon s e?
3. Distin gui sh b et we en F IR filt er s and IIR f il ters?
4. What are Advantages of FIR Filters-?
5. W hat a r e th e di sad va n ta ges o f F IR Filte rs (c ompa re d to IIR filt e rs )?

13.10 Post – Experimentation Questions:


1. What are the design techniques of designing FIR filters?
2. What are the desirable characteristics of the window function?
3. What is the necessary and sufficient condition for linear phase characteristic in FIR
filter?
4. Explain the concept of Linear Phase and its importance?
5. Why rectangular window is not preferred for FIR filter design?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 86


17ECL57: DSP LABORATORY

EXPERIMENT No. 14: Generation of Signals


14.1 Objectives 14.6 Program
14.2 Software Required 14.7 Results
14.3 Pre-Requisite 14.8 Discussions
14.4 Introduction 14.9 Pre-Experimentation Questions
14.5 Procedure 14.10 Post- Experimentation Questions

14.1 Objectives:
To generate the waveform for the following signals using OCTAVE.
1) Sine Wave signal
2) Cosine Wave signal
3) Saw Tooth Wave signal
4) Square Wave signal
14.2 Software Required:
Octave software
14.3 Pre-Requisite:
Basics of signal processing.
14.4 Introduction:
In electronics, acoustics, and related fields, the waveform of a signal is the shape of
its graph as a function of time, independent of its time and magnitude scales and of any
displacement in time.

In electronics, the term is usually applied to periodically varying voltages, currents,


or electromagnetic fields. In acoustics, it is usually applied to steady periodic sounds variations
of pressure in air or other media. In these cases, the waveform is an attribute that is independent
of the frequency, amplitude, or phase shift of the signal. The term can also be used for non-
periodic signals, like chirps and pulses.

14.5 Procedure:
1. Turn on PC
2. Open the octave software already installed in a PC
3. In octave open the new script file.
4. Save the file as any name with .m extension.
5. Type the program and save it. And compile the program using run option or F5.
6. After compilation give the input and observe the output, Graph.

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 87


17ECL57: DSP LABORATORY

14.6 Program:
1) To generate a sinusoidal signal
clear all;
close all;clc;
N = input('enter the number of cycles....');
t = 0:0.05:N;
x = sin(2*pi*t);
subplot(121);
plot(t,x);
xlabel('---> time'); ylabel('--->
amplitude'); title('analog
sinusoidal signal');
subplot(122);
stem(t,x);
xlabel('---> time'); ylabel('--->
amplitude'); title('discrete
sinusoidal signal');
2) To generate a Cosine Wave signal
clear all;
close all;
clc;
N = input('enter the number of cycles....');
t = 0:0.05:N;
x = cos(2*pi*t);
subplot (1,2,1);
plot(t,x);
xlabel('---> time'); ylabel('--
-> amplitude'); title('analog
cosine signal');
subplot(122);
stem(t,x);
xlabel('---> time'); ylabel('---
> amplitude'); title('discrete
cosine signal');

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 88


17ECL57: DSP LABORATORY

3) To generate a triangular signal


clc;
clear all;
close all;
N = input('enter the number of cycles....');
M = input('enter the amplitude....');
t1 = 0:0.5:M;
t2 = M:-0.5:0;
t = [];
for i = 1:N,
t = [t,t1,t2];
end;
subplot(2,1,1);
plot(t);
grid on;
xlabel('---> time'); ylabel('--->
amplitude'); title('analog
triangular signal');
subplot(2,1,2);
stem(t);
grid on;
xlabel('---> time'); ylabel('--->
amplitude'); title('discrete
triangular signal');

4) To generate a saw tooth signal


clear all;
close all;
clc;
N = input('enter the number of cycles....');
t1 = 0:25;
t = [];
for i = 1:N,
t = [t,t1];

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 89


17ECL57: DSP LABORATORY

end;
subplot(2,1,1);
plot(t); grid on;
xlabel('---> time');
ylabel('---> amplitude');
title('analog saw tooth signal');
subplot(2,1,2);
stem(t);
grid on;
xlabel('---> time'); ylabel('--->
amplitude'); title('discrete saw
tooth signal');

14.7 Results :
To generate a sinusoidal signal

To generate a Cosine Wave signal

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 90


17ECL57: DSP LABORATORY

To generate a triangular signal

To generate a saw tooth signal

14.8 Discussions:
Calculations:-

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 91


17ECL57: DSP LABORATORY

14.9 Pre – Experimentation Questions:


1. What is signal?
2. What are the different types of signal?
3. Define sine wave?
4. Define cosine wave?
5. Define triangular wave?

14.10 Post – Experimentation Questions:


1. Which function is used to draw graph?
2. Mention the function used for generation of sine wave?
3. Mention the function used for generation of cosine wave?
4. Why title function is used?
5. What grid function does?

Department of Electronics and Communication Engineering, SCEM, Mangaluru. 92


Program Outcomes (POs) and Program Specific Outcomes (PSOs)

PO1. Engineering Knowledge: Apply knowledge of mathematics, science, engineering


fundamentals and an engineering specialization to the solution of complex
engineering problems.
PO2. Problem Analysis: Identify, formulate, research literature and analyze complex
engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences and engineering sciences.
PO3. Design/ Development of Solutions: Design solutions for complex engineering
problems and design system components or processes that meet specified needs
with appropriate consideration for public health and safety, cultural, societal and
environmental considerations.
PO4. Conduct Investigations of complex problems using research-based knowledge and
research methods including design of experiments, analysis and interpretation of
data and synthesis of information to provide valid conclusions.
PO5. Modern Tool Usage: Create, select and apply appropriate techniques, resources and
modern engineering and IT tools including prediction and modeling to
complex engineering activities with an understanding of the limitations.
PO6. The Engineer and Society: Apply reasoning informed by contextual knowledge to
assess societal, health, safety, legal and cultural issues and the consequent
responsibilities relevant to professional engineering practice.
PO7. Environment and Sustainability: Understand the impact of professional
engineering solutions in societal and environmental contexts and demonstrate
knowledge of and need for sustainable development.
PO8. Ethics: Apply ethical principles and commit to professional ethics and
responsibilities and norms of engineering practice.
PO9. Individual and Team Work: Function effectively as an individual, and as a
member or leader in diverse teams and in multi-disciplinary settings.
PO10. Communication: Communicate effectively on complex engineering activities with
the engineering community and with society at large, such as being able to
comprehend and write effective reports and design documentation, make effective
presentations and give and receive clear instructions.
PO11. Project Management and Finance: Demonstrate knowledge and understanding of
engineering and management principles and apply these to one’s own work, as a
member and leader in a team, to manage projects and in multidisciplinary
environments.
PO12. Life-long Learning: Recognize the need for and have the preparation and ability to
Engage in independent

PSO1: Exhibit competency in Embedded Systems Development and VLSI Design


PSO2: Capability to comprehend the technological advancements in signal processing and
Telecommunication

DEPARTMENT OF ELECTRONICS & COMMUNICATION


ENGINEERING
SAHYADRI
College of Engineering & Management
Adyar, Mangaluru - 575007
Course Outcomes
Bloom’s
COs Description
Level
CL3
C313.1 Explain and apply sampling theorem on analog signals.
CL3
C313.2 Implement and verify DFT properties.
Analyze and understand N-point DFT computation using simulation tool CL3
C313.3
and DSP Processor.
CL3
C313.4 Design and implement FIR filter using simulation tool and DSP Processor.
CL3
C313.5 Analyze first and second order system.
CL3
C313.6 Design and implement IIR filter using simulation tool.

CO-PO-PSO Mapping
POs
1 2 3 4 5 6 7 8 9 10 11 12 PSO1 PSO2
COs
C313.1 3 2 3 2 1 3 1 3
C313.2 3 2 3 2 1 3 1 3
C313.3 3 2 1 3 2 1 3 1 3
C313.4 3 2 1 3 2 1 3 1 3
C313.5 3 2 1 3 2 1 3 1 3

Assessment Components (ACs)


Assessment Component (AC) Assessment Component Description
AC1: Written Work Observation and Record
AC2: Fundamental Knowledge Discussion on Pre requisites to conduct each experiment
to conduct experiment
AC3: Viva Pre and post experimental questions asked to the individual students
AC4: Interaction during Explanation regarding the concept of the individual experiment carried out
conduction of Experiment
AC5: Punctuality On time record submission and login timings of each laboratory session

DEPARTMENT OF ELECTRONICS & COMMUNICATION


ENGINEERING
SAHYADRI
College of Engineering & Management
Adyar, Mangaluru - 575007
List of Experiments
Expt. No. Objective of the Experiment Page No

FOLLOWING EXPERIMENTS TO BE DONE USING MATLAB / SCILAB / OCTAVE OR EQUIVALENT :

1 Verification of sampling theorem. 6-9


Linear and circular convolution of two given sequences, Commutative,
2 10-17
distributive and associative property of convolution.
Auto and cross correlation of two sequences and verification of their
3 18-23
properties.
4 Solving a given difference equation. 24-27
Computation of N point DFT of a given sequence and to plot magnitude
5 28-31
and phase spectrum (using DFT equation and verify it by built-in routine).
(i) Verification of DFT properties (like Linearity and Parsevals theorem,
6 etc.) 32-37
(ii)DFT computation of square pulse and Sinc function etc.
Design and implementation of FIR filter to meet given specifications (using
7 38-46
different window techniques)
8 Design and implementation of IIR filter to meet given specifications. 47-61

FOLLOWING EXPERIMENTS TO BE DONE USING DSP KIT

9 Linear convolution of two sequences 66-70

10 Circular convolution of two sequences 71-73

11 N-point DFT of a given sequence 74-77

12 Impulse response of first order and second order system 78-81

13 Implementation of FIR filter 82-86

14 Generation of Signals 87-92

DEPARTMENT OF ELECTRONICS & COMMUNICATION


ENGINEERING
SAHYADRI
College of Engineering & Management
Adyar, Mangaluru - 575007

S-ar putea să vă placă și