Sie sind auf Seite 1von 140

DIGITAL SIGNAL PROCESSING LAB 201

1
DIGITAL SIGNAL PROCESSING LAB
LAB MANUAL
(ECE-IV/IV I-Semester)
PREPARED BY
T.SRAVANTHI /P.JAHNAVI
Department of Electronics and Communication Engineering
VIGNANA BHARATHI INSTITUTE OF
TECHNOLOGY
Aushapur (V), Ghatkesar (M), Rangareddy (Dt).-501301.
VBIT
Page 1
DIGITAL SIGNAL PROCESSING LAB 201
1
JNTU Syllabus
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY
HYDERABAD
IV Year B.Tech. ECE I-Sem T P C
0 3 2
DIGITAL SIGNAL PROCESSING LAB
LIST OF EXPERIMENTS :
1. To study the architecture of DSP chips TMS 320C 5X/6X Instructions.
2. To verify linear convolution.
3. To verify the circular convolution.
4. To design FIR filter (LP/HP) using windowing technique
a) Using rectangular window
b) Using triangular window
c) Using Kaiser window
5. To Implement IIR filter (LP/HP) on DSP Processors
6. N-point FFT algorithm.
7. MATLAB program to generate sum of sinusoidal signals.
8. MATLAB program to find frequency response of analog LP/HP filters.
9. To compute power density spectrum of a sequence.
10. To find the FFT of given 1-D signal and plot.
VBIT
Page 2
DIGITAL SIGNAL PROCESSING LAB 201
1
LIST OF EXPERIMENTS CONDUCTED
INDEX
I. Introduction to MATLAB 6
CYCLE-I
Basic MATLAB programs
1 Basic Matrix Operations 20
2 Signal generation ,operations and sum of sinusoidal signals
23
3 Fast Fourier Transform 27
(a) DFT & IDFT using inbuilt functions
(b) DFT & IDFT using equation
(c) N-point DFT & IDFT using inbuilt functions
(d) N-point DFT & IDFT using equation
4 Convolution 36
(a) Linear convolution using inbuilt function
(b) Linear convolution using equation
(c) Circular convolution using equation
(d) Linear convolution using circular convolution
5 Power Spectral Density 46
(a) Power Spectral Density of sum of sinusoidal signal without noise
(b) Power Spectral Density of sum of sinusoidal signal with noise
VBIT
Page 3
DIGITAL SIGNAL PROCESSING LAB 201
1
CYCLE-II
IIR and FIR filters
6 IIR LPF Filters magnitude response for various order of N 51
(a) Butterworth filter
(b) Chebyshev Type-I filter
(c) Chebyshev Type-II filter
7 IIR Digital Filter Design 57
(a) Butterworth Low Pass Filter
(b) Butterworth High Pass Filter
(c) Butterworth Band Pass Filter
(d) Butterworth Band Stop Filter
(e) Chebyshev Type-I Low Pass Filter
(f) Chebyshev Type-I High Pass Filter
(g) Chebyshev Type-I Band Pass Filter
(h) Chebyshev Type-I Band Stop Filter
(i) Chebyshev Type-II Low Pass Filter
(j) Chebyshev Type-II High Pass Filter
(k) Chebyshev Type-II Band Pass Filter
(l) Chebyshev Type-II Band Stop Filter
8 IIR Analog Filter Design 76
(a) Butterworth Low Pass Filter
(b) Butterworth High Pass Filter
(c) Butterworth Band Pass Filter
(d) Butterworth Band Stop Filter
(e) Chebyshev Type-I Low Pass Filter
(f) Chebyshev Type-I High Pass Filter
(g) Chebyshev Type-I Band Pass Filter
(h) Chebyshev Type-I Band Stop Filter
(i) Chebyshev Type-II Low Pass Filter
(j) Chebyshev Type-II High Pass Filter
VBIT
Page 4
DIGITAL SIGNAL PROCESSING LAB 201
1
(k) Chebyshev Type-II Band Pass Filter
(l) Chebyshev Type-II Band Stop Filter
9 FIR Filter Design using windows 94
(a) Response of windows
(b) Low pass filter using windows
(c) High pass filter using windows
(d) Band pass filter using windows
(e) Band stop filter using windows
(f) FIR filter design using Kaiser window
CYCLE-III
Code Composer Studio
10 Architecture of DSP chips-TMS 320C 6713 DSP
Processor
112
11 Verification of convolution using CC Studio 118
(a) Linear convolution
(b) circular convolution
Viva Questions 124
VBIT
Page 5
DIGITAL SIGNAL PROCESSING LAB 201
1
INTRODUCTION TO MATLAB
MATLAB is a high-performance language for technical computing. It integrates
computation, visualization, and programming in an easy-to-use environment where problems and
solutions are expressed in familiar mathematical notation.
Typical uses include Math and computation Algorithm development Data acquisition
Modeling, simulation, and prototyping Data analysis, exploration, and visualization Scientific
and engineering graphics Application development, including graphical user interface building
The name MATLAB stands for matrix laboratory.
Introduction to the Desktop
Use desktop tools to manage your work and become more productive using MATLAB
software. You can also use MATLAB functions to perform the equivalent of most of the features
found in the desktop tools.
The following illustration shows the default configuration of the MATLAB desktop. You
can modify the setup to meet your needs.
VBIT
Page 6
DIGITAL SIGNAL PROCESSING LAB 201
1
Arranging the Desktop
These are some common ways to customize the desktop:
Show or hide desktop tools via the Desktop menu.
Resize any tool by dragging one of its edges.
Move a tool outside of the desktop by clicking the undock button in the tool's title bar.
Reposition a tool within the desktop by dragging its title bar to the new location. As you
drag, a blue box indicates the new tool position until you release the mouse button. You
can drag more than one tools to the same position, in which case they become the same
size and their title bars become tabs. Access a tabbed tool by clicking the tab displaying
its name.
Maximize or minimize (temporarily hide) a tool within the desktop via the Desktop
menu.
VBIT
Page 7
DIGITAL SIGNAL PROCESSING LAB 201
1
Change fonts, customize the toolbar, and access other options by using File >
Preferences.
Start Button
The MATLAB Start button provides easy access to tools, demos, shortcuts, and
documentation. Click the Start button to see the options.
Command Window
Use the Command Window to enter variables and to run MATLAB functions and scripts.
MATLAB displays the results.
VBIT
Page 8
DIGITAL SIGNAL PROCESSING LAB 201
1
Press the up arrow key to recall a statement you previously typed. Edit the statement as
needed, and then press Enter to run it. For more information about entering statements in the
Command Window, see Controlling Command Window Input and Output.
There are other tools available to help you remember functions and their syntax, and to
enter statements correctly. For example, to look for functions, use the Function Browser to look
for functionsclick the button at the left of the prompt to open the tool. For more information
on ways to get help while you work in the Command Window, see Avoid Mistakes When
Entering Code.
Command History
Statements you enter in the Command Window are logged with a timestamp in the
Command History. From the Command History, you can view and search for previously run
statements, as well as copy and execute selected statements. You can also create a file from
selected statements.
To save the input and output from a MATLAB session to a file, use the diary function.
Ways to Get Help
VBIT
Page 9
DIGITAL SIGNAL PROCESSING LAB 201
1
There are different ways to get help, depending on your needs. The following table
summarizes the main ways.
To... Try This More Information
Look for getting
started guides, code
examples, demos,
and more.
In the Help browser
Contents pane, expand
the listing for a product.
To open the Help browser, select Help >
Product Help.
Find information
about any topic.
In the Help browser
search field, type words
you want to look for in
the documentation or
demos. Then press
Enter.
Searching for Documentation and Demos
View help for a
function or block.
Run doc name to display
the reference page in the
Help browser.
For quick help in the
Command Window, run
help name. Sometimes,
the help text shows
function names in all
uppercase letters to
distinguish them from
other text. When you use
function names, do not
use all uppercase letters.
doc reference page
help reference page
Find a function and
view help for it.
Select Help > Function
Browser, then search or
browse.
Find Functions Using the Function Browser
Get syntax and
function hints while
using the Command
Window and Editor.
Use colors and other
cues to determine correct
syntax.
While entering a
function, pause after
typing the left
parenthesis. A summary
of syntax options
Avoid Mistakes When Entering Code
VBIT
Page 10
DIGITAL SIGNAL PROCESSING LAB 201
1
To... Try This More Information
displays in a temporary
window.
Get specific help
while using a tool.
Use the context-sensitive
help, which some tools
provide. Access the help
using standard methods,
such as Help buttons and
context menus.
See the documentation for a tool to learn about
any special context-sensitive help available.
Check code for
problems and get
recommendations
for improvements.
In the Editor, view M-
Lint messages.
Avoid Mistakes While Editing Code
Searching for Documentation and Demos
Use the Help browser to find documentation and demos that contain your search terms:
1.In the Help browser Search field, enter the words you want to look for. Search finds
sections containing all the words, unless you use any of the syntax options described in the
following table.
Option Syntax Example
Exact phrase " " around phrase
(quotation marks)
"word1 word2"
Wildcards for partial
word searching
* in place of characters word*
Some of the words OR between words word1 OR word2
Exclude words NOT before excluded
word
word1 NOT word2
2.For example, enter plot tool* label.
3.Press Enter.
The Search Results pane lists matching sections. An icon indicates the type of information.
VBIT
Page 11
DIGITAL SIGNAL PROCESSING LAB 201
1
4. Arrange results:
The default sort order is by relevance. Change the order by clicking the column
header for Type or Product.
For results sorted by Type or Product, you can collapse and expand results for a
type or product group. To expand or collapse all groups, right-click in the Search
Results pane, and select the option you want from the context menu.
1. Select a result to view the page.
The Help browser highlights the search words in the display pane. To clear
highlights, select Refresh from the Actions button .
To see where the result is within the contents, use the navigation bar at the top of
the page.
Or click the Contents tab.
VBIT
Page 12
DIGITAL SIGNAL PROCESSING LAB 201
1
1. The default presentation includes previews of text for each result found. To show more
results in the Help Navigator, you can hide the previews:
Right-click in the Help Navigator and select Hide Previews from the context
menu.
The Help Navigator only displays section titles and icons for them.
To see the previews again, right-click in the Help Navigator and select Show
Previews
The following illustration shows the effect of hiding text previews and the context menu
item for restoring them.
VBIT
Page 13
DIGITAL SIGNAL PROCESSING LAB 201
1
Workspace Browser
The MATLAB workspace consists of the set of variables built up during a MATLAB
session and stored in memory. You add variables to the workspace by using functions, running
function and script files, and loading saved workspaces.
To view the workspace and information about each variable, use the Workspace browser,
or use the functions who and whos.
To delete variables from the workspace, select the variables, and then select Edit >
Delete. Alternatively, use the clearvars or clear functions.
The workspace does not persist after you end the MATLAB session. To save the
workspace to a file that can be read during a later MATLAB session, select File > Save, or use
the save function. Saving preserves the workspace in a binary file called a MAT-file, which has a
VBIT
Page 14
DIGITAL SIGNAL PROCESSING LAB 201
1
.mat extension. You can use options to save to different formats. To read in a MAT-file, select
File > Import Data, or use the load function.
Variable Editor
Double-click a variable in the Workspace browser, or use openvar variablename, to see it
in the Variable Editor. Use the Variable Editor to view and edit a visual representation of
variables in the workspace.
How MATLAB Helps You Manage Files
MATLAB provides tools and functions to help you:
Find a file you want to view, change, or run
Organize your files
Ensure MATLAB can access a file so you can run or load it
Using the Current Folder Browser to Manage Files
The Current Folder browser is a key tool for managing files.
Open the Current Folder browser by selecting Desktop > Current Folder from the
MATLAB desktop.
VBIT
Page 15
DIGITAL SIGNAL PROCESSING LAB 201
1
Use the Current Folder browser to:
See the contents of the current folder.
View and change the current folder using the address bar.
Find files and folders using the search tool .
Arrange information about files and folders using the View menu.
Change files and folders, such as renaming or moving them.
Run, open, get help for, and perform other actions on the selected file or folder by right-
clicking and using the context menu.
To create or edit a file select File > New or File > Open, or use the edit function.
The following image shows the Editor with two documents, collatzall.m and collatz.m open.
Notice the following:
Colors highlight various MATLAB language elements blue for keywords, green for
comments.
The code analysis message bar contains an orange box and bar, indicating there are areas
for improvement in the code.
Other Editor features are described in the image.
VBIT
Page 16
DIGITAL SIGNAL PROCESSING LAB 201
1
You can use any text editor to create files, such as Emacs. Use Editor/Debugger
preferences (accessible from the desktop by selecting File > Preferences > Editor/Debugger) to
specify your default editor. If you use another editor, you still can use the MATLAB Editor for
debugging, or you can use debugging functions, such as dbstop, which sets a breakpoint.
To view the contents of a file, you can display the contents in the Command Window
using the type function.
Use code analysis to help you identify problems and potential improvements in your
code. For details, see Improving and Tuning Your MATLAB Programs.
You can evaluate your code in sections (called code cells). Also, you can publish your
code, including results, to popular output formats like HTML. For more information, see
Evaluate Subsections of Files Using Code Cells in the MATLAB Desktop Tools and
Development Environment documentation.
Identifying Problems and Areas for Improvement
Use code analysis to help you write correct and efficient MATLAB code. Code analysis:
Identifies areas for improvement by underlining code in orange
VBIT
Page 17
DIGITAL SIGNAL PROCESSING LAB 201
1
Identifies errors by underlining code in red
Provides short messages, called Code Analyzer messages, to describe all suspected
trouble spots
Provides extended Code Analyzer messages for many suspected trouble spots
Provides automated fixes for many trouble spots
The following images show code with a message at line 22 and 23. The Details button in the
first message indicates that an extended message is available for that first problem. To have
MATLAB fix a problem for you, click the Fix button, if displayed.
When you click a Details button, the message extends and provides a detailed
explanation, a suggested action, and sometimes links to the documentation.
VBIT
Page 18
DIGITAL SIGNAL PROCESSING LAB 201
1
2-D Plotting
You can visualize vectors of data with 2-D plotting functions that create:Line, area, bar, and pie
charts, Direction and velocity plots ,Histograms ,Polygons and surfaces, Scatter/bubble plots,
Animations
VBIT
Page 19
DIGITAL SIGNAL PROCESSING LAB 201
1
CYCLE-I
VBIT
Page 20
DIGITAL SIGNAL PROCESSING LAB 201
1
1. Basic Operations on Matrices
Aim: To write a program to perform basic operations on matrices.
Software used: MATLAB 7.0.4
In built functions:
1. inv - Matrix inverse.
inv(x) is the inverse of the square matrix x. A warning message is printed if x is badly
scaled or nearly singular.
Program:
clc
clear
a=[1,2;3,4]
b=[3,4;1,2]
c=[8;2]
d=[7]
e=a+b
f=a-b
g=a*b
h=b*a
i=a/b
j=a'
k=c'
l=size(h)
m=inv(b)
n=a.*b
o=a.*d
p=a./d
q=a./d
r=a.\b
s=d.\a
v=b.*c
Output:
>>a =
VBIT
Page 21
DIGITAL SIGNAL PROCESSING LAB 201
1
1 2
3 4
b =
3 4
1 2
c =
8
2
d =
7
e =
4 6
4 6
f =
-2 -2
2 2
g =
5 8
13 20
h =
15 22
7 10
i =
0 1
1 0
j =
1 3
2 4
k =
8 2
l =
2 2
m =
1.0000 -2.0000
-0.5000 1.5000
n =
3 8
3 8
o =
7 14
21 28
p =
VBIT
Page 22
DIGITAL SIGNAL PROCESSING LAB 201
1
0.1429 0.2857
0.4286 0.5714
q =
0.1429 0.2857
0.4286 0.5714
r =
3.0000 2.0000
0.3333 0.5000
s =
0.1429 0.2857
0.4286 0.5714
t =
2
4
u =
3 4
??? Error using ==> times
Matrix dimensions must agree.
Error in ==> matoprtns at 24
v=b.*c
Result: Various matrix operations are performed and results are verified.
VBIT
Page 23
DIGITAL SIGNAL PROCESSING LAB 201
1
2. Signal generation, operations and sum of sinusoidal signals
Aim: To write a program to generation of sinusoidal signal and perform operations on it.
Software used: MATLAB 7.0.4
In built functions:
1. sin - Sine of argument in radians.
sin(x) is the sine of the elements of x.
2. plot - Linear plot.
plot(x,y) plots vector y versus vector x. If x or y is a matrix then the vector is plotted
versus the rows or columns of the matrix, whichever line up. If x is a scalar and y is a vector,
length(y) disconnected points are plotted.

