Вы находитесь на странице: 1из 63

DSP LABORATORY- 15ECL57 VVIET, MYSURU

VIDYA VIKAS INSTITUTE OF ENGINEERING &


TECHNOLOGY
#127 - 128, Mysuru Bannur Road, Alanahally Post
MYSURU – 570028

Department of Electronics & Communication Engineering

DSP LABORATORY MANUAL

Department of Electronics & Communication Engineering Page 1


DSP LABORATORY- 15ECL57 VVIET, MYSURU

SYLLABUS

Subject Code: 15ECL57 IA Marks: 20


Hours / Week: 03 Exam Hours: 03
Exam Marks: 80

Following Experiments to be done using MATLAB / SCILAB/ OCTAVE/


Python/LabView or equivalent:

1. Verification of sampling theorem.


2. Linear and circular convolution of two given sequences, Commutative, distributive and
associative property of convolution
3. Auto and cross correlation of two sequences and verification of their properties
4. Solving a given difference equation.
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). 1. Verify DFT properties (like Linearity
and Parseval’s theorem, etc.), DFT of square pulse and sinc function
6. Design and implementation of FIR filter to meet given specifications (using different window
techniques).
7. Design and implementation of IIR filter to meet given specifications, compare the response of
Butterworth and Chebyshev filters

Following Experiments to be done using DSP kit

8. Linear convolution of two sequences


9. Circular convolution of two sequences
10. N-point DFT of a given sequence
11. Impulse response of first order and second order system
12. Implementation of FIR filter

Department of Electronics & Communication Engineering Page 2


DSP LABORATORY- 15ECL57 VVIET, MYSURU

CYCLE OF EXPERIMENTS

Lab Exp Experiment (Exp)


No No
1 1 Verification of sampling theorem
2 Solving a given difference equation
Linear convolution of two given sequences, Commutative, distributive and
2 1
associative property of convolution
circular convolution of two given sequences, Commutative, distributive and
2
associative property of convolution
3 1 Auto correlation of two sequences and verification of their properties
2 cross correlation of two sequences and verification of their properties
Computation of N point DFT of a given sequence and to plot magnitude and
4 1
phase spectrum (using DFT equation and verify it by built-in routine)
verify DFT properties (like Linearity and Parseval’s theorem, etc.), DFT of
5 1
square pulse and sinc function
Design and implementation of FIR filter to meet given specifications (using
6 1
different window techniques)
Design and implementation of IIR filter to meet given specifications,
7 1
compare the response of Butterworth and Chebyshev filters
8 1 Linear convolution of two sequences
2 Circular convolution of two sequences
9 1 N-point DFT of a given sequence
10 1 Impulse response of first order and second order system
2 Implementation of FIR filter

Department of Electronics & Communication Engineering Page 3


DSP LABORATORY- 15ECL57 VVIET, MYSURU

DO’s and DON’Ts

Do’s
 Students should be in proper uniform and dress code with identity cards in the laboratory.
 Students should bring their observation, manual and record compulsorily.
 Students should maintain discipline in the laboratory.
 Students are required to handle all the equipment’s/Computers properly.
 Students are required to follow the safety precautions.
 Enter the lab in time as per the given time table.
 Enter time-in and time-out in log book.
 Comply with the instructions given by faculty and instructor.
 Arrange the chairs/ equipment’s before leaving the lab.
 Take signature in the observation, before leaving the lab.

Don’ts
 Mobile phones are strictly banned.
 Ragging is punishable.
 Do not operate any peripherals or accessories without supervision.
 Avoid stepping on computer cables and electrical wires.
 Do not walk around in the lab unnecessarily.
 Do not go out of the lab without permission.

Department of Electronics & Communication Engineering Page 4


DSP LABORATORY- 15ECL57 VVIET, MYSURU

COURSE OBJECTIVES & COURSE OUTCOMES

Course Objectives

This course will enable students to:


 Verify Sampling theorem.
 Verify properties of convolution and correlation.
 Differentiate between DFT and FFT.
 Design, simulate and realize IIR and FIR filter.
 Implement different coding techniques.

Course Outcomes

At the end of this course, students should be able to:


 Write a code to compute Linear and circular Convolution.
 Write a code to compute DFT; and verify properties of DFT.
 Analyze and Design FIR filter
 Analyze and Design IIR filters

Department of Electronics & Communication Engineering Page 5


DSP LABORATORY- 15ECL57 VVIET, MYSURU

CONTENTS
Sl. Page
Name of the Experiment
No. No.
PART – A (Using MATLAB)

I Introduction to MATLAB and DSP Processors

1 Verification of sampling theorem

2 Solving a given difference equation

Linear convolution of two given sequences, commutative, distributive and


3
associative property of convolution
Circular convolution of two given sequences, commutative, distributive
4
and associative property of convolution

5 Auto correlation of two sequences and verification of their properties

6 Cross correlation of two sequences and verification of their properties


Computation of N point DFT of a given sequence and to plot magnitude
7 and phase spectrum (using DFT equation and verify it by built-in
routine)
Verify DFT properties (like Linearity and Parseval’s theorem, etc.), DFT
8
of square pulse and sinc function
Design and implementation of FIR filter to meet given specifications
9
(using different window techniques)
Design and implementation of IIR filter to meet given specifications,
10
compare the response of Butterworth and Chebyshev filters
PART – B (Using DSP Processor)

11 Linear convolution of two sequences

12 Circular convolution of two sequences

13 N-point DFT of a given sequence

14 Impulse response of first order and second order system

15 Implementation of FIR filter


II Viva Questions

Department of Electronics & Communication Engineering Page 6


DSP LABORATORY- 15ECL57 VVIET, MYSURU

Chapter 1
Introduction to MATLAB

MATLAB is a powerful high-level programming language for scientific computations. It is very


easy to learn and use in solving numerically complex engineering problems. MATLAB consists
of functions that are either built into the interpreter or available as M-files, with each containing
a sequence of program statements that execute a certain algorithm. A completely new algorithm
can be written as a program containing only a few of these functions and can be saved as another
M-file.

MATLAB works with three types of windows on your computer screen. These are the Command
window, the Figure window and the Editor window. The Command window as he heading
Command, the Figure window has the heading Figure No. 1, and the Editor window has heading
showing the name of an opened existing M-file or Untitled if it is a new M-file under
construction. The Command window also shows the prompt >> indicating it is ready to execute
MATLAB commands. Results of most printing commands are displayed in the Command
window. This window can also be used to run small programs and saved M-files. All plots
generated by the plotting commands appear in a Figure window. Either new M-files or old M-
files are run from the Command window. Existing M-files can also be run from the Command
window by typing the name of the file.

1.1 Number and Data Representation

MATLAB uses conventional decimal notations to represent numbers with a leading minus sign
for negative numbers. The approximate range of numbers that can be represented is from 10 -308
to 10 308. Very large or very small numbers can be represented using exponents. Typical
examples of valid number representations are as follows:
1234.56789, 123456.789E-2, 1.23456789e3, -1234.56789
There should be no blank space before the exponent.

The data in MATLAB are represented in the form of a rectangular matrix that does not require
dimensioning. Its elements can be either real or complex numbers. Thus, a one-dimensional
discrete-time signal can be represented either as a row or a column vector. For example the row
vector data representation in
x = [3.5+4*j -2.1-7.4*j 1.05-0.8*j 0 9.2*j];
Denotes a complex-valued signal x of length 5. Note the use of square brackets to indicate that x
is a rectangular matrix. Note also that the imaginary part of a complex number is represented
using the operator * and the letter j. An alternate form of representation of the imaginary part
uses the letter i instead of the letter j. The real and imaginary parts of a complex number should
be entered without any blank spaces on either side of the + or -sign as indicated above. The
elements in the row of a matrix can also be separated by commas as indicated below:
x = [3.5+4*j, -2.1 - 7.4*j, 1.05-0.8*j, 0, 9.2*j];
The semicolon; at the end of the square brackets ensures that the data are not printed in the
Department of Electronics & Communication Engineering Page 7
DSP LABORATORY- 15ECL57 VVIET, MYSURU

command window after they have been entered. If the above data were entered without the
semicolon, MATLAB would print in the Command window
x=
Columns 1 through 4
3.5000 + 4.0000i -2.1000 - 7.4000i 1.0500 - 0.8000i 0
Column 5
0 + 9.2000i
Alternately, if needed, the actual value of x can be printed by typing x in the Command window.
The elements of a matrix can be entered in two different ways. The rows can be typed on a single
line separated with semicolons or on different lines. For example, the 3 ×4 matrix A

Can be entered either as


A= [1 3 5 7 ; 2 4 6 8 ; 9 11 13 15 ];
Or as
A= [1 3 5 7
2 4 6 8
9 11 13 15];

The indexing of vectors and matrices in MATLAB begins with 1. For example, x (1) in the
above vector x is 3.5000 + 4.0000i, x (2) is -2.1000 - 7.4000i, and so on. Similarly, the first
element in the first row of a matrix A is given by A (1, 1), the second element in the first row is
given by A(1,2), and so on. The index cannot be less than 1 or greater than the dimension of the
vector or matrix under consideration.

The size of an array in the workspace of MATLAB can be determined by using the function size.
For example, by typing size(x) we obtain the result
ans =
15
The length of a vector can also be found by using the function length. For example, typing

length(x) yields the result


ans =5

The array transpose operation is implemented using the operator.’ Thus the transpose of X is
given by the expression X.’. If X is a matrix with complex-valued elements, X’ is the complex
conjugate transpose of X, whereas if X is a matrix with real-valued elements, X’ is the transpose
of X.

The data vectors and matrices in MATLAB can be labeled by a collection of characters including
the numbers, such as x, x1, X, X1, XY, and so on. It should be noted that MATLAB normally
differentiates between lowercase and uppercase letters.

Department of Electronics & Communication Engineering Page 8