3. tittle - Graph title.
tittle('text') adds text at the top of the current axis.
4. xlabel - x-axis label.
xlabel('text') adds text beside the x-axis on the current axis.
xlabel('text','Property1',PropertyValue1,'Property2',PropertyValue2,...) sets the values of
the specified properties of the xlabel.
5. ylabel y-axis label.
ylabel('text') adds text beside the Y-axis on the current axis.
ylabel('text','Property1',PropertyValue1,'Property2',PropertyValue2,...) sets the values of
the specified properties of the ylabel.

6. legend - Display legend.
legend (string1,string2,string3, ...) puts a legend on the current plot using the specified
strings as labels. legend works on line graphs, bar graphs, pie graphs, ribbon plots, etc.
You can label any solid-colored patch or surface object. The font size and font name for the
legend strings matches the axes font size and font name.

7. grid - Grid lines.
VBIT
Page 24
DIGITAL SIGNAL PROCESSING LAB 201
1
grid on - adds major grid lines to the current axes.
grid off - removes major and minor grid lines from the current axes.
8. figure - Create figure window.
figure, by itself, creates a new figure window, and returns its handle.
Program:
clc;
clear all;
close all;
t=-2*pi:0.01:2*pi;
a=sin(t);
%amplitude scaling
b=2*sin(t);
c=sin(t)/2;
plot(t,a,t,b,t,c)
title ('amplitude scaling')
xlabel('time')
ylabel('amplitude')
legend('a','b','c')
grid on
%time reverse
d=sin(-t);
figure;
plot(t,a,t,d)
title ('time reverse')
xlabel('time')
ylabel('amplitude')
legend('a','d')
grid on
%time scaling
e=sin(2*t);
f=sin(t/2)
figure;
plot(t,e,t,f)
title ('time scaling')
xlabel('time')
ylabel('amplitude')
legend('e','f')
grid on
VBIT
Page 25
DIGITAL SIGNAL PROCESSING LAB 201
1
%time shifting
g=sin(t+2);
h=sin(t-2);
i=sin(2-t);
plot(t,g,t,h,t,i)
figure;
title ('time shifting')
xlabel('time')
ylabel('amliptude')
legend('g','h','i')
grid on
%phase shifting
j=sin(t+pi/2);
k=sin(t+3*pi/2);
plot(t,j,t,k)
figure;
title ('phase shifting')
xlabel('time')
ylabel('amplitude')
legend('j','k')
grid on
%sum of sinisoids
l=sin(3*t)/3;
m=sin(5*t)/5;
n=sin(7*t)/7;
o=sin(9*t)/9;
p=a+l+m+n+o
plot(t,a,t,m,t,n,t,o,t,p)
figure;
title ('sum of sinisoids')
xlabel('time')
ylabel('amplitude')
legend('l','m','n','o','p')
grid on
Output waveforms:
VBIT
Page 26
DIGITAL SIGNAL PROCESSING LAB 201
1


VBIT
Page 27
DIGITAL SIGNAL PROCESSING LAB 201
1

Result: Output waveforms for various operations on sinusoidal waves have been observed and
verified.
3. Fast Fourier Transform
Aim: To perform Fast Fourier Transform for a given sequence
a) DFT & IDFT using inbuilt functions
b) DFT & IDFT using equation
c) N-point DFT & IDFT using inbuilt functions
d) N-point DFT & IDFT using equation
Theory:
The DFT of a sequence x(n) is
1
0
( ) ( ) exp( 2 / )
N
K
X K x n j nk N

VBIT
Page 28
DIGITAL SIGNAL PROCESSING LAB 201
1
The IDFT of the sequence X(K) is
1
0
( ) ( ) exp( 2 / )
N
n
x n X K j nk N

Inbuilt functions:
1. input Prompt for user input.
R = input ('How many apples') gives the user the prompt in the text string and then waits for
input from the keyboard. The input can be any MATLAB expression, which is evaluated, using
the variables in the current workspace, and the result returned in R. If the user presses the return
key without entering anything, input returns an empty matrix.
2. length Length of vector.
length (X) returns the length of vector X. It is equivalent to max(size(X)) for non-empty arrays
and 0 for empty ones.
3. fft Discrete Fourier transform.
fft(X) is the discrete Fourier transform (dft) of vector X. For matrices, the fft operation is
applied to each column. For N-D arrays, the FFT operation operates on the first non-singleton
dimension.
4. ifft Inverse discrete Fourier transform.
ifft(X) is the inverse discrete Fourier transform of X.
5. subplot Create axes in tiled positions.
H = subplot(m,n,p), or subplot(mnp), breaks the Figure window into an m-by-n matrix of small
axes, selects the p-th axes for the current plot, and returns the axis handle.
6. stem Discrete sequence or "stem" plot.
stem(Y) plots the data sequence Y as stems from the x axis terminated with circles for the data
value. If Y is a matrix then each column is plotted as a separate series.
7. title Graph title.
TITLE('text') adds text at the top of the current axis.
8. xlabel X-axis label.
xlabel ('text') adds text beside the X-axis on the current axis.
xlabel ('text','Property1',PropertyValue1,'Property2',PropertyValue2,...) sets the values of
the specified properties of the xlabel.
9. ylabel Y-axis label.
ylabel ('text') adds text beside the Y-axis on the current axis.
ylabel ('text','Property1',PropertyValue1,'Property2',PropertyValue2,...) sets the values of
VBIT
Page 29
DIGITAL SIGNAL PROCESSING LAB 201
1
the specified properties of the ylabel.
Program:
%program for DFT & IDFT using inbuilt functions
clc;
clear all;
close all;
a =input ('input sequence;');
l1 =length (a)
b = fft (a)
l2 = length (b)
c = ifft(b)
l3 = length (c)
subplot(3,1,1);
stem(a);
title ('input sequence');
xlabel ('n');
ylabel ('amplitude');
subplot(3,1,2);
stem(b);
title ('dft');
xlabel ('n');
ylabel ('amplitude');
subplot(3,1,3);
stem(c);
title ('ifft');
xlabel ('n');
ylabel ('amplitude');
Output:
VBIT
Page 30
DIGITAL SIGNAL PROCESSING LAB 201
1
%program for DFT & IDFT using equation
VBIT
Page 31
DIGITAL SIGNAL PROCESSING LAB 201
1
clc;
clear all;
x=input('ip seq:');
N=length(x)
for k=0:N-1
s(k+1)=0;
for n=0:N-1
s(k+1)=s(k+1)+(x(n+1)*exp((-j*2*pi*k*n)/N));
end
end
s
N1=length(s)
for n=0:N1-1
y(n+1)=0;
for k=0:N1-1
y(n+1)=y(n+1)+(s(k+1)*exp((j*2*pi*k*n)/N1));
end
end
y=(y/N1)
subplot(3,1,1);
stem(x);
subplot(3,1,2);
stem(abs(s));
subplot(3,1,3);
stem(abs(y));
VBIT
Page 32
DIGITAL SIGNAL PROCESSING LAB 201
1
OUTPUT
VBIT
Page 33
DIGITAL SIGNAL PROCESSING LAB 201
1
% N-point DFT & IDFT using inbuilt functions
clc;
clear all;
close all;
a =input ('input sequence;');
l1 =length (a)
N=input(enter input sample value)
b = fft (a,N)
l2 = length (b)
c = ifft(b,N)
l3 = length (c)
subplot(3,1,1);
stem(a);
title ('input sequence');
xlabel ('n');
ylabel ('amplitude');
subplot(3,1,2);
stem(abs(b));
title ('dft');
xlabel ('n');
ylabel ('amplitude');
subplot(3,1,3);
stem(abs(c));
title ('ifft');
xlabel ('n');
ylabel ('amplitude');
VBIT
Page 34
DIGITAL SIGNAL PROCESSING LAB 201
1
Output
VBIT
Page 35
DIGITAL SIGNAL PROCESSING LAB 201
1
VBIT
Page 36
DIGITAL SIGNAL PROCESSING LAB 201
1
%N DFT and IDFT
clc;
clear all;
x=input('ip seq:');
l=input('ip seq length:');
p=length(x)
x=[x,zeros(1,l-p)]
N=length(x)
for k=0:N-1
s(k+1)=0;
for n=0:N-1
s(k+1)=s(k+1)+(x(n+1)*exp((-j*2*pi*k*n)/N));
end
end
s
N1=length(s)
for n=0:N1-1
y(n+1)=0;
for k=0:N1-1
y(n+1)=y(n+1)+(s(k+1)*exp((j*2*pi*k*n)/N1));
end
end
y=(y/N1)
subplot(3,1,1);
stem(x);
subplot(3,1,2);
stem(abs(s));
subplot(3,1,3);
stem(abs(y));
OUTPUT:
ip seq:[1 1 1]
p =
3
x =
VBIT
Page 37
DIGITAL SIGNAL PROCESSING LAB 201
1
1 1 1 0 0 0 0 0
N =
8
s =
Columns 1 through 7
3.0000 1.7071 - 1.7071i 0 - 1.0000i 0.2929 + 0.2929i 1.0000 + 0.0000i 0.2929 -
0.2929i -0.0000 + 1.0000i
Column 8
1.7071 + 1.7071i
N1 =
8
y =
Columns 1 through 7
1.0000 - 0.0000i 1.0000 - 0.0000i 1.0000 + 0.0000i 0.0000 + 0.0000i -0.0000 + 0.0000i
0 + 0.0000i -0.0000 - 0.0000i
Column 8
0.0000 + 0.0000i
VBIT
Page 38
DIGITAL SIGNAL PROCESSING LAB 201
1
Results: Fast Fourier Transform for a given sequence with & without inbuilt functions has been
observed & verified.
4. Convolution
Aim: To perform convolution for two sequences
a) Linear convolution using inbuilt function
b) Linear convolution using equation
c) Circular convolution using equation
d) Linear convolution using circular convolution
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.
VBIT
Page 39
DIGITAL SIGNAL PROCESSING LAB 201
1
In this equation, x1(k), x2(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.
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.
In built functions:
1.input - Prompt for user input.
r = input('How many apples') gives the user the prompt in the text string and then waits for input
from the keyboard. The input can be any MATLAB expression, which is evaluated, using the
variables in the current workspace, and the result returned in R. If the user presses the return key
without entering anything, INPUT returns an empty matrix.
2. length - Length of vector.
length(x) returns the length of vector x. It is equivalent to max(size(x)) for non-empty arrays and
0 for empty ones.
3. conv - Convolution and polynomial multiplication.
VBIT
Page 40
DIGITAL SIGNAL PROCESSING LAB 201
1
c = conv(a, b) convolves vectors a and b. The resulting vector is length length(a)+length(b)-1. If
a and b are vectors of polynomial coefficients, convolving them is equivalent to multiplying the
two polynomials.

4. subplot - Create axes in tiled positions.
h = subplot(m,n,p), or subplot(mnp), breaks the Figure window into an m-by-n matrix of small
axes, selects the p-th axes for the current plot, and returns the axis handle.
5. stem - Discrete sequence or "stem" plot.
stem(y) plots the data sequence y as stems from the x axis terminated with circles for the data
value. If y is a matrix then each column is plotted as a separate series.
6. tittle - Graph title.
tittle('text') adds text at the top of the current axis.
7. xlabel x-axis label.
xlabel('text') adds text beside the x-axis on the current axis.
xlabel('text','Property1',PropertyValue1,'Property2',PropertyValue2,...) sets the values of the
specified properties of the xlabel.
8. ylabel - y-axis label.
ylabel('text') adds text beside the y-axis on the current axis.
ylabel('text','Property1',PropertyValue1,'Property2',PropertyValue2,...) sets the values of the
specified properties of the ylabel.
9. zeros Zeros array.
zeros(N) is an N-by-N matrix of zeros.
zeros (M,N) or zeros ([M,N]) is an M-by-N matrix of zeros.
zeros (M,N,P,...) or zeros ([M N P ...]) is an M-by-N-by-P-by-... array of zeros.
zeros (SIZE(A)) is the same size as A and all zeros.
10. grid - Grid lines.
grid on - adds major grid lines to the current axes.
grid off - removes major and minor grid lines from the current axes.
.
11. max Largest component.
For vectors, max (X) is the largest element in X. For matrices, max (X) is a row vector
containing the maximum element from each column. For N-D arrays, max (X) operates along
the first non-singleton dimension.
Program:
%Linear convolution using inbuilt function
VBIT
Page 41
DIGITAL SIGNAL PROCESSING LAB 201
1
clc;
close all;
clear all;
a=input(enter input sequence 1);
l1=length(a)
b= input(enter input sequence 2);
l2=length(b)
c=conv(a,b)
l3=length(c)
subplot(3,1,1)
stem(a);
title(sequence1);
xlabel(number of sequences)
ylabel(amplitude)
grid on;
subplot(3,1,2)
stem(b);
title(sequence2);
xlabel(number of sequences)
ylabel(amplitude)
grid on;
subplot(3,1,3)
stem(c);
title(output sequence);
xlabel(number of sequences)
ylabel(amplitude)
grid on;
Output:
VBIT
Page 42
DIGITAL SIGNAL PROCESSING LAB 201
1
%Linear convolution using equation
clc;
clear all;
close all;
disp ('linear convolution');
x = input ('enter input seq x(n)');
l = length (x)
h = input ('enter input seq h(n)');
m = length (h)
x = [ x, zeros(1,m-1)]
VBIT
Page 43
DIGITAL SIGNAL PROCESSING LAB 201
1
subplot (2,2,1);
stem (x);
title ('input sequence');
xlabel('n'); ylabel ('x(n)'); grid;
h = [h,zeros(1,l-1)]
subplot(2,2,2); stem (h);
title('impulse seq h(n)');
xlabel('n'); ylabel ('h(n)'); grid;
y = zeros (1,l+m-1);
for i = 1:l+m-1
y(i)=0;
for j = 1:l+m-1
if (j < i+1)

y(i) = y(i)+x(j)*h(i-j+1);

end;
end;
end;
y
subplot(2,2,[3,4]);
stem (y);
title ('output sequence');
xlabel ('n'); ylabel ('y(n)'); grid;

Output
VBIT
Page 44
DIGITAL SIGNAL PROCESSING LAB 201
1
VBIT
Page 45
DIGITAL SIGNAL PROCESSING LAB 201
1
%Circular convolution using equation
clc;
close all;
clear all;
disp('circular convolution program');
g=input('enter input x(n)');
l1=length(g)
h=input('enter input h(n)');
l2=length(h)
l3=max(l1,l2)
s=l1-l2
if (l2<l1)
h=[h,zeros(1,s)]
else
g=[g,zeros(1,-s)]
end
subplot (2,2,1);
stem (g);
title ('input sequence');
xlabel('n'); ylabel ('g(n)'); grid;
subplot(2,2,2); stem (h);
title('impulse seq h(n)');
xlabel('n'); ylabel ('h(n)'); grid;
for i=1:l3
y(i)=0;
p=i;
for j=1:l3
if(p==0)
p=l3;
end
y(i)=y(i)+g(j)*h(p);
p=p-1;
end
end
y
subplot(2,2,[3,4]);
stem (y);
title ('output sequence');
xlabel ('n'); ylabel ('y(n)'); grid;

VBIT
Page 46
DIGITAL SIGNAL PROCESSING LAB 201
1
Output
VBIT
Page 47
DIGITAL SIGNAL PROCESSING LAB 201
1
%Linear convolution using circular convolution
clc;
close all;
clear all;
disp('linear convolution using circular convolution program');
g=input('enter input x(n)');
l1=length(g)
h=input('enter input h(n)');
l2=length(h)
l3=l1+l2-1
if (l2~=l1)
h=[h,zeros(1,l1-1)]
g=[g,zeros(1,l2-1)]
end
subplot (2,2,1);
stem (g);
title ('input sequence');
xlabel('n'); ylabel ('g(n)'); grid;
subplot(2,2,2); stem (h);
title('impulse seq h(n)');
xlabel('n'); ylabel ('h(n)'); grid;
for i=1:l3
y(i)=0;
p=i;
for j=1:l3
if(p==0)
p=l3;
end
y(i)=y(i)+g(j)*h(p);
p=p-1;
end
end
y
subplot(2,2,[3,4]);
stem (y);
title ('output sequence');
xlabel ('n'); ylabel ('y(n)'); grid;

VBIT
Page 48
DIGITAL SIGNAL PROCESSING LAB 201
1
Output:
Result: convolution for two sequences with & without inbuilt functions, circular convolution &
linear convolution using circular convolution has been observed and verified.
VBIT
Page 49
DIGITAL SIGNAL PROCESSING LAB 201
1
5. Power Spectral Density
Aim: Write a program to Power spectral density
a). Power Spectral Density of sum of sinusoidal signal without noise
b) Power Spectral Density of sum of sinusoidal signal with noise
Theory:
Power spectral density function (PSD) shows the strength of the variations (energy) as a function of frequency.
In other words, it shows at which frequencies variations are strong and at which frequencies variations are
weak. The unit of PSD is energy per frequency (width) and you can obtain energy within a specific frequency
range by integrating PSD within that frequency range. Computation of PSD is done directly by the method
called FFT or computing autocorrelation function and then transforming it.
In an analogy to the energy signals, let us define a function that would give us some indication of
the relative power contributions at various frequencies, as Sf (w). This function has units of
power per Hz and its integral yields the power in f(t) and is known as power spectral density
function. Mathematically,
1
( )
2
f P s d