DSP LABORATORY- 15ECL57 VVIET, MYSURU

Example 1.1
Let X denote the 3 ×4 real-valued matrix entered by typing
X=[1 2 3 4;5 6 7 8;9 10 11 12];

Then typing X in the Command window results in the display of


ans =
1 2 3 4
5 6 7 8
9 10 11 12
and typing X’ we get

ans =
1 5 9
2 6 10
3 7 11
4 8 12

Consider next a 2 ×3 complex-valued matrix Y entered as


Y = [1+2*i, 3-4*i , 5+6*i; 7-8*i, 9+10*i, 11-12*i];

Typing of Y yields
Y=
1.0000 + 2.0000i 3.0000 - 4.0000i 5.0000 + 6.0000i
7.0000 - 8.0000i 9.0000 + 10.0000i 11.0000 - 12.0000i
whereas typing Y ’ we get
ans =
1.0000 - 2.0000i 7.0000 + 8.0000i
3.0000 + 4.0000i 9.0000 - 10.0000i
5.0000 - 6.0000i 11.0000 + 12.0000i

To obtain the transpose of Y we type Y.’ resulting in


ans =
1.0000 + 2.0000i 7.0000 - 8.0000i
3.0000 - 4.0000i 9.0000 + 10.0000i
5.0000 + 6.0000i 11.0000 - 12.0000i

1.2 Arithmetic Operations


Two different types of arithmetic operations are available in MATLAB for the manipulation of
stored data, as indicated below where X and Y denote two different matrices. If X and Y are of
the same dimensions, the addition of X and Y is implemented by the expression X + Y. The
addition operation + can also be used to add a scalar to a matrix. Likewise, the subtraction of Y
from X is implemented by the expression X - Y. The subtraction operation -can also be used to
subtract a scalar from a matrix.

Department of Electronics & Communication Engineering Page 9


DSP LABORATORY- 15ECL57 VVIET, MYSURU

If the number of columns of X is the same as the number of rows of Y, the matrix multi-plication
X*Y yields the linear algebraic product of X and Y. The multiplication operation * can also be
used to multiply a matrix by a scalar. If X and Y have the same dimensions, X.*Y is an array
multiplication forming the element-by-element product of X and Y. If Y is a square matrix and X
is a matrix with the same number of columns as that of Y, then the matrix right division X/Y is
equivalent to X*inv(Y) where inv(Y) denotes the inverse of Y. The right division operation X/Y
can also be carried out if one of them is a scalar. If Y is a square matrix and X is a matrix with
the same number of rows as that of Y, then the matrix left division Y \X is equivalent to
inv(Y)*X. If X and Y are of the same dimension, the array right division is implemented using
the expression X./Y, resulting in a matrix whose (r,s)-th element is given by X(r,s)/Y(r,s).
If multiple operations are employed in a statement, the usual precedence rules are followed in
evaluating the expression. However, parentheses can be used to change the precedence of
operations.
Arithmetic operations on matrices are illustrated in the following example.

Example 1.2
Let X =[1 2 3; 4 5 6]and Y =[12 11 10;9 8 7].
Then X+Y yields
ans =
13 13 13
13 13 13
and X-Y yields
ans =
-11 -9 -7
-5 -3 -1
The result of the operation X+3 is given by
ans =
4 5 6
7 8 9
whereas the result of the operation X*3 yields
ans =
3 6 9
12 15 18
The statement X.*Y develops the answer
ans =
12 22 30
36 40 42
Typing X*Y’ we obtain the result
ans =
64 46
163 118
and typing X’ * Y we arrive at
ans =
48 43 38
69 62 55

Department of Electronics & Communication Engineering Page 10


DSP LABORATORY- 15ECL57 VVIET, MYSURU

90 81 72

Consider the two matrices X=[1 2 3 ; 4 5 6 ; 7 8 9] and


Y=[1 1 2 ; 2 2 3 ; 1 3 4].
Then X/Y yields
ans =
0.5000 0 0.5000
-2.5000 3.0000 0.5000
-5.5000 6.0000 0.5000
and Y \X results in
ans =
0 0 0
5 4 3
-2 -1 0

1.3 Relational Operators


The relational operators in MATLAB <, <=, >, >=, ==, and ~ =, represent the comparison
operations less than, less than or equal to (≤), greater than, greater than or equal to (≥), equal
to, and not equal to (~=), respectively. Element-by-element comparisons between two matrices
of the same size are carried out using these operators with the result appearing as a matrix of the
same size whose elements are set to 1 when the relation is TRUE and set to 0 when the relation is
FALSE. In the case of complex-valued matrices, the operators <, <=, >, and >= are applied to
compare only the real parts of each element of the matrices, whereas the operators == and ~= are
applied to compare both real and imaginary parts.
We illustrate the use of these operators in the following example.
Example 1.3
Consider the two matrices C = [1 2 3; 4 5 6] and D = [1 7 2; 6 5 1]. Then the results of applying
the above relational operators on C and D are indicated below:
C<D=010
100
C>D = 0 0 1
001
C<=D = 1 1 0
110
C>=D = 1 0 1
011
C==D = 1 0 0
010
C~ =D = 0 1 1
101
1.4 Logical Operators
The three logical operators in MATLAB, &, |, and ~, perform the logical AND,OR, and NOT
operations. When applied to matrices, they operate element-wise, with FALSE represented by a
0 and TRUE represented by a 1. We illustrate the use of these operators in the following
example.

Department of Electronics & Communication Engineering Page 11


DSP LABORATORY- 15ECL57 VVIET, MYSURU

Example 1.4
Consider the two matrices A = [1 1 0 1] and B = [0 1 0 0]. The results of applying the above
logical operators on A and B are illustrated below:
A&B=0100
A|B= 1101
A~ = 0010

1.5 Control Flow


The control flow commands of MATLAB are break, else, elseif, end, error, for, if, return, and
while. These commands permit the conditional execution of certain program statements. The
command for is used to repeat a group of program statements a specific number of times. The
command if is used to execute a group of program statements conditionally, and the command
while can be used to repeat program statements an indefinite number of times. The statements
following the commands for, while, and if must be terminated with the command end. The
command break is used to terminate the execution of a loop. The commands else and elseif are
used with the command if to provide conditional breaks inside a loop. The command error is
employed to display error message and abort functions.

The use of these commands is illustrated in the following examples.

Example 1.5
Consider the generation of a length-N sequence x of integers beginning with a specified first
element x(1) and with each succeeding element increasing linearly by a specified positive integer
D. The MATLAB program generating and displaying this sequence is given below:
N = 10;
D = 3;
x = [5 zeros(1,N-1)];
for k = 2:N
x (k) = x(k-1) + D;
end
disp(’The generated sequence is’);
disp(x)
ans=
x=[5 8 11 14 17 20 23 26 29 32]

Example 1.6
Now consider the generation of a length-N sequence x of integers beginning with a specified first
element x(1) and with each succeeding element increasing linearly by a specified positive integer
D until an element is equal to R*D + x(1), where R is a positive integer, and then each
succeeding element decreasing linearly by an amount D until an element is equal to x(1), and
then repeating the process. A MATLAB program generating this sequence is as follows:
N = 15; D = 3;
x = [5 zeros(1,N-1)];
for k = 2:N
x(k) = x(k-1) + D;

Department of Electronics & Communication Engineering Page 12


DSP LABORATORY- 15ECL57 VVIET, MYSURU

if x(k) == 3*D + x(1)


D = -abs(D);
elseif x(k) == x(1)
D = abs(D);
end
end
disp(’The generated sequence is’);disp(x)

Example 1.7
The following program illustrates the use of the command break. The program develops the sum
of a series of numbers beginning with a specified initial value y, with each succeeding number
increasing by a fixed positive increment D; stops the addition process when the total sum
exceeds 100; and then displays the total sum.

y = 5; D = 3;
while 1
y = y + D;
if y > 100, break, end
end
disp(’y is’);disp(y)

1.6 Special Characters and Variables


MATLAB uses a number of special characters and words to denote certain items exclusively.
These characters and words should not be used for any other purpose. For example, if the letter i
or the letter j is used as a variable, it cannot be used to represent the imaginary part of a complex
number. Hence, it is a good practice to restrict either the letter i or the letter j exclusively for the
representation of the imaginary part of complex numbers.
There are several permanent variables that cannot be cleared by the user and should not be used
to denote any other quantities. The word pi is used to denote π. Thus, sin(pi/4) yields
0.70710678118655, which is equal to 1/ √2. The variable eps is equal to 2−52 and is a tolerance
for determining precision of certain computations such as the rank of a matrix. It can be set to
any other value by the user. NaN represents Not-a-Number, which is obtained when computing
mathematically undefined operations such as 0/0 and∞−∞. inf represents +∞and results from
operations such as dividing by zero, for example, 2/0, or from overflow, for example, e1000. The
variable ans stores the results of the most recent operation. The square brackets [ ] are used to
enter matrices and vectors. The elements of a matrix can be separated by spaces or commas. A
semicolon; indicates the end of a row in a matrix. It is also used to suppress printing. The
precedence in arithmetic expressions can be indicated using the parentheses (). The parentheses
are also employed to enclose the indices of an array and arguments of functions. The operator
notation for transpose of an array is ’. However, two such symbols can be used to denote a quote.
For example, ’dsp program’ is a vector containing the ASCII codes of the characters inside the
quotation marks. Any text following a percent symbol % denotes a comment and is not treated as
a program statement. The colon symbol: has many different applications in MATLAB. It is used
to generate vectors, subscript matrices, and perform iterations of a block of commands.

Department of Electronics & Communication Engineering Page 13


DSP LABORATORY- 15ECL57 VVIET, MYSURU