In built functions:
1. sin Sine of argument in radians.
sin(X) is the sine of the elements of X.
2. plot Linear plot.
plot(X,Y) plots vector Y versus vector X. If X or Y is a matrix then the vector is plotted
versus the rows or columns of the matrix, whichever line up. If X is a scalar and Y is a vector,
length(Y) disconnected points are plotted.
3.randn Normally distributed random numbers.
randn(N) is an N-by-N matrix with random entries, chosen from a normal distribution with
mean zero, variance one and standard deviation one.
randn(M,N) and randn ([M,N]) are M-by-N matrices with random entries.
randn (M,N,P,...) or randn ([M,N,P...]) generate random arrays. randn with no arguments is a
VBIT
Page 50
DIGITAL SIGNAL PROCESSING LAB 201
1
scalar whose value changes each time it is referenced. randn (SIZE(A)) is the same size as A.
4. FIGURE Create figure window.
FIGURE, by itself, creates a new figure window, and returns its handle.
Program:
% Power Spectral Density of sum of sinusoidal signal without noise
clc
clear all
fs=100;
t=0:1/fs:10;
x=sin(2*pi*15*t)+sin(2*pi*30*t);
nfft=512;
y=fft(x,nfft);
f=fs*(0:nfft-1)/nfft;
power=y.*conj(y)/nfft;
plot(f,power);
Output:
% Power Spectral Density of sum of sinusoidal signal with noise
clc
clear all
fs=100;
t=0:1/fs:4;
VBIT
Page 51
DIGITAL SIGNAL PROCESSING LAB 201
1
x=sin(2*pi*15*t)+sin(2*pi*30*t);
x1=x+2*randn(size(t));
nfft=512;
y=fft(x1,nfft);
f=fs*(0:nfft-1)/nfft;
power=y.*conj(y)/nfft;
plot(t,x);
figure,plot(t,x1);
figure,plot(f,power);
Output:
Input signal waveform
Input signal waveform after adding noise
VBIT
Page 52
DIGITAL SIGNAL PROCESSING LAB 201
1
PSD of input signal waveform after adding noise
VBIT
Page 53
DIGITAL SIGNAL PROCESSING LAB 201
1
Result: The power spectral density of a signal with & without noise has been observed &
verified.
VBIT
Page 54
DIGITAL SIGNAL PROCESSING LAB 201
1
CYCLE-II
6. IIR LPF Filters magnitude response
Aim: To write a program of IIR LPF Filters magnitude response for various order of N
VBIT
Page 55
DIGITAL SIGNAL PROCESSING LAB 201
1
a) Butterworth filter
b) Chebyshev type-I filter
c) Chebyshev type-II filter
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:

N
k
k
k
M
k
k
k
Z a
z b
z H
1
0
) (
(2)
The difference equation for such a system is described by the following:


+
N
k
k
M
k
k
k n y a k n x b n y
1 0
) ( ) ( ) (
(3)
M and N are order of the two polynomials
b
k
and a
k
are the filter coefficients. These filter coefficients are generated using FDS (Filter
Design software or Digital Filter design package).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.
Inbuilt functions:
1. sqrt:
sqrt(x) gives the squareroot function of x
2. loglog
loglog(x) gives the 3-dB plot
Program:
%butterworth lpf
VBIT
Page 56
DIGITAL SIGNAL PROCESSING LAB 201
1
clc
clear all
close all
g=0.8;
wc=input('cut off freq in radians:');
n1=input('order of the filter:1:');
n2=input('order of the filter:2:');
n3=input('order of the filter:3:');
w=linspace(1,1000,500);
for i=1:500
h2(i)=g*g/(1+(w(i)/wc)^2);
h21(i)=g*g/(1+(w(i)/wc)^(2*n1));
h22(i)=g*g/(1+(w(i)/wc)^(2*n2));
h23(i)=g*g/(1+(w(i)/wc)^(2*n3));
end
tf=sqrt(h2);
tf1=sqrt(h21);
tf2=sqrt(h22);
tf3=sqrt(h23);
loglog(tf);
hold on
loglog(tf1,'r');
hold on
loglog(tf2,'g');
hold on
loglog(tf3,'c');
hold off
OUTPUT:
cut off freq in radians:250
order of the filter:1: 1
order of the filter:2: 15
order of the filter:3: 22
VBIT
Page 57
DIGITAL SIGNAL PROCESSING LAB 201
1
%chebyshev type -1
clc
clear all
close all
wc=input('cut off freq in radians:');
n=11;
n1=12;
g=0.2;
e=sqrt((1/(g^2))-1)
w=linspace(1,1000,500);
for i=1:500
x=w(i)/wc;
if(abs(x)<1)
cnx=cos(n*acos(x));
end
if(abs(x)>=1)
cnx=cosh(n*acosh(x));
VBIT
Page 58
DIGITAL SIGNAL PROCESSING LAB 201
1
end
h2(i)=g*g/(1+e*e*cnx*cnx);

end
for i=1:500
x1=w(i)/wc;
if(abs(x1)<1)
cnx1=cos(n1*acos(x1));
end
if(abs(x1)>=1)
cnx1=cosh(n1*acosh(x1));
end
h21(i)=g*g/(1+e*e*cnx1*cnx1);

end
tf=sqrt(h2);
tf1=sqrt(h21);
loglog(tf);
hold on;
loglog(tf1,'r');
OUTPUT:
Cut off freq in radians150
VBIT
Page 59
DIGITAL SIGNAL PROCESSING LAB 201
1
%chebyshev type-11
clc
clear all
close all
wc=input('cut off freq in radians:');
n=15;
n1=22;
g=0.3;
e=g/(sqrt(1-(g^2)))
w=linspace(1,1000,500);
for i=1:500
x=wc/w(i);
if(abs(x)<1)
cnx=cos(n*acos(x));
end
if(abs(x)>=1)
cnx=cosh(n*acosh(x));
end
h(i)=e*cnx/sqrt(1+e*e*cnx*cnx);

end
for i=1:500
VBIT
Page 60
DIGITAL SIGNAL PROCESSING LAB 201
1
x1=wc/w(i);
if(abs(x1)<1)
cnx1=cos(n1*acos(x1));
end
if(abs(x1)>=1)
cnx1=cosh(n1*acosh(x1));
end
h1(i)=e*cnx1/sqrt(1+e*e*cnx1*cnx1);

end
loglog(abs(h));
hold on;
loglog(abs(h1),'r');
OUTPUT:
cut off freq in radians: 150
VBIT
Page 61
DIGITAL SIGNAL PROCESSING LAB 201
1
Result: IIR LPF Filters (Butterworth filter, Chebyshev type-I filter, Chebyshev type-II filter)
magnitude response for various order of N.
7. IIR Digital Filter Design
VBIT
Page 62
DIGITAL SIGNAL PROCESSING LAB 201
1
Aim: To write a program of IIR digital filters
a) Butterworth low pass filter
b) Butterworth high pass filter
c) Butterworth band pass filter
d) Butterworth band stop filter
e) Chebyshev type-I low pass filter
f) Chebyshev type-I high pass filter
g) Chebyshev type-I band pass filter
h) Chebyshev type-I band stop filter
i) Chebyshev type-II low pass filter
j) Chebyshev type-II high pass filter
k) Chebyshev type-II band pass filter
l) Chebyshev type-II band stop filter
Theory:
Inbuilt functoions:
1. Buttord
syntax:
[n,Wn] = buttord(Wp,Ws,Rp,Rs)
[n,Wn] = buttord(Wp,Ws,Rp,Rs,'s')
Description
buttord calculates the minimum order of a digital or analog Butterworth filter required to meet a
set of filter design specifications
2. Butter
hd = butter(d) designs a Butterworth IIR digital filter using the specifications supplied in the
object d.
hd = butter(d,'matchexactly',match) returns a Butterworth IIR filter where the filter response
matches the specified response exactly for one filter band. match, which specifies which filter
band to match, is either passband--match the passband specification exactly in the final filter.
stopband--match the specified stopband performance exactly in the final filter. This is the default
setting.
VBIT
Page 63
DIGITAL SIGNAL PROCESSING LAB 201
1
3. Cheb1ord:
Syntax
[n,Wn] = cheb1ord(Wp,Ws,Rp,Rs)
[n,Wn] = cheb1ord(Wp,Ws,Rp,Rs,'s')
Description
cheb1ord calculates the minimum order of a digital or analog Chebyshev Type I filter required to
meet a set of filter design specifications.
4.Cheby1:
Syntax
hd = cheby1(d)
hd = cheby1(d,'matchexactly',match)
Description
hd = cheby1(d) designs a Chebyshev I IIR digital filter using the specifications supplied in the
object d.
5. cheb2ord:
Syntax
[n,Wn] = cheb2ord(Wp,Ws,Rp,Rs)
[n,Wn] = cheb2ord(Wp,Ws,Rp,Rs,'s')
Description
cheb2ord calculates the minimum order of a digital or analog Chebyshev Type II filter required
to meet a set of filter design specifications
6. cheby2:
Syntax
hd = cheby2(d)
hd = cheby2(d,'matchexactly',match)
Description
hd = cheby2(d) designs a Chebyshev II IIR digital filter using the specifications supplied in the
object d.
7. freqz
Syntax
[h,w] = freqz(ha)
Description
The next sections describe common freqz operation with adaptive, discrete-time, and multirate
filters. For more input options, refer to freqz in the Signal Processing Toolbox.
VBIT
Page 64
DIGITAL SIGNAL PROCESSING LAB 201
1
Program:
% Butterworth low pass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N,wn]=buttord(w1,w2,rp,rs);
[b,a]=butter(N,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)
title('butterworth magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('butterworth phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
For designing of an IIR analog Chebyshev type-II filter these are the pass band ripple ,stop
band ripple, pass band frequency, stop band frequency & sampling frequency values to obtain
the graph
Filter
r
p
r
s
f
p
f
s
f
LPF
0.2 45 1300 1500 10000
HPF
0.3 16 1500 2000 9000
BPF
0.4 35 2000 2500 10000
BRF
0.5 40 2500 2750 7000
VBIT
Page 65
DIGITAL SIGNAL PROCESSING LAB 201
1
OUTPUT:
% Butterworth high pass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N,wn]=buttord(w1,w2,rp,rs);
[b,a]=butter(N,wn,'high');
w=0:0.01:pi
[h,om]=freqz(b,a,w)
VBIT
Page 66
DIGITAL SIGNAL PROCESSING LAB 201
1
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('butterworth magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('butterworth phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
% Butterworth bandpass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
VBIT
Page 67
DIGITAL SIGNAL PROCESSING LAB 201
1
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[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)
title('butterworth bandpass magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('butterworth bandpass phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
VBIT
Page 68
DIGITAL SIGNAL PROCESSING LAB 201
1
% Butterworth bandstop filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[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);
VBIT
Page 69
DIGITAL SIGNAL PROCESSING LAB 201
1
subplot(2,1,1)
plot(om/pi,m)
title('butterworth magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('butterworth phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
% Chebyshev type-I low pass filter
VBIT
Page 70
DIGITAL SIGNAL PROCESSING LAB 201
1
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[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)
title('chebysev1 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev1 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
For designing of an IIR analog Chebyshev type-II filter these are the pass band ripple ,stop
band ripple, pass band frequency, stop band frequency & sampling frequency values to obtain
the graph
Filter
r
p
r
s
f
p
f
s
f
LPF
0.35 35 1500 2000 8000
HPF
0.25 40 1400 1800 7000
BPF
0.4 40 1400 2000 9000
BRF
0.3 46 1400 2000 8000
Output
VBIT
Page 71
DIGITAL SIGNAL PROCESSING LAB 201
1
% Chebyshev type-I high pass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[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)
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('chebysev1 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
VBIT
Page 72
DIGITAL SIGNAL PROCESSING LAB 201
1
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev1 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
VBIT
Page 73
DIGITAL SIGNAL PROCESSING LAB 201
1
% Chebyshev type-I bandpass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N]=cheb1ord(w1,w2,rp,rs);
wn=[w1,w2]
[b,a]=cheby1(N,rp,wn,'bandpass');
w=0:0.01:pi
[h,om]=freqz(b,a,w)
VBIT
Page 74
DIGITAL SIGNAL PROCESSING LAB 201
1
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('chebysev1 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev1 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
VBIT
Page 75
DIGITAL SIGNAL PROCESSING LAB 201
1
% Chebyshev type-I bandstop filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N]=cheb1ord(w1,w2,rp,rs);
wn=[w1,w2]
[b,a]=cheby1(N,rp,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)
title('chebysev1 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev1 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
VBIT
Page 76
DIGITAL SIGNAL PROCESSING LAB 201
1
Output
% Chebyshev type-II low pass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N,wn]=cheb2ord(w1,w2,rp,rs);
[b,a]=cheby2(N,rs,wn);
w=0:0.01:pi
[h,om]=freqz(b,a,w)
m=20*log10(abs(h));
an=angle(h);
VBIT
Page 77
DIGITAL SIGNAL PROCESSING LAB 201
1
subplot(2,1,1)
plot(om/pi,m)
title('chebysev2 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev2 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
For designing of an IIR analog Chebyshev type-II filter these are the pass band ripple ,stop
band ripple, pass band frequency, stop band frequency & sampling frequency values to obtain
the graph
Filter
r
p
r
s
f
p
f
s
f
LPF
0.35 35 1500 2000 8000
HPF
0.25 40 1400 1800 7000
BPF
0.4 40 1400 2000 9000
BRF
0.3 46 1400 2000 8000
Output
VBIT
Page 78
DIGITAL SIGNAL PROCESSING LAB 201
1
% Chebyshev type-II highpass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N,wn]=cheb2ord(w1,w2,rp,rs);
[b,a]=cheby2(N,rs,wn,'high');
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)
title('chebysev2 magnitude response');
xlabel('normalized frequency');
VBIT
Page 79
DIGITAL SIGNAL PROCESSING LAB 201
1
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev2 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
VBIT
Page 80
DIGITAL SIGNAL PROCESSING LAB 201
1
% Chebyshev type-II bandpass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N]=cheb2ord(w1,w2,rp,rs);
wn=[w1,w2]
[b,a]=cheby2(N,rs,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)
title('chebysev2 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
VBIT
Page 81
DIGITAL SIGNAL PROCESSING LAB 201
1
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev2 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
% Chebyshev type-II band stop filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N]=cheb2ord(w1,w2,rp,rs);
wn=[w1,w2]
[b,a]=cheby2(N,rs,wn,'stop');
VBIT
Page 82
DIGITAL SIGNAL PROCESSING LAB 201
1
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)
title('chebysev2 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev2 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
VBIT
Page 83
DIGITAL SIGNAL PROCESSING LAB 201
1
Result: The IIR digital Butterworth, chebyshev type-I & chebyshev type-II waveforms has been
observed and verified.
8. IIR Analog Filter Design
Aim: To write a program of IIR analog filters
a) Butterworth low pass filter
b) Butterworth high pass filter
c) Butterworth band pass filter
d) Butterworth band stop filter
e) Chebyshev type-I low pass filter
f) Chebyshev type-I high pass filter
g) Chebyshev type-I band pass filter
h) Chebyshev type-I band stop filter
i) Chebyshev type-II low pass filter
j) Chebyshev type-II high pass filter
k) Chebyshev type-II band pass filter
l) Chebyshev type-II band stop filter
Program:
%Butterworth low pass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N,wn]=buttord(w1,w2,rp,rs,s);
[b,a]=butter(N,wn,s);
w=0:0.01:pi
VBIT
Page 84
DIGITAL SIGNAL PROCESSING LAB 201
1
[h,om]=freqs(b,a,w)
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('butterworth magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('butterworth phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
For designing of an IIR analog butterworth filter these are the pass band ripple ,stop band
ripple, pass band frequency, stop band frequency & sampling frequency values to obtain the
graph
Filter
r
p
r
s
f
p
f
s
f
LPF
0.15 60 1500 3000 7000
HPF
0.2 40 2000 3500 8000
BPF
0.36 36 1500 2000 6000
BRF
0.28 28 1000 1400 5000
Output
VBIT
Page 85
DIGITAL SIGNAL PROCESSING LAB 201
1
%Butterworth high pass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N,wn]=buttord(w1,w2,rp,rs,s);
[b,a]=butter(N,wn,'high',s);
w=0:0.01:pi
[h,om]=freqs(b,a,w)
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('butterworth magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
VBIT
Page 86
DIGITAL SIGNAL PROCESSING LAB 201
1
grid on
subplot(2,1,2)
plot(om/pi,an);
title('butterworth phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
VBIT
Page 87
DIGITAL SIGNAL PROCESSING LAB 201
1
%Butterworth bandpass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N]=buttord(w1,w2,rp,rs,s);
wn=[w1,w2]
[b,a]=butter(N,wn,'bandpass',s);
w=0:0.01:pi
[h,om]=freqs(b,a,w)
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('butterworth bandpass magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('butterworth bandpass phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
VBIT
Page 88
DIGITAL SIGNAL PROCESSING LAB 201
1
%Butterworth bandstop filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N]=buttord(w1,w2,rp,rs,s);
wn=[w1,w2]
[b,a]=butter(N,wn,'stop',s);
w=0:0.01:pi
[h,om]=freqs(b,a,w)
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('butterworth magnitude response');
xlabel('normalized frequency');
VBIT
Page 89
DIGITAL SIGNAL PROCESSING LAB 201
1
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('butterworth phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
%Chebyshev type-I low pass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
VBIT
Page 90
DIGITAL SIGNAL PROCESSING LAB 201
1
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N,wn]=cheb1ord(w1,w2,rp,rs,s);
[b,a]=cheby1(N,rp,wn,s);
w=0:0.01:pi
[h,om]=freqs(b,a,w)
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('chebysev1 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev1 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
For designing of an IIR analog Chebyshev type-I filter these are the pass band ripple ,stop
band ripple, pass band frequency, stop band frequency & sampling frequency values to obtain
the graph
Filter
r
p
r
s
f
p
f
s
f
LPF
0.23 47 1300 1500 7800
HPF
0.29 29 900 1300 7500
BPF
0.3 40 1400 2000 5000
BRF
0.15 30 2000 2400 7000
Output
VBIT
Page 91
DIGITAL SIGNAL PROCESSING LAB 201
1
%Chebyshev type-I high pass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N,wn]=cheb1ord(w1,w2,rp,rs,s);
[b,a]=cheby1(N,rp,wn,'high',s);
w=0:0.01:pi
[h,om]=freqs(b,a,w)
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
VBIT
Page 92
DIGITAL SIGNAL PROCESSING LAB 201
1
plot(om/pi,m)
title('chebysev1 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev1 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
%Chebyshev type-I band pass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
VBIT
Page 93
DIGITAL SIGNAL PROCESSING LAB 201
1
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N]=cheb1ord(w1,w2,rp,rs,s);
wn=[w1,w2]
[b,a]=cheby1(N,rp,wn,'bandpass',s);
w=0:0.01:pi
[h,om]=freqs(b,a,w)
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('chebysev1 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev1 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
VBIT
Page 94
DIGITAL SIGNAL PROCESSING LAB 201
1
%Chebyshev type-I bandstop filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N]=cheb1ord(w1,w2,rp,rs,s);
wn=[w1,w2]
[b,a]=cheby1(N,rp,wn,'stop',s);
w=0:0.01:pi
[h,om]=freqs(b,a,w)
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('chebysev1 magnitude response');
VBIT
Page 95
DIGITAL SIGNAL PROCESSING LAB 201
1
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev1 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
VBIT
Page 96
DIGITAL SIGNAL PROCESSING LAB 201
1
%Chebyshev type-II low pass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N,wn]=cheb2ord(w1,w2,rp,rs,s);
[b,a]=cheby2(N,rs,wn,s);
w=0:0.01:pi
[h,om]=freqs(b,a,w)
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('chebysev2 magnitude response');
VBIT
Page 97
DIGITAL SIGNAL PROCESSING LAB 201
1
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev2 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
For designing of an IIR analog Chebyshev type-II filter these are the pass band ripple ,stop
band ripple, pass band frequency, stop band frequency & sampling frequency values to obtain
the graph
Filter
r
p
r
s
f
p
f
s
f
LPF
0.4 50 2000 2400 10000
HPF
0.34 34 1400 1600 10000
BPF
0.37 37 3000 4000 9000
BRF
0.25 30 1300 2000 8000
Output
VBIT
Page 98
DIGITAL SIGNAL PROCESSING LAB 201
1
%Chebyshev type-II high pass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N,wn]=cheb2ord(w1,w2,rp,rs,s);
[b,a]=cheby2(N,rs,wn,'high',s);
w=0:0.01:pi
[h,om]=freqs(b,a,w)
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('chebysev2 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev2 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
VBIT
Page 99
DIGITAL SIGNAL PROCESSING LAB 201
1
Output
%Chebyshev type-II band pass filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
VBIT
Page 100
DIGITAL SIGNAL PROCESSING LAB 201
1
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N]=cheb2ord(w1,w2,rp,rs,s);
wn=[w1,w2]
[b,a]=cheby2(N,rs,wn,'bandpass',s);
w=0:0.01:pi
[h,om]=freqs(b,a,w)
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('chebysev2 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev2 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
VBIT
Page 101
DIGITAL SIGNAL PROCESSING LAB 201
1
%Chebyshev type-II bandstop filter
clc;
clear all;
close all;
rp=input('enter passband ripple factor');
rs=input('enter stopband ripple factor');
fp=input('enter passband frequency');
fs=input('enter passband frequency');
f=input('enter sampling frequency');
w1=(2*fp)/f;w2=(2*fs)/f;
[N]=cheb2ord(w1,w2,rp,rs,s);
wn=[w1,w2]
[b,a]=cheby2(N,rs,wn,'stop',s);
w=0:0.01:pi
[h,om]=freqs(b,a,w)
m=20*log10(abs(h));
VBIT
Page 102
DIGITAL SIGNAL PROCESSING LAB 201
1
an=angle(h);
subplot(2,1,1)
plot(om/pi,m)
title('chebysev2 magnitude response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
subplot(2,1,2)
plot(om/pi,an);
title('chebysev2 phase response');
xlabel('normalized frequency');
ylabel('gain in db');
grid on
Output
VBIT
Page 103
DIGITAL SIGNAL PROCESSING LAB 201
1
Result: The IIR digital Butterworth, chebyshev type-I & chebyshev type-II waveforms has been
observed and verified
9. FIR Filter Design using windows
VBIT
Page 104
DIGITAL SIGNAL PROCESSING LAB 201
1
Aim: To write a program of FIR Filter design using windows
a) Response of windows
b) Low pass filter using windows
c) High pass filter using windows
d) High pass filter using windows
e) High pass filter using windows
f) FIR filter design using Kaiser window
Theory:
Rectangular Window
The rectangular window was discussed in Chapter 4 (4.5). Here we summarize the results of that discussion.
Definition ( odd):
Transform:
The DTFT of a rectangular window is shown in Fig
VBIT
Page 105
DIGITAL SIGNAL PROCESSING LAB 201
1
Bartlett (``Triangular'') Window
Definition:
Transform:
The DTFT of a rectangular window is shown in Fig
Hamming window
Definition:
1 2
[ ] 1 cos , 0
2
n
w n n M
M
1 _