For example,
x = M:N generates the vector
x = [M M+1 M+2 . . . N],
if M < N. However x = M:N is an empty matrix, denoted by [ ], if M > N. The command
x = M:k:N generates the vector
x = [M M+k M+2k . . . N],
where k can be a positive or a negative integer. Note that x = M:k:N generates the empty matrix [
] if k > 0 and M > N or if k < 0 and M < N.
The colon can also be employed to select specific rows, columns, and elements of a matrix or a
vector. For example, Y(:,N) represents the Nth column of Y. Likewise, the Mth row of Y is
represented by Y(M,:). Y(:,M:N) is equivalent to Y(:,M), Y(:,M+1), . . . , Y(:,N). Finally, Y(:) is
equivalent to a column vector formed by concatenating the columns of Y.

1.7 Output Data Format


All arithmetic operations in MATLAB are performed in double precision. However, different
formats can be used to display the result of such operations in the Command window. If all
results are exact integers, they are displayed as such without any decimal points. If one or more
data elements are not integers, the results can be displayed with various precision.
 Format short displays five significant decimal digits and is the default format.
 Format short e displays five significant decimal digits with two positive or negative
decimal exponents.
 Format long shows results in 15 significant decimal digits.
 Format long e adds two positive or negative decimal exponents to 15 significant decimal
digits.

1.8 Graphics
MATLAB includes high-level graphics capability for displaying the results of a computation. In
most situations, we shall be concerned with two-dimensional (2-D) graphics and will use three-
dimensional (3-D) graphics in some special cases. For 2-D graphics, plotting can be done in
various forms with either linear or logarithmic scales for one or both axes of the plots. Grid lines
can be added to the plots along with labels for the two axes and a title on top of the plot. Text can
be placed anywhere on the graph using a mouse or specifying the starting position through
commands in the program. Moreover, by including appropriate symbols in the argument of the
plotting command, specific line styles, plot symbols, and colors can be displayed in the graph.
For 3-D data, plotting can also be done in various forms with either linear or logarithmic scales
for one or two or all three axes of the plots. For example, lines and points can be plotted in three
dimensions. Contour plots, 3-D perspective plots, surface plots, pseudocolor plots, and so forth
can also be generated. The M-file in the following section illustrates the use of several graphics
commands.

1.9 M-Files: Scripts and Functions


An M-file is a sequence of MATLAB statements developed using a word processor or a text
editor and saved with a name that must be in the form filename.m. The names of M-files must
begin with a letter followed by at most 18 letters and/or digits (or underscores). However certain

Department of Electronics & Communication Engineering Page 14


DSP LABORATORY- 15ECL57 VVIET, MYSURU

characters, such as hyphen - and decimal point ., are not allowed in the names. Also, do not use
the names of existing M-files. An M-file can include references to other existing M-files.
Each statement of a new program is typed in the Editor window line by line as ASCII text files
and can be edited using the text editor or the word processor of your computer. The complete
program can then be saved as an M-file.
There are two types of M-files: scripts and functions. A function file must contain the word
function in the first line of all program statements. Arguments in a function file may be passed
from another M-file, and all variables used inside the function file are local. The script file makes
use of workspace data globally. The first line of a function file contains the word function and
does not make use of workspace data globally. The variables defined inside a function file are
manipulated locally, and the arguments of the file may be passed. When a function is completed,
all local variables are lost. Only values specifically passed out are retained.
A simple example of a function file runsum is given below.
function y = runsum(x)
% Computes the mean of a vector x
L = length(x);
y = sum(x)/L;
A simple example of a script file lowpass.m follows.
% Script M-file lowpass.m
% Program to Perform Lowpass Filtering
% Using Three-Point Averaging of a Random Signal
% Program uses the function file runsum
z = zeros(1,11);data = randn(size(z));
u = [zeros(1,3) data];
N = 3; % N is the filter length
for k = 1:10;
w = u(k:k+N);
z(k) = runsum(w);
end
n = 0:10;
% Plot the noise in solid line and
% the smoothed version in dashed line
plot(n,data,’r-’,n,z,’b--’);grid
xlabel(’Time index n’);
ylabel(’Amplitude’);
gtext(’Noisy data’);gtext(’Smoothed data’);
The plot generated by executing the M-file lowpass.m is shown in Figure 1.1. Note that the
function file runsum uses the built-in function sum. Likewise, the script file lowpass.m uses the
function file runsum.

Department of Electronics & Communication Engineering Page 15


DSP LABORATORY- 15ECL57 VVIET, MYSURU

Figure 1.1 Signal smoothing example.

1.10 A Summary of MATLAB Commands Used


We provide below a quick review with a brief description of all MATLAB functions used in this
manual. For additional details on these functions, use the help command.

Function Description
abs Computes the absolute value
angle Computes the phase angle in radians

axis Sets manual scaling of axes on plots


blackman Generates the Blackman window coefficients
break Terminates the execution of loops
butter Designs digital and analog Butterworth filters of all four types
buttord Selects the minimum order of the digital or analog Butterworth transfer function
ceil Rounds to the nearest integer towards +∞
cheb2ord Selects the minimum order of the digital or analog Type2 Chebyshev transfer function
cheby1 Designs digital and analog Type 1 Chebyshev filters of all four types
cheby2 Designs digital and analog Type 2 Chebyshev filters
of all four types
clf Deletes all objects from the current figure
conj Computes the complex conjugate
conv Performs the multiplication of two polynomials
cos Computes the cosine
decimate Decreases the sampling rate of a sequence by an integer factor
deconv Performs polynomial division
disp Displays text or a matrix on the screen
echo Echoes M-files during execution

Department of Electronics & Communication Engineering Page 16


DSP LABORATORY- 15ECL57 VVIET, MYSURU

ellip Designs digital and analog elliptic filters of all four types
ellipord Selects the minimum order of the digital or analog elliptic transfer function
else Delineates an alternate block of statements inside an if loop
elseif Conditionally executes a block of statements inside an if loop
end Terminates a loop
eps Indicates floating-point relative accuracy
error Displays an error message
exp Computes the exponential
fft Computes the discrete Fourier transform coefficients
filter Filters data with an IIR or FIR filter implemented in the transposed direct form II
structure
filtfilt Performs zero-phase filtering of data
fir1 Designs linear-phase FIR filters of all four types using the windowed Fourier series
method
fir2 Designs linear-phase FIR filters with arbitrary magnitude responses using the windowed
Fourier series method
firpm Designs linear-phase FIR filters using the Parks- McClellan algorithm

firpmord Determines the approximate order, normalized band edges, frequency band magnitude
levels, and weights to use with the firpm command
fix Rounds towards zero
Fliplr Flips matrices left to right
for Used for repeated execution of a block of statements a specific number of times
format Controls the format of the output display
freqs Computes the complex frequency response of an analog transfer function at specified
frequency points
freqz Computes the complex frequency response of a digital transfer function at specified
frequency points
function Used to generate new M-functions
grid Adds or deletes grid lines to or from the current plot
grpdelay Computes the group delay of a digital transfer function at specified frequency points
gtext Places a text on a graph with the aid of a mouse
hamming Generates the Hamming window coefficients Generat
Hann Generates the von Hann window coefficients
help Provides online documentation for MATLAB functions and M-files
hold Holds the current graph
if Conditionally executes statements
ifft Computes the inverse discrete Fourier transform coefficients
imag Determines the imaginary part of a complex number or matrix
impz Computes a specific number of the impulse response coefficients of a digital transfer
function
input Requests data to be supplied by the user
interp Increases the sampling rate of a sequence by an integer factor

Department of Electronics & Communication Engineering Page 17


DSP LABORATORY- 15ECL57 VVIET, MYSURU

inv Determines the inverse of a matrix


kaiser Determines the Kaiser window coefficients
kaiserord Detemines the filter order and the parameter β of a Kaiser window
latc2tf Determines the transfer function from the specified lattice parameters and the feed-
forward coefficients of the Gray-Markel realization.
Legend Inserts a legend on the current plot using the specified strings as labels.
Length Determines the length of a vector.
linspace Generates linearly spaced vectors.
Load Retrieves saved data from the disk.
log10 Computes the common logarithm.
lookfor Provides keyword search through all help entries.
Max Detemines the largest element of a vector.
Min Detemines the smallest element of a vector.
NaN Not-a-number.
Nargin Indicates the number of arguments inside the body of a function M-file.
num2str Converts a number to its string representation.
ones Generates a vector or a matrix with element values 1.
pause Halts execution temporarily until user presses any key.
pi Returns the floating-point number nearest to π.
plot Generates linear 2-D plots.
poly2rc Determines the coefficients in the cascade realization of an IIR allpass transfer function.
rand Generates random numbers and matrices uniformly distributed in the interval (0,1).
randn Generates random numbers and matrices normally distributed with zero mean and unity
variance
real Determines the real part of a complex number or matrix.
rem Determines the remainder of a matrix divided by another matrix of same size.
resample Changes the sampling rate of a sequence by a rational number.
residue Determines the partial-fraction of a discrete-time transfer function expressed as a ratio of
polynomials in z.
residuez Determines the partial-fraction of a discrete-time transfer function expressed as a ratio of
polynomials in z−1.
return Causes a return to the keyboard or to the invoking function
roots Determines the roots of a polynomial.
save Saves workspace variables on a disk.
sawtooth Generates a sawtooth wave with a period 2π.
sign Implements the signum function.
sin Determines the sine.
sinc Computes the sinc function of a vector or array.
size Returns the matrix dimensions.
sqrt Computes the square root.
Square Generates a square wave with a period 2π.
stairs Draws a stairstep graph
stem Plots the data sequence as stems from the x axis terminated with circles for the data

Department of Electronics & Communication Engineering Page 18


DSP LABORATORY- 15ECL57 VVIET, MYSURU