'
1
, ]
The DTFT of a rectangular window is shown in Fig
VBIT
Page 106
DIGITAL SIGNAL PROCESSING LAB 201
1
Hanning window
If y represents the output sequence Hanning {X}, the Hanning Window VI obtains the elements
of y from
y
i
= x
i
[0.54 0.46cos(w)]
for i = 0, 1, 2, , n 1,
where n is the number of elements in the input sequence X.
The DTFT of a rectangular window is shown in Fig
VBIT
Page 107
DIGITAL SIGNAL PROCESSING LAB 201
1
Blackman window
2 4
[ ] 0.42 0.5cos 0.08cos
n n
w n
M M
_ _
+
'

, ,
The DTFT of a rectangular window is shown in Fig
Inbuilt functions:
1.fir1 FIR filter design using the window method.
VBIT
Page 108
DIGITAL SIGNAL PROCESSING LAB 201
1
B = fir1(N,Wn) designs an N'th order lowpass FIR digital filte and returns the filter coefficients
in length N+1 vector B.The cut-off frequency Wn must be between 0 < Wn < 1.0, with 1.0
corresponding to half the sample rate. The filter B is real and has linear phase. The normalized
gain of the filter at Wn is -6 dB.
2. boxcar Boxcar window.
boxcar still works but maybe removed in the future. Use rectwin instead
3. hamming Hamming window.
hamming (N) returns the N-point symmetric Hamming window in a column vector.
4.blackman Blackman window.
blackman (N) returns the N-point symmetric Blackman window in a column vector.
5.bartlett Bartlett window.
W = bartlett (N) returns the N-point Bartlett window.
6. hanning Hanning window.
hanning (N) returns the N-point symmetric Hanning window in a column vector. Note that the
first and last zero-weighted window samples are not included.
7. kaiser Kaiser window.
W = kaiser (N) returns an N-point Kaiser window in the column vector W.