value.
subplot Breaks figure window into multiple rectangular panes for the display of multiple plots.
sum Determines the sum of all elements in a vector.
title Write specified text on the top of the current plot.
unwrap Eliminates jumps in phase angles to provide smooth transition across branch cuts.
what Provides directory listing of files.
which Locates functions and files.
while Repeats statements an indefinite number of times.
who Lists the current variables in the memory.
whos Lists the current variables in the memory, their sizes, and whether they have non-zero
imaginary parts.
xlabel Write specified text below the x-axis of the current 2-D plot.
ylabel Write specified text on the left side of the y-axis of the current 2-D plot.
zeros Generates a vector or a matrix with element 0.
zp2sos Determines an equivalent second-order representation from a specified zero-pole-gain
representation.

CHAPTER-2
INTRODUCTION TO DSP PROCESSORS
A signal can be defined as a function that conveys information, generally about the state or
behavior of a physical system. There are two basic types of signals viz Analog (continuous time
signals which are defined along a continuum of times) and Digital (discrete-time).
Remarkably, under reasonable constraints, a continuous time signal can be adequately
represented by samples, obtaining discrete time signals. Thus digital signal processing is an ideal
choice for anyone who needs the performance advantage of digital manipulation along with
today’s analog reality.
Hence a processor which is designed to perform the special operations(digital manipulations) on
the digital signal within very less time can be called as a Digital signal processor. The difference
between a DSP processor, conventional microprocessor and a microcontroller are listed below.

Microprocessor or General Purpose Processor such as Intel xx86 or Motorola 680xx family
Contains - only CPU,No RAM, ROMI,/O ports and Timer

Microcontroller such as 8051 family


Contains - CPU, RAM, ROM,I/O ports,- Timer & Interrupt circuitry
Some Micro Controllers also contain A/D, D/A and Flash Memory

DSP Processors such as Texas instruments and Analog Devices


Contains - CPU, RAM,ROM, I/O ports, Timer.

Department of Electronics & Communication Engineering Page 19


DSP LABORATORY- 15ECL57 VVIET, MYSURU

Optimized for – fast arithmetic, Extended precision, Dual operand fetch, Zero overhead loop,
Circular buffering

The basic features of a DSP Processor are


Feature Use

Fast-Multiply accumulate Most DSP algorithms, including filtering, transforms,


etc. are multiplication- intensive
Multiple– access memory Many data-intensive DSP operations require reading a
architecture program instruction and multiple data items during each
instruction cycle for best performance
Specialized addressing modes Efficient handling of data arrays and first-in, first-out
buffers in memory
Specialized program control Efficient control of loops for many iterative DSP
algorithms. Fast interrupt handling for frequent I/O
operations.
On-chip peripherals and I/O On-chip peripherals like A/D converters allow for small
interfaces low cost system designs. Similarly I/O interfaces tailored
for common peripherals allow cleaninterfaces to off-chip
I/O devices.

CHAPTER 3
SOFTWARE PROGRAMS
1.Verification of Sampling Theorem

tf=0.05;
t=0:0.00005:tf;

f=input('Enter the analog frequency,f = ');


xt=cos(2*pi*f*t);

fs1=1.3*f;
n1=0:1/fs1:tf;
xn=cos(2*pi*f*n1);
subplot(311);
plot(t,xt,'b',n1,xn,'r*-');
title('Undersampling plot');
xlabel('time');
ylabel('Amplitude');

Department of Electronics & Communication Engineering Page 20


DSP LABORATORY- 15ECL57 VVIET, MYSURU

fs2=2*f;
n2=0:1/fs2:tf;
xn=cos(2*pi*f*n2);
subplot(312);
plot(t,xt,'b',n2,xn,'r*-');
title('Nyquist plot');
xlabel('time');
ylabel('Amplitude');

fs3=6*f;
n3=0:1/fs3:tf;
xn=cos(2*pi*f*n3);
subplot(313);
plot(t,xt,'b',n3,xn,'r*-');
title('Oversampling plot');
xlabel('time');
ylabel('Amplitude');
output : Enter the analog frequency, f =200

Department of Electronics & Communication Engineering Page 21


DSP LABORATORY- 15ECL57 VVIET, MYSURU

2a. Linear and circular convolution of two given sequences, Commutative, distributive and
associative property of convolution.

AIM: To verify Linear Convolution and its properties

THEORY: Convolution is a formal mathematical operation, just as multiplication, addition, and


integration. Addition takes two numbers and produces a third number, while convolution takes
two signals and produces a third signal. Convolution is used in the mathematics of many fields,
such as probability and statistics. In linear systems, convolution is used to describe the
relationship between three signals of interest: the input signal, the impulse response, and the
output signal.

In this equation, x(k), h(n-k) and y(n) represent the input to and output from the system at time n.
Here we could see that one of the input is shifted in time by a value every time it is multiplied
with the other input signal. Linear Convolution is quite often used as a method of implementing
filters of various types.

PROGRAM:
% MATLAB program for linear convolution using built in function
x=input('enter the values of x=');
h=input('enter the values of h=');
nx=input('enter the value of time index for x[n] ie nx=');
nh=input('enter the value of time index for h[n] ie nh=');
y=conv(x,h);
ny=[nx(1)+nh(1):nx(length(nx))+nh(length(nh))];
disp ('the value of linear convolution y[n]=');
disp(y);
disp ('the value of time index for y[n] ie ny=');
disp(ny);
subplot(311)
stem(nx,x);
xlabel('x-axis');
ylabel('y-axis');
title('input signal x[n]');
grid on;
subplot(312)
stem(nh,h);
xlabel('x-axis');
ylabel('y-axis');
title('impulse response h[n]');
grid on;

Department of Electronics & Communication Engineering Page 22


DSP LABORATORY- 15ECL57 VVIET, MYSURU

subplot(313)
stem(ny,y);
xlabel('x-axis');
ylabel('y-axis');
title('linear convolution y[n]');
grid on;

Output
x[n]= [1 2 3 4]
h[n]=[2 1]
y[n]= 2 5 8 11 4

% MATLAB program for linear convolution without using built in function


disp('linear convolution program');
x=input('enter i/p x(n):');
L=length(x);
h=input('enter i/p h(n):');
M=length(h);
N=L+M-1
x=[x,zeros(1,N-L)];
h=[h,zeros(1,N-M)];

subplot(2,2,1), stem(x);
title('i/p sequence x(n) is:');
xlabel('---->n');
ylabel('---->x(n)');
grid;

Department of Electronics & Communication Engineering Page 23


DSP LABORATORY- 15ECL57 VVIET, MYSURU

subplot(2,2,2), stem(h);
title('i/p sequence h(n)is:');
xlabel('---->n');ylabel('---->h(n)');grid;
disp('convolution of x(n) & h(n) is y(n):');
y=zeros(1,N);
for n=1:N
y(n)=0;
for k=1:n
y(n)=y(n)+x(k)*h(n-k+1);
end
end
disp(y);
subplot(2,2,3),stem(y);
title('convolution of x(n) & h(n) is :');
xlabel('---->n');ylabel('---->y(n)');grid;

2b.Verification of properties of Linear Convolution


1. Commutative property: x(n) * h(n) = h(n) * x(n)
2. Associative property: x(n) *[h1(n) * h2(n)] = [x(n) * h1(n)] * h2(n)
3. Distributive property: x(n) * [h1(n) + h2(n)] = x(n) * h1(n) + x(n) * h2(n)

% Program to verify the properties of Linear convolution


x = input(‘Enter the value of x=’);
h1 = input(‘Enter the value of h1=’);
h2 = input(‘Enter the value of h2=’);
y1 = conv(x,h1);
y2 = conv(x,h2);
disp(y1);
disp(y2);
if(y1==y2)
disp(‘Commutative property is verified’);
end
y3 = conv(x, conv(h1,h2));
y4 = conv(conv(x,h1),h2);
disp(y3);
disp(y4);
if(y3==y4)
disp(‘Associative property is verified’);
end
y5 = conv(x, h1+h
2);
y6 = conv(x,h1) + conv(x,h2);
disp(y5);

Department of Electronics & Communication Engineering Page 24


DSP LABORATORY- 15ECL57 VVIET, MYSURU

disp(y6);
if(y5==y6)
disp(‘Distributive property is verified’);
end

Output
Enter the value of x= [1 2 3]
Enter the value of h1= [1 1]
Enter the value of h2= [1 1]

y1=
1 4 8 8 3
y2=
1 4 8 8 3
Commutative property is verified

Y4=
1 3 5 3
Y6=
1 3 5 3
Associative property is verified

Y8=
2 6 10 6
Y10=
2 6 10 6
Distributive property is verified

2c. Circular Convolution


AIM : To verify Circular Convolution.

Circular convolution is another way of finding the convolution sum of two input signals. It
resembles the linear convolution, except that the sample values of one of the input signals is
folded and right shifted before the convolution sum is found. Also note that circular convolution
could also be found by taking the DFT of the two input signals and finding the product of the
two frequency domain signals. The Inverse DFT of the product would give the output of the
signal in the time domain which is the circular convolution output. The two input signals could
have been of varying sample lengths. But we take the DFT of higher point, which ever signals
levels to. For eg. If one of the signal is of length 256 and the other spans 51 samples, then we
could only take 256 point DFT. So the output of IDFT would be containing 256 samples instead
of 306 samples, which follows N1+N2 – 1 where N1 & N2 are the lengths 256 and 51
respectively of the two inputs. Thus the output which should have been 306 samples long is
fitted into 256 samples. The 256 points end up being a distorted version of the correct signal.
This process is called circular convolution. It is given by

Department of Electronics & Communication Engineering Page 25


DSP LABORATORY- 15ECL57 VVIET, MYSURU

% MATLAB program for circular convolution using built in function


x=input('enter the values of x=');
h=input('enter the values of h=');
L=length(x);
M=length(h);
N=max(L,M);
y=cconv(x,h,N);
disp ('the value of circular convolution y[n]=');
disp(y);
subplot(311)
stem(0:1:L-1,x);
xlabel('x-axis');
ylabel('y-axis');
title('input signal x[n]');
grid on;
subplot(312)
stem(0:1:M-1,h);
xlabel('x-axis');
ylabel('y-axis');
title('impulse response h[n]');
grid on;
subplot(313)
stem(0:1:N-1,y);
xlabel('x-axis');
ylabel('y-axis');
title('circular convolution y[n]');
grid on;
Output
x[n]= [1 2 3 4]
h[n]=[2 1 2 1]

Department of Electronics & Communication Engineering Page 26


DSP LABORATORY- 15ECL57 VVIET, MYSURU

y[n]=[14 16 14 16]

% MATLAB program for circular convolution without using function


x=input('enter i/p x(n):');
L=length(x);
h=input('enter i/p h(n):');
M=length(h);
N=max(L,M)
x=[x,zeros(1,N-L)];
h=[h,zeros(1,N-M)];

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

Department of Electronics & Communication Engineering Page 27


DSP LABORATORY- 15ECL57 VVIET, MYSURU

title('i/p sequence x(n) is:');


xlabel('---->n');
ylabel('---->x(n)');
grid;

subplot(2,2,2), stem(h);
title('i/p sequence h(n)is:');
xlabel('---->n');ylabel('---->h(n)');grid;
disp(' circular convolution of x(n) & h(n) is y(n):');
y=zeros(1,N);
for n=1:N
y(n)=0;
for m=1:N
k=((m-n)%N)
y(n)=y(n)+x(m)*h(k);
end
end
disp(y);
subplot(2,2,3),stem(y);
title(' circular convolution of x(n) & h(n) is :');
xlabel('---->n');ylabel('---->y(n)');grid;

2d.Verification of properties of Circular Convolution


1. Commutative property: x(n) * h(n) = h(n) * x(n)
2. Associative property: x(n) *[h1(n) * h2(n)] = [x(n) * h1(n)] * h2(n)
3. Distributive property: x(n) * [h1(n) + h2(n)] = x(n) * h1(n) + x(n) * h2(n)

2d. Program to verify the properties of Circular convolution


x = input(‘Enter the value of x=’);
h1 = input(‘Enter the value of h1=’);
h2 = input(‘Enter the value of h2=’);
L = length(x);
M = length(y);
N = max(L,M);
y1 = cconv(x,h1,N);
y2 = cconv(x,h2,N);
disp(y1);

Department of Electronics & Communication Engineering Page 28


DSP LABORATORY- 15ECL57 VVIET, MYSURU

disp(y2);
if(y1==y2)
disp(‘Commutative property is verified’);
end
y3 = cconv(x, cconv(h1,h2,N),N);
y4 = cconv(cconv(x,h1,N),h2,N);
disp(y3);
disp(y4);
if(y3==y4)
disp(‘Associative property is verified’);
end
y5 = cconv(x, h1+h2,N);
y6 = cconv(x,h1,N) + cconv(x,h2,N);
disp(y5);
disp(y6);
if(y5==y6)
disp(‘Distributive property is verified’);
end

Output
(Note: length of h1 and h2 should be same)

Enter the value of x=[1 2 3 0]


Enter the value of h1=[1 1]
Enter the value of h2=[1 1]
y1=
1353
y2=
1353
Commutative property is verified

y3=
14883
y4=
14883
Associative property is verified

y5=
1353
y6=
1353
Distributive property is verified

Department of Electronics & Communication Engineering Page 29


DSP LABORATORY- 15ECL57 VVIET, MYSURU

3. Auto-correlation & its properties

Rxx(n)=x(n)*x(-n)

% MATLAB program for Autocorrelation and its property verification

x=input('enter i/p x(n):');


Rxx=xcorr(x);
disp('Autocorrelation Rxx(n)=');
disp(Rxx);
L=length(x);
n=-(L-1):(L-1);
subplot(1,2,1);
stem(x);
xlabel('n');
ylabel('x[n]');
subplot(1,2,2);
stem(n,Rxx);
xlabel('n');
ylabel('Rxx[n]');
title('Autocorrelation');

disp('Verification of property 1');


if(Rxx==fliplr(Rxx))

disp('Auto correlation has even symmetry');


else
disp('Auto correlation has odd symmetry');
end

disp('Verification of property 2');


[max_val index]=max(Rxx);
if(index==L)
disp('maximum is at the origin');
else
disp('maximum is not at the origin');
end

disp('Verification of property 3');


energy=sum(x.^2);
if(max(Rxx)==energy)
disp(' maximum of Rxx is equal to Energy of x[n]');
else

Department of Electronics & Communication Engineering Page 30


DSP LABORATORY- 15ECL57 VVIET, MYSURU

disp(' maximum of Rxx is not equal to Energy of x[n]');


end
Output
x[n]= [1 2 3 4]
Verification of property 1
Rxx[n] and Rxx[-n] are identical
Hence Auto correlation has even symmetry
Verification of property 2
maximum is at the origin
Verification of property 3
Energy of x[n] =
30
Maximun of Rxx[n] =
30
Hence maximum of Rxx is equal to Energy of x[n]

% MATLAB program for Autocorrelation using function call

x=input('enter i/p x(n):');


xminus=fliplr(x);
Rxx=flinconv(x,xminus);
disp('Autocorrelation Rxx(n)=');
disp(Rxx);
n=-(length(x)-1):(length(x)-1);
subplot(1,2,1);
stem(x);
xlabel('n');
ylabel('x[n]');
subplot(1,2,2);
stem(n,Rxx);
xlabel('n');
ylabel('Rxx[n]');
title('Autocorrelation');

function [ y ] = flinconv( x,h )


L=length(x);
M=length(h);

Department of Electronics & Communication Engineering Page 31


DSP LABORATORY- 15ECL57 VVIET, MYSURU

N=L+M-1
x=[x,zeros(1,N-L)];
h=[h,zeros(1,N-M)];
y=zeros(1,N);
for n=1:N
y(n)=0;
for k=1:n
y(n)=y(n)+x(k)*h(n-k+1);
end
end
end

4. Cross-correlation & its properties


Rxy(n)=x(n)*y(-n)
% MATLAB program for cross correlation and its property verification
x=input('enter i/p x(n):');
y=input('enter i/p y(n):');

Rxy=xcorr(x,y);
disp('crosscorrelation Rxy(n)=');
disp(Rxy);
L= length(x);
M=length(y);
N=max(L,M);
n=-(N-1):(N-1);
subplot(1,2,1);
stem(x);
xlabel('n');
ylabel('x[n]');
subplot(1,2,2);
stem(n,Rxy);
xlabel('n');
ylabel('Rxy[n]');
title('crosscorrelation');

disp('Verification of property 1');


Ryx=xcorr(y,x);
disp(Ryx);
if(Rxy==Ryx)
disp('are commutative');
else
disp('are not commutative');
end

Department of Electronics & Communication Engineering Page 32


DSP LABORATORY- 15ECL57 VVIET, MYSURU

disp('Verification of property 2');


disp('Ryx(-n)');
disp(fliplr(Ryx));
if(Rxy==fliplr(Ryx))
disp('Rxy[n]and Ryx[-n] are equal');
else
disp('Rxy[n]and Ryx[-n] are not equal');
end

Output
x[n]= [1 2 3 4]
y[n]= [4 3 2 1]
Verification of property 1
Rxy[n]and Ryx[n]
are commutative
Verification of property 2
Rxy[n]and Ryx[-n] are equal

% MATLAB program for cross correlation using function call

x=input('enter i/p x(n):');


y=input('enter i/p y(n):');
yminus=fliplr(y);
Rxy=flinconv(x,yminus);
disp('crosscorrelation Rxy(n)=');
disp(Rxy);
L= length(x);
M=length(y);
N=max(L,M);
n=-(N-1):(N-1);
subplot(1,2,1);
stem(x);

Department of Electronics & Communication Engineering Page 33


DSP LABORATORY- 15ECL57 VVIET, MYSURU

xlabel('n');
ylabel('x[n]');
subplot(1,2,2);
stem(n,Rxy);
xlabel('n');
ylabel('Rxy[n]');
title('crosscorrelation');

function [ y ] = flinconv( x,h )


L=length(x);
M=length(h);
N=L+M-1
x=[x,zeros(1,N-L)];
h=[h,zeros(1,N-M)];
y=zeros(1,N);
for n=1:N
y(n)=0;
for k=1:n
y(n)=y(n)+x(k)*h(n-k+1);
end
end
end

5. Difference Equation
AIM: To solve the difference equation

Theory: The difference equation is a formula for computing an output sample at time based on
past and present input samples and past output samples in the time domain. We may write the
general, causal, LTI difference equation as follows:

Y(n)

Where x is the input signal, y is the output signal, and the constants bi, ai are called the
coefficients. Where i=0, 1, 2,  N.
Program
%solve difference equqtion of a digital system
b=input('Coefficients of x[n] terms = ');

Department of Electronics & Communication Engineering Page 34


DSP LABORATORY- 15ECL57 VVIET, MYSURU

a=input('Coefficients of y[n] terms = ');


xn=input('Enter the input exitation x[n] = '); %of length 1 to 100
yi=input('Enter the initial conditions of y = '); %if necessary yi of length 1 to (a-1)
initialc=filtic(b,a,yi);
y_complete=filter(b,a,xn,initialc);
disp('y_complete');
disp(y_complete);

y_forced=filter(b,a,xn);
disp('y_forced');
disp(y_forced);

y_natural=y_complete-y_forced;
disp('y_natural');
disp(y_natural);

subplot(3,1,1);
stem(y_natural);
title('Natural response of the system');
subplot(3,1,2);
stem(y_forced);
title('Forced response of the system');
subplot(3,1,3);
stem(y_complete);
title('Complete response of the system');