Program:
%Response of windows
clc;
close all;
clear all;
N=25;
n=0:1:N-1;
%Rectangular window
w1=boxcar(N);
subplot(5,2,1);
plot(n,w1);
VBIT
Page 109
DIGITAL SIGNAL PROCESSING LAB 201
1
w=0:0.01:pi;
h1=freqz(w1,1,w);
subplot(5,2,2);
plot(abs(h1));
%triangular window
w2=bartlett(N);
subplot(5,2,3);
plot(n,w2);
w=0:0.01:pi;
h2=freqz(w2,1,w);
subplot(5,2,4);
plot(abs(h2));
%hamming window
w3= hamming (N);
subplot(5,2,5);
plot(n,w3);
w=0:0.01:pi;
h3=freqz(w3,1,w);
subplot(5,2,6);
plot(abs(h3));
%hanning window
w4= hanning (N);
subplot(5,2,7);
plot(n,w4);
w=0:0.01:pi;
h4=freqz(w4,1,w);
subplot(5,2,8);
plot(abs(h4));
%blackman window
VBIT
Page 110
DIGITAL SIGNAL PROCESSING LAB 201
1
w5= blackman (N);
subplot(5,2,9);
plot(n,w5);
w=0:0.01:pi;
h5=freqz(w5,1,w);
subplot(5,2,10);
plot(abs(h5));
OUTPUT:
VBIT
Page 111
DIGITAL SIGNAL PROCESSING LAB 201
1
%Low pass filter using windows
clc;
close all;
clear all;
N=25;
n=0:1:N-1;
a=(N-1)/2;
e=0.001;
wc=0.5*pi;
hd=(sin(wc*(n-a+e)))./(pi*(n-a+e));
%Rectangular window
VBIT
Page 112
DIGITAL SIGNAL PROCESSING LAB 201
1
w1=boxcar(N);
hn=hd.*w1;
w=0:0.01:pi;
h=freqz(hn,1,w);
subplot(3,2,1);
plot(abs(h));
%triangular window
w2=bartlett(N);
hn1=hd.*w2;
w=0:0.01:pi;
h1=freqz(hn,1,w);
subplot(3,2,2);
plot(abs(h1));
%hamming window
w3= hamming (N);
hn2=hd.*w3;
w=0:0.01:pi;
h2=freqz(hn2,1,w);
subplot(3,2,3);
plot(abs(h2));
%hanning window
w4= hanning (N);
hn3=hd.*w4;
w=0:0.01:pi;
h3=freqz(hn3,1,w);
subplot(3,2,4);
plot(abs(h3));
%blackman window
w5= blackman (N);
VBIT
Page 113
DIGITAL SIGNAL PROCESSING LAB 201
1
hn4=hd.*w5;
w=0:0.01:pi;
h4=freqz(hn4,1,w);
subplot(3,2,5);
plot(abs(h4));
OUTPUT:
%High pass filter using windows
clc;
close all;
clear all;
N=25;
n=0:1:N-1;
a=(N-1)/2;
e=0.001;
wc=0.5*pi;
hd=(sin(wc*(n-a+e))-(sin(pi*(n-a+e))))./(pi*(n-a+e));
VBIT
Page 114
DIGITAL SIGNAL PROCESSING LAB 201
1
%Rectangular window
w1=boxcar(N);
hn=hd.*w1;
w=0:0.01:pi;
h=freqz(hn,1,w);
subplot(3,2,1);
plot(abs(h));
%triangular window
w2=bartlett(N);
hn1=hd.*w2;
w=0:0.01:pi;
h1=freqz(hn,1,w);
subplot(3,2,2);
plot(abs(h1));
%hamming window
w3= hamming (N);
hn2=hd.*w3;
w=0:0.01:pi;
h2=freqz(hn2,1,w);
subplot(3,2,3);
plot(abs(h2));
%hanning window
w4= hanning (N);
hn3=hd.*w4;
w=0:0.01:pi;
h3=freqz(hn3,1,w);
subplot(3,2,4);
plot(abs(h3));
%blackman window
VBIT
Page 115
DIGITAL SIGNAL PROCESSING LAB 201
1
w5= blackman (N);
hn4=hd.*w5;
w=0:0.01:pi;
h4=freqz(hn4,1,w);
subplot(3,2,5);
plot(abs(h4));
output
%bandpasspass filter using windows
clc;
close all;
clear all;
VBIT
Page 116
DIGITAL SIGNAL PROCESSING LAB 201
1
N=25;
n=0:1:N-1;
a=(N-1)/2;
e=0.001;
wc1=0.5*pi;
wc2=0.7*pi;
hd=(sin(wc2*(n-a+e))-(sin(wc1*(n-a+e))))./(pi*(n-a+e));
%Rectangular window
w1=boxcar(N);
hn=hd.*w1;
w=0:0.01:pi;
h=freqz(hn,1,w);
subplot(3,2,1);
plot(abs(h));
%triangular window
w2=bartlett(N);
hn1=hd.*w2;
w=0:0.01:pi;
h1=freqz(hn,1,w);
subplot(3,2,2);
plot(abs(h1));
%hamming window
w3= hamming (N);
hn2=hd.*w3;
w=0:0.01:pi;
h2=freqz(hn2,1,w);
subplot(3,2,3);
plot(abs(h2));
%hanning window
VBIT
Page 117
DIGITAL SIGNAL PROCESSING LAB 201
1
w4= hanning (N);
hn3=hd.*w4;
w=0:0.01:pi;
h3=freqz(hn3,1,w);
subplot(3,2,4);
plot(abs(h3));
%blackman window
w5= blackman (N);
hn4=hd.*w5;
w=0:0.01:pi;
h4=freqz(hn4,1,w);
subplot(3,2,5);
plot(abs(h4));
OUTPUT
VBIT
Page 118
DIGITAL SIGNAL PROCESSING LAB 201
1
%bandstop filter using windows
clc;
close all;
clear all;
N=25;
n=0:1:N-1;
a=(N-1)/2;
e=0.001;
wc1=0.5*pi;
VBIT
Page 119
DIGITAL SIGNAL PROCESSING LAB 201
1
wc2=0.7*pi;
hd=(sin(wc1*(n-a+e))-(sin(wc2*(n-a+e)))+(sin(pi*(n-a+e))))./(pi*(n-a+e));
%Rectangular window
w1=boxcar(N);
hn=hd.*w1;
w=0:0.01:pi;
h=freqz(hn,1,w);
subplot(3,2,1);
plot(abs(h));
%triangular window
w2=bartlett(N);
hn1=hd.*w2;
w=0:0.01:pi;
h1=freqz(hn,1,w);
subplot(3,2,2);
plot(abs(h1));
%hamming window
w3= hamming (N);
hn2=hd.*w3;
w=0:0.01:pi;
h2=freqz(hn2,1,w);
subplot(3,2,3);
plot(abs(h2));
%hanning window
w4= hanning (N);
hn3=hd.*w4;
w=0:0.01:pi;
h3=freqz(hn3,1,w);
subplot(3,2,4);
VBIT
Page 120
DIGITAL SIGNAL PROCESSING LAB 201
1
plot(abs(h3));
%blackman window
w5= blackman (N);
hn4=hd.*w5;
w=0:0.01:pi;
h4=freqz(hn4,1,w);
subplot(3,2,5);
plot(abs(h4));
Output:
%FIR filter design using Kaiser window
clc;
close all;
clear all;
rp=0.02;
rs=0.01;
fp=1000;
VBIT
Page 121
DIGITAL SIGNAL PROCESSING LAB 201
1
fs=1500;
f=10000;
beta=5.8;
wp=2*fp/f;
ws=2*fs/f;
num=-20*log10(sqrt(rp*rs))-13;
dem=14.6*(fs-fp)/f;
n=ceil(num/dem);
n1=n+1;
if(rem(n,2)~=0)
n1=n;
n=n-1;
end
y=kaiser(n1,beta);
%lowpass filter
b=fir1(n,wp,y);
[h,o]=freqz(b,1,256);
m=20*log10(abs(h));
subplot(2,2,1);
plot(o/pi,m);
%high pass filter
b=fir1(n,wp,high,y);
[h,o]=freqz(b,1,256);
m=20*log10(abs(h));
subplot(2,2,2);
plot(o/pi,m);
%bandpass filter
wn=[wp ws];
b=fir1(n,wn,y);
[h,o]=freqz(b,1,256);
m=20*log10(abs(h));
subplot(2,2,3);
plot(o/pi,m);
%bandstop filter
wn=[wp ws];
b=fir1(n,wn,stop,y);
[h,o]=freqz(b,1,256);
VBIT
Page 122
DIGITAL SIGNAL PROCESSING LAB 201
1
m=20*log10(abs(h));
subplot(2,2,4);
plot(o/pi,m);
Output:
Result: The FIR filters using different windows has been observed & verified.
VBIT
Page 123
DIGITAL SIGNAL PROCESSING LAB 201
1
CYCLE-III
10. Architecture of DSP chips-TMS 320C 6713 DSP
Processor
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).
VBIT
Page 124
DIGITAL SIGNAL PROCESSING LAB 201
1
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
todays 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
-No ROM
-No I/O ports
-No 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
Optimized for fast arithmetic
- Extended precision
- Dual operand fetch
- Zero overhead loop
- Circular buffering
The basic features of a DSP Processor are
Feature Use
VBIT
Page 125
DIGITAL SIGNAL PROCESSING LAB 201
1
Fast-Multiply accumulate Most DSP algorithms, including filtering, transforms, etc. are
multiplication- intensive
Multiple access memory
architecture
Many data-intensive DSP operations require reading a 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
interfaces
On-chip peripherals like A/D converters allow for small low cost
system designs. Similarly I/O interfaces tailored for common
peripherals allow clean interfaces to off-chip I/O devices.
ARCHITECTURE OF 6713 DSP PROCESSOR
An overview of the architectural structure of the TMS320C67xx DSP, which comprises
the central processing unit (CPU), memory, and on-chip peripherals. The C67xE DSPs use an
advanced modified Harvard architecture that maximizes processing power with eight buses.
Separate program and data spaces allow simultaneous access to program instructions and data,
providing a high degree of parallelism. For example, three reads and one write can be performed
in a single cycle. Instructions with parallel store and application-specific instructions fully utilize
this architecture. In addition, data can be transferred between data and program spaces. Such
Parallelism supports a powerful set of arithmetic, logic, and bit-manipulation operations that can
all be performed in a single machine cycle. Also, the C67xx DSP includes the control
mechanisms to manage interrupts, repeated operations, and function calling.
Fig BLOCK DIAGRAM OF TMS 320VC 6713
VBIT
Page 126
DIGITAL SIGNAL PROCESSING LAB 201
1
Bus Structure
The C67xx DSP architecture is built around eight major 16-bit buses (four program/data buses
and four address buses):
_ The program bus (PB) carries the instruction code and immediate operands from program
memory.
_ Three data buses (CB, DB, and EB) interconnect to various elements, such as the CPU, data
address generation logic, program address generation logic, on-chip peripherals, and data
memory.
_ The CB and DB carry the operands that are read from data memory.
_ The EB carries the data to be written to memory.
_ Four address buses (PAB, CAB, DAB, and EAB) carry the addresses needed for instruction
execution.
VBIT
Page 127
DIGITAL SIGNAL PROCESSING LAB 201
1
The C67xx DSP can generate up to two data-memory addresses per cycle using the two auxiliary
register arithmetic units (ARAU0 and ARAU1). The PB can carry data operands stored in
program space (for instance, a coefficient table) to the multiplier and adder for
multiply/accumulate operations or to a destination in data space for data move instructions
(MVPD and READA). This capability, in conjunction with the feature of dual-operand read,
supports the execution of single-cycle, 3-operand instructions such as the FIRS instruction. The
C67xx DSP also has an on-chip bidirectional bus for accessing on-chip peripherals. This bus is
connected to DB and EB through the bus exchanger in the CPU interface. Accesses that use this
bus can require two or more cycles for reads and writes, depending on the peripherals structure.
Central Processing Unit (CPU)
The CPU is common to all C67xE devices. The C67x CPU contains:
_ 40-bit arithmetic logic unit (ALU)
_ Two 40-bit accumulators
_ Barrel shifter
_ 17 17-bit multiplier
_ 40-bit adder
_ Compare, select, and store unit (CSSU)
_ Data address generation unit
_ Program address generation unit
Arithmetic Logic Unit (ALU)
The C67x DSP performs 2s-complement arithmetic with a 40-bit arithmetic logic unit (ALU)
and two 40-bit accumulators (accumulators A and B). The ALU can also perform Boolean
operations. The ALU uses these inputs:
_ 16-bit immediate value
_ 16-bit word from data memory
_ 16-bit value in the temporary register, T
_ Two 16-bit words from data memory
_ 32-bit word from data memory
_ 40-bit word from either accumulator
The ALU can also function as two 16-bit ALUs and perform two 16-bit operations
simultaneously.
VBIT
Page 128
DIGITAL SIGNAL PROCESSING LAB 201
1
Fig ALU UNIT
Accumulators
Accumulators A and B store the output from the ALU or the multiplier/adder block. They can
also provide a second input to the ALU; accumulator A can be an input to the multiplier/adder.
Each accumulator is divided into three parts:
_ Guard bits (bits 3932)
_ High-order word (bits 3116)
_ Low-order word (bits 150)
Instructions are provided for storing the guard bits, for storing the high- and the low-order
accumulator words in data memory, and for transferring 32-bit accumulator words in or out of
data memory. Also, either of the accumulators can be used as temporary storage for the other.
Barrel Shifter
The C67x DSP barrel shifter has a 40-bit input connected to the accumulators or to data memory
(using CB or DB), and a 40-bit output connected to the ALU or to data memory (using EB). The
barrel shifter can produce a left shift of 0 to 31 bits and a right shift of 0 to 16 bits on the input
data. The shift requirements are defined in the shift count field of the instruction, the shift count
VBIT
Page 129
DIGITAL SIGNAL PROCESSING LAB 201
1
field (ASM) of status register ST1, or in temporary register T (when it is designated as a shift
count register).The barrel shifter and the exponent encoder normalize the values in an
accumulator in a single cycle. The LSBs of the output are filled with 0s, and the MSBs can be
either zero filled or sign extended, depending on the state of the sign-extension mode bit (SXM)
in ST1. Additional shift capabilities enable the processor to perform numerical scaling, bit
extraction, extended arithmetic,
and overflow prevention operations.
Multiplier/Adder Unit
The multiplier/adder unit performs 17 _ 17-bit 2s-complement multiplication with a 40-bit
addition in a single instruction cycle. The multiplier/adder block consists of several elements: a
multiplier, an adder, signed/unsigned input control logic, fractional control logic, a zero detector,
a rounder (2s complement), overflow/saturation logic, and a 16-bit temporary storage register
(T). The multiplier has two inputs: one input is selected from T, a data-memory operand, or
accumulator A; the other is selected from program memory, data memory, accumulator A, or an
immediate value. The fast, on-chip multiplier allows the C54x DSP to perform operations
efficiently such as convolution, correlation, and filtering. In addition, the multiplier and ALU
together execute multiply/accumulate (MAC) computations and ALU operations in parallel in a
single instruction cycle. This function is used in determining the Euclidian distance and in
implementing symmetrical and LMS filters, which are required for complex DSP algorithms. See
section 4.5, Multiplier/Adder Unit, on page 4-19, for more details about the multiplier/adder unit.
Fig MULTIPLIER/ADDER UNIT
Fig MULTIPLIER/ADDER UNIT
VBIT
Page 130
DIGITAL SIGNAL PROCESSING LAB 201
1
These are the some of the important parts of the processor and you are instructed to go through
the detailed architecture once which helps you in developing the optimized code for the required
application.
11. Verification of convolution using CC Studio
Aim: To verify linear and circular convolution using CC Studio.
Procudure to use CC Studio:
I)write a C program in a notepad and save it with an extension .C.
II)Creating a New Project
1.double-click the Code Composer Studio icon on your desktop
2.From the Project menu, choose New.
VBIT
Page 131
DIGITAL SIGNAL PROCESSING LAB 201
1
3. In the Project Name field, type volume1.
4. In the Location field, browse to the working folder you created in step 1.
5. In the Project Type field, select Executable (.out).
6. In the Target field, select your target configuration and click Finish.
7. The Code Composer Studio Program creates a project file called volume1.pjt. This file
stores your project settings and references the various files used by your project.
III)Adding Files to a Project
1. Choose ProjectAdd Files to Project. Select volume.c from the working folder you
created, and click Open. You can also add files to the project by right-clicking on the
Project View icon and choosing Add Files to Project or by dragging and dropping files
into folders in the Project View window.
2. Choose ProjectAdd Files to Project. Select C Source Files (*.c*, *.ccc*) in the Files
of type box. Select vectors.c, and click Open.
3. Choose ProjectAdd Files to Project. Select Linker Command File (*.cmd, *.lcf) in the
Files of type box. Select volume.cmd and click Open. This file maps sections to
memory.
4. Choose ProjectAdd Files to Project. Go to the compiler library folder
(C:\CCStudio_v3.10\c6000\cgtools\lib). Select Object and Library Files (*.o*, *.l) in the
Files of type box. Select the rts.lib file for the target you are configured for and
click Open. This library provides run-time support for the target DSP. For some targets,
the runtime library may have a more specific file name, for example, rts6200.lib.
5. Expand the Project list by clicking the + signs next to Projects, volume1.pjt, Libraries,
and Source. This list is called the Project View. This is a generic view of the project, your
.lib file may differ:
VBIT
Page 132
DIGITAL SIGNAL PROCESSING LAB 201
1
IV)Reviewing the Source Code
1. Double-click on the volume.c file in the Project View to open the source code in the right half
of the Code Composer Studio window
V)Building and Running the Program
1.Choose project compile file.
2. Choose project build.
3. Choose file load program debug volume.out open
4.Choose debugrun ,out put is displayed in stdout window.
VI)Displaying Graphs
1. Choose ViewGraphTime/Frequency.
2. In the Graph Property Dialog, change the Graph Title, Start Address, Acquisition Buffer
Size, Display Data Size, DSP Data Type, Autoscale, and Maximum Y-value properties to
the values shown here. Scroll down or resize the dialog box to see all the properties.
VBIT
Page 133
DIGITAL SIGNAL PROCESSING LAB 201
1
3. Click OK. An Input graph window for the Input Buffer appears.
4. Right-click on the Input graph window and choose Clear Display from the pop-up menu.
5. Choose ViewGraphTime/Frequency again.
6. This time, change the Graph Title to Output and the Start Address to out_buffer. All the
other settings are correct.
7. Click OK to display the Output graph window. Right-click on the Output graph window
and choose Clear Display from the pop-up menu.
Program:
% linear convolution
#include<stdio.h>
main()
{
int m=4;
int n=4;
int i=0,j;
int x[10]={1,2,3,4,0,0,0};
int h[10]={1,2,3,4,0,0,0};
int y[10];
for(i=0;i<m+n-1;i++)
{
y[i]=0;
for(j=0;j<=i;j++)
y[i]+=x[j]*h[i-j];
}
for(i=0;i<m+n-1;i++)
VBIT
Page 134
DIGITAL SIGNAL PROCESSING LAB 201
1
printf("%d\n",y[i]);
}
OUTPUT:
1
4
10
20
25
24
16
% circular convolution
#include<stdio.h>
int m,n,x[10],y[10],i,j,temp[10],k,x2[10],a[10],h[10];
void main()
{
printf("enter length of first sequence\n");
scanf("%d",&m);
printf("Enter length of second sequence\n");
scanf("%d",&n);
printf("Enter first sequence\n");
for(i=0;i<m;i++)
scanf("%d",&x[i]);
printf("Enter 2nd sequence\n");
for(j=0;j<n;j++)
scanf("%d",&h[j]);
if((m-n)!=0)
{
if(m>n)
{
for(i=n;i<m;i++)
h[i]=0;
n=m;
}
else
{
for(i=m;i<n;i++)
x[i]=0;
m=n;
}
}
y[0]=0;
VBIT
Page 135
DIGITAL SIGNAL PROCESSING LAB 201
1
a[0]=h[0];
for(j=1;j<n;j++)
a[j]=h[n-j];
for(i=0;i<n;i++)
y[0]+=x[i]*a[i];
for(k=1;k<n;k++)
{
y[k]=0;
for(j=1;j<n;j++)
x2[j]=a[j-1];
x2[0]=a[n-1];
for(i=0;i<n;i++)
{
a[i]=x2[i];
y[i]+=x[i]*x2[i];
}
}
printf("circular convolution\n");
for(i=0;i<n;i++)
printf("%d\t",y[i]);
}
OUTPUT:
enter length of first sequence
2
Enter length of second sequence
2
Enter first sequence
1
2
Enter 2nd sequence
2
3
circular convolution
11 4
VBIT
Page 136
DIGITAL SIGNAL PROCESSING LAB 201
1
Viva Questions
1) What is sampling theorem?
2) What do you mean by process of reconstruction.
VBIT
Page 137
DIGITAL SIGNAL PROCESSING LAB 201
1
3) What are techniques of reconstructions.
4) What do you mean Aliasing? What is the condition to avoid aliasing for sampling?
5) Write the conditions of sampling.
6) Explain the statement= 0:0.000005:0.05
7) What is a) Under sampling b) nyquist plot c) Over sampling?
8) Write the MATLAB program for over sampling.
9) What is the use of command 'legend'?
10) Write the difference between built in function; plot and stem describe the function.
11) What the function is of built in function and subplot?
12) What is linear convolution?
13) Explain how convolution syntax built in function works.
14) How to calculate the beginning and end of the sequence for the two sided controlled
output?
15) What is the total output length of linear convolution sum?
16) What is an LTI system?
17) Describe impulse response of a function.
18) What is the difference between convolution and filter?
19) Where to use command filter or impz, and what is the difference between these two?
20) What is the use o function command 'deconv'?
21) What is the difference between linear and circular convolution?
22) What do you mean by statement subplot (3,3,1).
23) What do you mean by command "mod" and where it is used?
24) What do you mean by Autocorrelation and Crosscorrelation sequences?
25) What is the difference between Autocorrelatio and Crsscorrelation.
26) List all the properties of autocorrelation and Crosscorrelaion sequence.
27) Where we use the inbuilt function 'xcorr' and what is the purpose of using this function?
28) How to calculate output of DFT using MATLAB?
29) 32. How to calculate output length of the linear and circular convolution.
30) 33. What do you mean by built in function 'fliplr' and where we need to use this.
VBIT
Page 138
DIGITAL SIGNAL PROCESSING LAB 201
1
31) 34. What is steady state response?
32) 35. Which built in function is used to solve a given difference equation?
33) 36. Explain the concept of difference equation.
34) 37. Where DFT is used?
35) 38. What is the difference between DFT and IDFT?
36) 39. What do you mean by built in function 'abs' and where it is used?
37) 40. What do you mean by phase spectrum and magnitude spectrum/ give comparison.
38) 41. How to compute maximum length N for a circular convolution using DFT and IDFT.
(what is
39) command).
40) 42. Explain the statement- y=x1.*x2
41) 43. What is FIR and IIR filter define, and distinguish between these two.
42) 44. What is filter?
43) 45. What is window method? How you will design an FIR filter using window method.
44) 46. What are low-pass and band-pass filter and what is the difference between these two?
45) 47. Explain the command N=ceil(6.6*pi/tb)
46) 48. Write down commonly used window function characteristics.
47) 49. What is the matlab command for Hamming window? Explain.
48) 50. What do you mea by cut-off frequency?
49) 51. What do you mean by command butter, cheby1?
50) 52. Explain the command in detail- [N,wc]=buttord(2*fp/fs,2*fstp/fs,rp,As)
51) 53. What is CCS? Explain in detail to execute a program using CCS.
52) 54. Why do we need of CCS?
53) 55. How to execute a program using 'dsk' and 'simulator'?
54) 56. Which IC is used in CCS? Explain the dsk, dsp kit.
55) 57. What do you mean by noise?
56) 58. Explain the program for linear convolution for your given sequence.
57) 59. Why we are using command 'float' in CCS programs.
58) 60. Where we use 'float' and where we use 'int'?
VBIT
Page 139
DIGITAL SIGNAL PROCESSING LAB 201
1
59) 61. Explain the command- i=(n-k)%N
60) 62. Explain the entire CCS program in step by step of execution.
VBIT
Page 140

Das könnte Ihnen auch gefallen