Output
Enter the parameters of Difference Equation of a digital system
Coefficients of x[n] terms = 1
Coefficients of y[n] terms = [1 -1 0.9]
Enter the input exitation x[n] = [1 zeros(1,99)]
Enter the initial conditions of y = [-1 0 0]

Department of Electronics & Communication Engineering Page 35


DSP LABORATORY- 15ECL57 VVIET, MYSURU

6. N-point DFT
AIM: To find DFT of a given sequence.
THEORY: In mathematics, the discrete Fourier transform (DFT) is a specific kind of Fourier
transform, used in Fourier analysis. It transforms one function into another, which is called the
frequency domain representation, or simply the DFT, of the original function (which is often a
function in the time domain). But the DFT requires an input function that is discrete and whose
non-zero values have a limited (finite) duration. Such inputs are often created by sampling a
continuous function, like a person's voice.
The input to the DFT is a finite sequence of real or complex numbers (with more abstract
generalizations discussed below), making the DFT ideal for processing information stored in
computers. In particular, the DFT is widely employed in signal processing and related fields to
analyze the frequencies contained in a sampled signal, to solve partial differential equations, and
to perform other operations such as convolutions or multiplying large integers. A key enabling
factor for these applications is the fact that the DFT can be computed efficiently in practice using
a fast Fourier transform (FFT) algorithm.

The sequence of N complex numbers x0, ..., xN−1 is transformed into the sequence of N
complex numbers X0, ..., XN−1 by the DFT according to the formula:

% Matlab program for computation of DFT using built in function

N = input('Enter the the value of N=' );


x = input('Enter the sequence x(n)=' );
L=length(x);
x =[x,zeros(1,N-L)];
Xk=fft(x,N);

Department of Electronics & Communication Engineering Page 36


DSP LABORATORY- 15ECL57 VVIET, MYSURU

disp(Xk)
MagX=abs(Xk);
Phasex=angle(Xk);

subplot(2,1,1);
stem(k,MagX);
subplot(2,1,2);
stem(k,PhaseX);

% Matlab program for computation of DFT without using built in function

clear all;
close all;
N = input('Enter the the value of N=' );
x = input('Enter the sequence x(n)=' );
L=length(x);
x =[x,zeros(1,N-L)];
n=[0:1:N-1];
k=[0:1:N-1];
WN=exp(-1j*2*pi/N)
nk=n'*k;
disp(nk);
WNnk=WN.^nk;
Xk=x*WNnk;
disp(Xk)
MagX=abs(Xk);
Phasex=angle(Xk);

subplot(2,1,1);
stem(k,MagX);
subplot(2,1,2);
stem(k,PhaseX);

Output
Enter the sequence x[n]= [1 2 3 4]
Enter the value N point= 4
N point DFT is X[k] =
10.0000
-2.0000 + 2.0000i
-2.0000 - 0.0000i
-2.0000 - 2.0000i

Department of Electronics & Communication Engineering Page 37


DSP LABORATORY- 15ECL57 VVIET, MYSURU

7. Properties of Discrete Fourier Transform

Linearity property : DFT(x1[n]+x2[n])= X1[k]+X2[k]


x1 = input(‘Enter value of x1 =’);
x2 = input(‘Enter value of x2 =’);
N = input(‘Enter value of N =’);
X1 = fft(x1, N);
X2 = fft(x2, N);
x3 = x1 + x2;
LHS = fft(x3, N);
RHS = X1 + X2;
disp(‘LHS =’);
disp(LHS)
disp(‘RHS =’);
disp(RHS)
if(LHS==RHS)
disp(‘linearity property is verified’);
end

Output
x1=[1 2 3 4]
X2=[1 1 1 1]
linear property is verified

Department of Electronics & Communication Engineering Page 38


DSP LABORATORY- 15ECL57 VVIET, MYSURU

Parseval’s Theorem
x = input(‘Enter value of x =’);
N = input(‘Enter value of N =’);
X = fft(x, N);
LHS = sum(abs(x.^2);
disp(‘LHS=’)
disp(LHS)
RHS = sum(abs(X.^2);
disp(‘RHS=’)
disp(RHS)
if(LHS==RHS)
disp(‘Parseval’s theorem is verified’);
end

Output
x1=[1 2 3 4]
N=4
Parsevals theorem is verified

Circular convolution (Multiplication of two DFTs)


x1 = input(‘Enter value of x1 =’);
x2 = input(‘Enter value of x2 =’);
N = input(‘Enter value of N =’);
X1 = fft(x1, N);
X2 = fft(x2, N);
x3 = cconv(x1,x2,N);
LHS = fft(x3, N);
RHS = X1 .* X2;
disp(‘LHS =’);
disp(LHS)
disp(‘RHS =’);
disp(RHS)
if(LHS==RHS)
disp(‘circular convolution property is verified’);
end

output
x1=[1 2 3 4]
x2=[1 2 3 4]
circular convolution is verified

Department of Electronics & Communication Engineering Page 39


DSP LABORATORY- 15ECL57 VVIET, MYSURU

Multiplication of two signals (Circular convolution of two DFTs)


x1 = input(‘Enter value of x1 =’);
x2 = input(‘Enter value of x2 =’);
N = input(‘Enter value of N =’);
X1 = fft(x1, N);
X2 = fft(x2, N);
x3 = x1.*x2;
LHS = fft(x3, N);
RHS = (cconv(X1, X2,N))/N;
disp(‘LHS =’);
disp(LHS)
disp(‘RHS =’);
disp(RHS)
if(LHS==RHS)
disp(‘multiplication property is verified’);
end

Output
x1=[1 2 3 4]
X2=[1 1 1 1]
multiplication property is verified

Circular time reversal:DFT((x[-n]N)=X([-k]N)


x = input(‘Enter value of x =’);
N = input(‘Enter value of N =’);
X = fft(x,N);
xm = [x(1) x(N:-1:2)];
LHS = fft(xm,N);
RHS = [X(1) X(N:-1:2)];
disp(‘LHS =’);
disp(LHS)
disp(‘RHS =’);
disp(RHS)
if(LHS==RHS)
disp(‘Circular time reversal property is verified’);
end

Department of Electronics & Communication Engineering Page 40


DSP LABORATORY- 15ECL57 VVIET, MYSURU

Output
x1=[1 2 3 4]
Time reversal property is verified

8. FIR Filters
Rectangular Low Pass filter
fc=input('enter the cutoff frequency=');
fs=input('enter the sampling frequency=');
nfc=fc/(fs/2);
N=input('enter the window length=');
hn=fir1(N-1,nfc,rectwin(N));
[h,f]=freqz(hn,1,512,fs);
plot(f,20*log10(abs(h)));
title('frequency response of the filter');
xlabel('frequency')
ylabel('magnitude')

Output
enter the cutoff frequency=125
enter the sampling frequency=500
enter the window length=10

Department of Electronics & Communication Engineering Page 41


DSP LABORATORY- 15ECL57 VVIET, MYSURU

Rectangular high Pass filter


fc=input('enter the cutoff frequency=');
fs=input('enter the sampling frequency=');
nfc=fc/(fs/2);
N=input('enter the window length=');
hn=fir1(N-1,nfc,'high',rectwin(N));
[h,f]=freqz(hn,1,512,fs);
plot(f,20*log10(abs(h)));
title('frequency response of the filter');
xlabel('frequency')
ylabel('magnitude')

Output
enter the cutoff frequency=125
enter the sampling frequency=500
enter the window length=11

Hamming Low Pass filter


fc=input('enter the cutoff frequency=');
fs=input('enter the sampling frequency=');

Department of Electronics & Communication Engineering Page 42


DSP LABORATORY- 15ECL57 VVIET, MYSURU

nfc=fc/(fs/2);
N=input('enter the window length=');
hn=fir1(N-1,nfc,hamming(N));
[h,f]=freqz(hn,1,512,fs);
plot(f,20*log10(abs(h)));
title('frequency response of the filter');
xlabel('frequency')
ylabel('magnitude')

Output
enter the cutoff frequency=125
enter the sampling frequency=500
enter the window length=11

Hamming high Pass filter


fc=input('enter the cutoff frequency=');
fs=input('enter the sampling frequency=');
nfc=fc/(fs/2);
N=input('enter the window length=');
hn=fir1(N-1,nfc,'high',hamming(N));
[h,f]=freqz(hn,1,512,fs);

Department of Electronics & Communication Engineering Page 43


DSP LABORATORY- 15ECL57 VVIET, MYSURU

plot(f,20*log10(abs(h)));
title('frequency response of the filter');
xlabel('frequency')
ylabel('magnitude')

Output
enter the cutoff frequency=125
enter the sampling frequency=500
enter the window length=11

Hanniing Low Pass filter


fc=input('enter the cutoff frequency=');
fs=input('enter the sampling frequency=');
nfc=fc/(fs/2);
N=input('enter the window length=');
hn=fir1(N-1,nfc,hann(N));
[h,f]=freqz(hn,1,512,fs);
plot(f,20*log10(abs(h)));
title('frequency response of the filter');
xlabel('frequency')
ylabel('magnitude')

Department of Electronics & Communication Engineering Page 44


DSP LABORATORY- 15ECL57 VVIET, MYSURU

Output
enter the cutoff frequency=125
enter the sampling frequency=500
enter the window length=11

Hanning high Pass filter


fc=input('enter the cutoff frequency=');
fs=input('enter the sampling frequency=');
nfc=fc/(fs/2);
N=input('enter the window length=');
hn=fir1(N-1,nfc,'high',hann(N));
[h,f]=freqz(hn,1,512,fs);
plot(f,20*log10(abs(h)));
title('frequency response of the filter');
xlabel('frequency')
ylabel('magnitude')

Output
enter the cutoff frequency=125
enter the sampling frequency=500
enter the window length=11

Department of Electronics & Communication Engineering Page 45


DSP LABORATORY- 15ECL57 VVIET, MYSURU

9. IIR Filters - Butterworth

AIM: To verify response of digital LPF, BPF,BSF & HPF using MATLAB

THEORY: Digital Low pass filter ,Band pass filter, Band stop filter & High pass filter are
obtained by using Butterworth or Chebyshev filter with coefficients are given. The frequency –
magnitude plot gives the frequency response of the filter.

PROGRAM:
clear all;
close all;
clc;
wp=input('Enter the passband edge Normalised frequency = ');
%wp=wn, for 3dB cutoff frequency
ws=input('Enter the stopband edge Normalised frequency = ');
%wp=[w1 w2]; ws=[w3 w4];
%wp & ws are vectors, for Bandpass & Bandstop
Dp=input('Enter the passband attenuation level (dB) = ');
Ds=input('Enter the stopband attenuation level (dB) = ');

Department of Electronics & Communication Engineering Page 46


DSP LABORATORY- 15ECL57 VVIET, MYSURU

%N=input('Enter the order of the filter = ');


%order=N/2, for Bandpass & Bandstop
[N,wn]=buttord(wp,ws,Dp,Ds); %skip if N & 3dB cutoff frequency is known
[b,a]=butter(N,wn); %replace by following for other filters
%[b,a]=butter(N,wn,'high'); Highpass filter
%[b,a]=butter(N,wn); Bandpass filter
%[b,a]=butter(N,wn,'stop'); Bandstop filter
[h,w]=freqz(b,a);
mag=20*log10(abs(h));
phase=180*angle(h)/pi;
figure(1);
plot(w,abs(h));
title('Butterworth Lowpass Filter');
xlabel('Normalised frequency');
ylabel('Magnitude');
grid;
figure(2);
subplot(2,1,1);
plot(w,mag);
title('Magnitude response');
xlabel('Normalised frequency');
ylabel('Magnitude in dB');
grid; subplot(2,1,2);
plot(w,phase);
title('Phase response');
xlabel('Normalised frequency');
ylabel('Phase in degrees');
grid;
Output
Enter the passband edge Normalised frequency = 0.3
Enter the stopband edge Normalised frequency = 0.6
Enter the passband attenuation level (dB) = 3
Enter the stopband attenuation level (dB) = 40

Department of Electronics & Communication Engineering Page 47


DSP LABORATORY- 15ECL57 VVIET, MYSURU

IIR Filters - Chebyshev


clear all;
close all;
clc;
wp=input('Enter the passband edge Normalised frequency = ');
%wp=wn, for 3dB cutoff frequency
ws=input('Enter the stopband edge Normalised frequency = ');
%wp=[w1 w2]; ws=[w3 w4];
%wp & ws are vectors, for Bandpass & Bandstop
Rp=input('Enter the passband attenuation level (dB) = ');
Rs=input('Enter the stopband attenuation level (dB) = ');
%N=input('Enter the order of the filter = ');
%order=N/2, for Bandpass & Bandstop
[N,wn]=cheb1ord(wp,ws,Rp,Rs);
%skip if order and 3dB cutoff frequency is known
[b,a]=cheby1(N,Rp,wn); %replace by following for other filters
%[b,a]=cheby1(N,Rp,wn,'high'); Highpass filter
%[b,a]=cheby1(N,Rp,wn); Bandpass filter
%[b,a]=cheby1(N,Rp,wn,'stop'); Bandstop filter
[h,w]=freqz(b,a);
mag=20*log10(abs(h));
phase=180*angle(h)/pi;
figure(1);

Department of Electronics & Communication Engineering Page 48


DSP LABORATORY- 15ECL57 VVIET, MYSURU

plot(w,abs(h));
title('Chebyshev Lowpass Filter');
xlabel('Normalised frequency');
ylabel('Magnitude');
grid;
figure(2);
subplot(2,1,1);
plot(w,mag);
title('Magnitude response');
xlabel('Normalised frequency');
ylabel('Magnitude in dB');
grid;
subplot(2,1,2);
plot(w,phase);
title('Phase response');
xlabel('Normalised frequency');
ylabel('Phase in degrees');
grid;

Output
Enter the passband edge Normalised frequency = 0.3
Enter the stopband edge Normalised frequency = 0.6
Enter the passband attenuation level (dB) = 3
Enter the stopband attenuation level (dB) = 40

Department of Electronics & Communication Engineering Page 49


DSP LABORATORY- 15ECL57 VVIET, MYSURU

EXTRA PROGRAMS:
1.Sum of Sinusoidal Signals
AIM: To verify Sum of Sinusoidal Signals using MATLAB
THEORY: To generate fourier series of a signal by observing sum of sinusoidal signals &
observing gibbs phenomenon effect.

PROGRAM:
% sum of sinusoidal signals
clc;
clear all;
close all;
tic;
%giving linear spaces
t=0:.01:pi;
% t=linspace(0,pi,20);
%generation of sine signals
y1=sin(t);
y2=sin(3*t)/3;
y3=sin(5*t)/5;
y4=sin(7*t)/7;
y5=sin(9*t)/9;
y = sin(t) + sin(3*t)/3 + sin(5*t)/5 + sin(7*t)/7 + sin(9*t)/9;
plot(t,y,t,y1,t,y2,t,y3,t,y4,t,y5);
legend('y','y1','y2','y3','y4','y5');
title('generation of sum of sinusoidal signals');grid;
ylabel('---> Amplitude');
xlabel('---> t');

Department of Electronics & Communication Engineering Page 50


DSP LABORATORY- 15ECL57 VVIET, MYSURU

toc;

RESULT:

2.Power Spectral Density


AIM: To verify Power Spectral Density

THEORY:
The power spectral density(P.S.D) is a measurement of the energy at various frequencies.

PROGRAM:
%Power spectral density
t = 0:0.001:0.6;
x = sin(2*pi*50*t)+sin(2*pi*120*t);
y = x + 2*randn(size(t));
figure,plot(1000*t(1:50),y(1:50))
title('Signal Corrupted with Zero-Mean Random Noise')
xlabel('time (milliseconds)');
Y = fft(y,512);
%The power spectral density, a measurement of the energy at various frequencies, is:
Pyy = Y.* conj(Y) / 512;
f = 1000*(0:256)/512;
figure,plot(f,Pyy(1:257))
title('Frequency content of y');
xlabel('frequency (Hz)');

Department of Electronics & Communication Engineering Page 51


DSP LABORATORY- 15ECL57 VVIET, MYSURU

CHAPTER 4
C Programs

1.Linear Convolution using ccstudio


#include <stdio.h>
#include <math.h>
int n,k,L,M,N,x[10],h[10],y[20];
void main()
{
printf("Enter the length of x\n");
scanf("%d",&L);
printf("Enter the length of h\n");
scanf("%d",&M);
printf("Enter x\n");
for(n=0;n<L;n++)
scanf("%d",&x[n]);
printf("Enter h\n");
for(n=0;n<M;n++)
scanf("%d",&h[n]);
N=L+M-1;
for(n=L;n<N;n++)
x[n]=0;
for(n=M;n<N;n++)
h[n]=0;

for(n=0;n<N;n++)
{
y[n]=0;
for(k=0;k<=n;k++)

Department of Electronics & Communication Engineering Page 52


DSP LABORATORY- 15ECL57 VVIET, MYSURU

y[n]+=x[k]*h[n-k];
}
printf("Linear convolution, y is ");
for(n=0;n<N;n++)
printf("%d ",y[n]); }

output
Enter the length of x =4
Enter the length of h=2
Enter x=1 2 3 4
Enter h =1 2 3 4
Linear convolution, y is 1 4 10 20 25 24 16

2. Circular Convolution using ccstudio only

1.Linear Convolution using ccstudio


#include <stdio.h>
#include <math.h>
int n,m,L,M,N,x[10],h[10],y[20];
void main()
{
printf("Enter the length of x\n");
scanf("%d",&L);
printf("Enter the length of h\n");
scanf("%d",&M);
printf("Enter x\n");
for(n=0;n<L;n++)
scanf("%d",&x[n]);
printf("Enter h\n");
for(n=0;n<M;n++)
scanf("%d",&h[n]);
N=L+M-1;
for(n=L;n<N;n++)
x[n]=0;
for(n=M;n<N;n++)
h[n]=0;

for(n=0;n<N;n++)
{
y[n]=0;
for(m=0;m<N;m++)
y[n]+=x[m]*h[((n-m)%N)];
}

Department of Electronics & Communication Engineering Page 53


DSP LABORATORY- 15ECL57 VVIET, MYSURU

printf("Circular convolution, y is ");


for(n=0;n<N;n++)
printf("%d ",y[n]); }

Output
Enter the length of x= 4
Enter x = 1 2 3 4
Enter the length of h= 3
Enter h =1 2 3
Circular convolution, y is 18 16 10 16

3. N-Point DFT

#include <stdio.h>
#include <math.h>
void main()
{
int i,j,n;
short N;
short x[10];
float pi=3.1416;
float sumRe,sumIm, cosine=0,sine=0;
float out_real[10]={0.0},out_image[10]=(0.0);
printf("Enter the length of the sequence\n");
scanf("%d",&n);
printf("Enter N\n");
scanf("%d",&N);
printf("Enter x\n");
for(i=n+1;i<N;i++)
scanf("%d",&x[i]);
if(N>n)
for(i=n;i<N;i++)
x[i]=0;
printf("N point DFT is\n");
for(i=0;i<N;i++)
{
sumRe=0;
sumIm=0;
for(j=0;j<N;j++)
{
cosine=cos(2*pi*i*j/N);
sine=sin(2*pi*i*j/N);
sumRe+=x[j]*cosine;
sumIm+=x[j]*sine;
}

Department of Electronics & Communication Engineering Page 54


DSP LABORATORY- 15ECL57 VVIET, MYSURU

out_real[i]=sumRe;
out_imag[i]=sumIm;
printf("%.1f +j(%.1f)\n",out_real[i],out_imag[i]);
}
}
Output
Enter the length of the sequence =4
Enter N =4
Enter x =1 2 3 4
N point DFT is
10.0 +j(0.0)
-2.0 +j(-2.0)
-2.0 +j(-0.0)
-2.0 +j(2.0)

4a. Program for first order impulse response


#include <stdio.h>
void main()
{
int N,k,n;
float b[2],a[2],y[10],sum1,sum2;
int x[10]={1,0,0,0,0,0,0,0,0,0,0};
printf(“enter the value of N=”);
scanf(“%d”, &N);
printf(“enter co-efficient of x(n-k)”,b=);
for (k=0:k<=N;k++)
scanf(“%d”, &b[k]);
printf(“enter co-efficient of y(n-k)”,a=);
for (k=0:k<=N;k++)
scanf(“%d”, &a[k]);
y[0]=b[0]*x[0];
for(n=1;n<10;n++)
{
Sum1=0.0;

Department of Electronics & Communication Engineering Page 55


DSP LABORATORY- 15ECL57 VVIET, MYSURU

Sum2=0.0;
for (k=0:k<=N;k++)
sum1=sum1+b[k]*x[n-k];
sum1=sum1-a[k]*y[n-k];
y[n]=sum1+sum2;
}
for(n=0;n<10;n++)
printf(“y[%d]=%f\n”,n,y[n]);
}
Output
enter the value of N=1
enter co-efficient of x(n-k) b=2,2
enter co-efficient of y(n-k) a=1,2
y[0]=2.00
y[1]=-2.00
y[2]=4.00
y[3]=-8.00
y[4]=16
y[5]=32
y[6]=64
y[7]=-128
y[8]=256
y[9]=-512

4b. Program for second order impulse response


#include <stdio.h>
void main()
{
int N,k,n;
float b[3],a[3],y[10],sum1,sum2;

Department of Electronics & Communication Engineering Page 56


DSP LABORATORY- 15ECL57 VVIET, MYSURU

int x[10]={1,0,0,0,0,0,0,0,0,0,0};
printf(“enter the value of N=”);
scanf(“%d”, &N);
printf(“enter co-efficient of x(n-k)”,b=);
for (k=0:k<=N;k++)
scanf(“%d”, &b[k]);
printf(“enter co-efficient of y(n-k)”,a=);
for (k=0:k<=N;k++)
scanf(“%d”, &a[k]);
y[0]=b[0]*x[0];
y[1]=b[1]*x[0]-a[1]*y[0];
for(n=2;n<10;n++)
{
Sum1=0.0;
Sum2=0.0;
for (k=0:k<=N;k++)
sum1=sum1+b[k]*x[n-k];
sum1=sum1-a[k]*y[n-k];
y[n]=sum1+sum2;
}
for(n=0;n<10;n++)
printf(“y[%d]=%f\n”,n,y[n]);
}
Output
enter the value of N=2
enter co-efficient of x(n-k) b=3 2 2
enter co-efficient of y(n-k) a=1 2 2
y[0]=3.00
y[1]=-4.00
y[2]=4.00

Department of Electronics & Communication Engineering Page 57


DSP LABORATORY- 15ECL57 VVIET, MYSURU

y[3]=-0.00
y[4]=-8
y[5]=16
y[6]=-16
y[7]=0
y[8]=32
y[9]=-64

5 .FIR FILTER

AIM :To verify FIR filters.

THEORY:
A Finite Impulse Response (FIR) filter is a discrete linear time-invariant system whose output is
based on the weighted summation of a finite number of past inputs. An FIR transversal filter
structure can be obtained directly from the equation for discrete-time convolution.

In this equation, x(k) and y(n) represent the input to and output from the filter at time n. h(n-k) is
the transversal filter coefficients at time n. These coefficients are generated by using FDS (Filter
Design Software or Digital filter design package). FIR – filter is a finite impulse response filter.
Order of the filter should be specified. Infinite response is truncated to get finite impulse
response. placing a window of finite length does this. Types of windows available are
Rectangular, Barlett, Hamming, Hanning, Blackmann window etc. This FIR filter is an all zero
filter.

PROGRAM:
#include<stdio.h>
#include<math.h>
#define pi 3.1415
int n,N,c;
float wr[64],wt[64];
void main()
{
printf("\n enter no. of samples,N= :");
scanf("%d",&N);
printf("\n enter choice of window function\n 1.rect \n 2. triang \n c= :");
scanf("%d",&c);
printf("\n elements of window function are:");
switch(c)

Department of Electronics & Communication Engineering Page 58


DSP LABORATORY- 15ECL57 VVIET, MYSURU

{
case 1:
for(n=0;n<=N-1;n++)
{
wr[n]=1;
printf(" \n wr[%d]=%f",n,wr[n]);
}
break;
case 2:
for(n=0;n<=N-1;n++)
{
wt[n]=1-(2*(float)n/(N-1));
printf("\n wt[%d]=%f",n,wt[n]);
}
break;
}
}

6.IIR FILTER
Aim:To design and implement IIR (LPF/HPF)filters.
THEORY:
The IIR filter can realize both the poles and zeroes of a system because it has a rational transfer
function, described by polynomials in z in both the numerator and the denominator:

The difference equation for such a system is described by the following:

M and N are order of the two polynomials bk and ak are the filter coefficients. These filter
coefficients are generated using FDS (Filter Design software or Digital Filter design package).
Department of Electronics & Communication Engineering Page 59
DSP LABORATORY- 15ECL57 VVIET, MYSURU

IIR filters can be expanded as infinite impulse response filters. In designing IIR filters, cutoff
frequencies of the filters should be mentioned. The order of the filter can be estimated using
butter worth polynomial. That’s why the filters are named as butter worth filters. Filter
coefficients can be found and the response can be found and the response can be plotted.

PROGRAM:
//iirfilters
#include<stdio.h>
#include<math.h>
int i,w,wc,c,N;
float H[100];
float mul(float, int);
void main()
{
printf("\n enter order of filter ");
scanf("%d",&N);
printf("\n enter the cutoff freq ");
scanf("%d",&wc);
printf("\n enter the choice for IIR filter 1. LPF 2.HPF ");
scanf("%d",&c);
switch(c)
{
case 1:
for(w=0;w<100;w++)
{
H[w]=1/sqrt(1+mul((w/(float)wc),2*N));
printf("H[%d]=%f\n",w,H[w]);
}
break;
case 2:
for(w=0;w<=100;w++)
{
H[w]=1/sqrt(1+mul((float)wc/w,2*N));
printf("H[%d]=%f\n",w,H[w]);
}
break;
}}
float mul(float a,int x)
{
for(i=0;i<x-1;i++)
a*=a;
return(a);
}

Department of Electronics & Communication Engineering Page 60


DSP LABORATORY- 15ECL57 VVIET, MYSURU

RESULT :

VIVA QUESTIONS
01) What is Signal ?
02) What is System?
03) What are the different types of Signal?
04) What is the difference between ASP and DSP?
05) What are the applications of DSP?
06) What are the Advantages and disadvantages of DSP?
07) How the signals are mainly classified ?
08) What is 1-D, 2-D signal ? Give example ?
09) What is Analog Signal Processing ?
10) What is Digital Signal Processing ?
11) What are the applications of signal processing?
12) What is alising ?
13) What is Nyquist criterion ?
14) What is Processing ?
15)hat is the difference between analog & digital signals ? Give examples
16) What is the difference between data and information ?
17) What is DFT ?
18) What is the difference between DFT & DFS ?
19) What is Time Domain ?
20) What is Frequency domain ?

Department of Electronics & Communication Engineering Page 61


DSP LABORATORY- 15ECL57 VVIET, MYSURU

21) What is convolution?


22) What is Linear Convolution?
23) What are the applications of Linear Convolution?
24) What are the advantages of Linear Convolution compared to Circular convolution?
25) What is Circular Convolution ?
26) What are the applications of Circular Convolution ?
27) How Circular Convolution is different from Linear Convolution ?
28) What are the advantages of Circular Convolution compared to Linear convolution?
29) What is the difference between Linear convolution and Circular convolution?
30) What is correlation ?
31) What is auto-correlation ?
32) What is cross-correlation ?
33) What are the applications of correlation ?
34) What are the advantages of correlation ?
35) What is Impulse response ?
36) How the impulse response can be obtained?
37) How the impulse response is represented?
38) How it is difference from Step and Ramp response?
39) How impulse response can be obtained from either Step or Ramp response?
40) What are the applications of Impulse response?
41) What are the advantages of Impulse response?
42) What is the function of ‘impz’ command?
43) What is the function of ‘plot’ command?
44) What is the function of ‘grid’ command?
45) What is the difference between ‘plot’ and ‘subplot’ command?
46) What are the differences between difference and differential equation?
47) What are applications of difference equation?
48) What is the function of ‘stem’ command?
49) What is the function of ‘title’ command?
50) What is the function of ‘disp’ command?

Department of Electronics & Communication Engineering Page 62


DSP LABORATORY- 15ECL57 VVIET, MYSURU

51) What is sampling theorem ?


52) What is filter ?
53) What is Nyquist criterion?
54) How the signals are get sampled?
55) What is aliasing?
56) What is IIR Filter ?
57) How the filters are classified ?
58) What is Passband & Stopband ?
59) What is Transition band ?
60) What is cut-off frequency ?
61) What is attenuation ?
61) What is FIR Filter ?
62) What is the difference between IIR and FIR Filter ?
63) What are applications of IIR and FIR Filter ?
64) What is quantization noise ?
65) What is Processor ?
66) What is Fixed-point processor ?
67) What is floating point processor ?
68) Which is more convenient and fast ?
69) What is simulator ?
70) What is emulator ?

** * **

Department of Electronics & Communication Engineering Page 63

Вам также может понравиться