You are on page 1of 57

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

LAB MANUAL

SUBJECT: [ DSP- ]

B.Tech3rd Year 5THSemester

Branch: ECE

Lab Co-ordinator: Approved By: HOD

Mr. Deepak Sahu Prof. (Dr.) SeemaNayak

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


VISION AND MISSION OF THE INSTITUTE

Vision:
To be among the renowned institutions providing engineering and management education of
excellence, empowered with research, innovation and entrepreneurship with high ethical values,
catering to the needs of industry and society.

Mission:
1. To offer state of the art undergraduate and postgraduate program.
2. To be a learner centric institute imbibing experimental innovation and lifelong learning
skills, addressing societal problems with high ethical values for nation building.
3. To deliver changing demands of industry and academia through our stakeholders.
4. To contribute as a professional leader in the growing field of entrepreneurship and research.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

VISION AND MISSION OF THE DEPARTMENT

Vision:

To impart knowledge and skill of Electronics and Communication to develop and sustain a culture of research
while promoting values, innovation, entrepreneurship, ethics and professionalism to meet the needs of
industry and society.

Mission:

1. To conduct the electronics and communication engineering programme with practical


exposure, creating new knowledge and skill-sets by engaging in the research oriented
approach and promoting the academic growth.
2. To promote creative thinking and innovations by the students and faculty.
3. To develop strong industry–academia relationship and connect students for recent technical
trends.
4. To nurture students and infuse professional ethics, human values and positive attitude in the
students.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Communication Engineering Lab [KEC-451]

Pre-requisites of the Course:

Course Outcomes (CO’s)


At the end of this course students will be demonstrate the ability to:

Understand the basics operation of MATLAB/SCI Lab


CO 1:

Analysis the time domain and frequency domain signals.


CO 2:

Implement the concept of Fourier series and Fourier transforms.


CO 3:

Find the stability of system using pole-zero diagrams and bode diagram.
CO 4:

Design frequency response of the system


CO 5:

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Program Outcomes (PO’s):

PO-1: Engineering knowledge: Apply the knowledge of mathematics, science, engineering


fundamentals, and an engineering specialization to the solution of complex engineering problems.
PO-2: Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics,
natural sciences, and engineering sciences.
PO-3: Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consideration
for the public health and safety, and the cultural, societal, and environmental considerations.
PO-4: Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
PO-5: Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with
an understanding of the limitations.
PO-6: The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
PO-7: Environment and sustainability: Understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for
sustainable development
PO-8: Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.
PO-9: Individual and team work: Function effectively as an individual, and as a member or leader
in diverse teams, and in multidisciplinary settings.
PO-10: Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write
effective reports and design documentation, make effective presentations, and give and receive clear
instructions.
PO-11: Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member and leader
in a team, to manage projects and in multidisciplinary environments.
PO-12: Life-long learning: Recognize the need for, and have the preparation and ability to engage
in independent and life-long learning in the broadest context of technological change.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Programme Specific Outcomes (PSO’s):

PSO-1: Graduates of the programme will be able to analyse real world engineering problems and
provides its solution in the field of electronics and communication engineering

PSO-2: Graduates of the programme will be able to design and test systems in the field of embedded
system and ICT.

CO-PO Mapping:

Course PO PO PO PO PO PO PO PO PO PO PO PO PSO PSO


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

CO1 3 2 2 1 2 - - 1 2 - 2 1 1
CO2 2 2 2 1 2 - - 1 2 - 2 1 1
CO3 2 2 1 1 2 - - - 1 - 1 1 1
CO4 2 2 1 1 2 - - 1 1 - 1 1 1
CO5 2 2 2 1 2 - - - 1 - 1 1 1
3 – High; 2 – Medium; 1 – Low

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


IIMT COLLEGE OF ENGINEERING, GREATER NOIDA
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
REC453: SIGNALS & SYSTEMS LAB (As per AKTU, Lucknow Syllabus)
1. Introduction to MATLAB/SCI LAB
 To define and use variables and functions in MATLAB/SCI LAB.
 To define and use Vectors and Matrices in MATLAB/SCI LAB.
 To study various MATLAB/SCI LAB arithmetic operators and mathematical functions.
 To create and use m-files.
2. Basic plotting of signals
 To study various MATLAB/SCI LAB commands for creating two- and three-dimensional
plots.
 Write a MATLAB/SCI LAB program to plot the following Continuous time and discrete
time signals
o Step Function
o Impulse Function
o Exponential Function
o Ramp Function
o Sine Function
3. Time and Amplitude transformations
 Write a MATLAB/SCI LAB program to perform amplitude-scaling, time-scaling and time-
shifting on a given signal.
4. Convolution of given signals
 Write a MATLAB/SCI LAB program to obtain linear convolution of the given sequences.
5. Autocorrelation and Cross-correlation
 Write a MATLAB/SCI LAB program to compute autocorrelation of a sequence x(n) and
verify the property.
 b. Write a MATLAB/SCI LAB program to compute cross-correlation of sequences x(n) and
y(n) and verify the property.
6. Fourier Series and Gibbs Phenomenon
 To calculate Fourier series coefficients associated with Square Wave.
 To Sum the first 10 terms and plot the Fourier Series as a function of time.
 To Sum the first 50 terms and plot the Fourier Series as a function of time.
7. Calculating transforms using MATLAB/SCI LAB
 Calculate and plot Fourier Transform of a given signal.
 Calculate and plot Z-transform of a given signal.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


8. Impulse response and Step response of a given system.
 Write a MATLAB/SCI LAB program to find the impulse response and step response of a
system from its difference equation.
 Compute and plot the response of a given system to a given input.
9. Pole-zero diagram and bode diagram.
 Write a MATLAB/SCI LAB program to find pole-zero diagram, bode diagram of a given
system from the given system function.
 Write a MATLAB/SCI LAB program to find, bode diagram of a given system from the given
system function.
10. Frequency response of a system
 Write a MATLAB/SCI LAB program to plot magnitude and phase response of a given
system

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


IIMT COLLEGE OF ENGINEERING, GREATER NOIDA
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
REC453: SIGNALS & SYSTEMS LAB
LIST OF EXPERIMENTS

To study about DSP Processors and architecture of TMS320C6713 DSP Processor


2. Basic plotting of signals
 To study various MATLAB/SCI LAB commands for creating two- and three-dimensional
plots.
 Write a MATLAB/SCI LAB program to plot the following Continuous time and discrete
time signals
o Step Function
o Impulse Function
o Exponential Function
o Ramp Function
o Sine Function
3. Time and Amplitude transformations
 Write a MATLAB/SCI LAB program to perform amplitude-scaling, time-scaling and time-
shifting on a given signal.
4. Convolution of given signals
 Write a MATLAB/SCI LAB program to obtain linear convolution of the given sequences.
5. Autocorrelation and Cross-correlation
 Write a MATLAB/SCI LAB program to compute autocorrelation of a sequence x(n) and
verify the property.
 b. Write a MATLAB/SCI LAB program to compute cross-correlation of sequences x(n) and
y(n) and verify the property.
6. Fourier Series and Gibbs Phenomenon
 To calculate Fourier series coefficients associated with Square Wave.
 To Sum the first 10 terms and plot the Fourier Series as a function of time.
 To Sum the first 50 terms and plot the Fourier Series as a function of time.
7. Calculating transforms using MATLAB/SCI LAB
 Calculate and plot Fourier Transform of a given signal.
 Calculate and plot Z-transform of a given signal.
8. Impulse response and Step response of a given system.
 Write a MATLAB/SCI LAB program to find the impulse response and step response of a
system form its difference equation.
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
 Compute and plot the response of a given system to a given input.
9. Pole-zero diagram and bode diagram.
 Write a MATLAB/SCI LAB program to find pole-zero diagram, bode diagram of a given
system from the given system function.
 Write a MATLAB/SCI LAB program to find, bode diagram of a given system from the given
system function.
10. Frequency response of a system
 Write a MATLAB/SCI LAB program to plot magnitude and phase response of a given
system

11. Write a scilab MATLAB/SCI LAB for understanding sampling theorem.

Mr. Deepak Sahu


(Lab Coordinator)

IIMT COLLEGE OF ENGINEERING, Gr. NOIDA

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

REC453: SIGNALS & SYSTEMS LAB

Safety measures in laboratories:


1 Fully and rightly loaded PC Systems with needed software are readily available for students.
2 Software up gradations is maintained by IT cell.
3 Power backups are in the lab.
4 Systems are upgraded as per requirements.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Experiment: 1

Aim: To study about DSP Processors and architecture of TMS320C6713 DSP Processor

1.1 Architecture

The C6713 DSK is a low-cost standalone development platform that enables users to evaluate and
develop applications for the TI C67xx DSP family. The DSK also serves as a hardware reference
design for the TMS320C6713 DSP. Schematics, logic equations and application notes are available
to ease hardware development and reduce time to market.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


The DSK comes with a full complement of on-board devices that suit a wide variety of application
environments. Key features include:

• A Texas Instruments TMS320C6713 DSP operating at 225 MHz


• An AIC23 stereo codec
• 16 Mbytes of synchronous DRAM
• 512 Kbytes of non-volatile Flash memory (256 Kbytes usable in default configuration)
• 4 user accessible LEDs and DIP switches
• Software board configuration through registers implemented in CPLD
• Configurable boot options
• Standard expansion connectors for daughter card use
• JTAG emulation through on-board JTAG emulator with USB host interface or external emulator
• Single voltage power supply (+5V)
1.2 Functional Overview of the TMS320C6713 DSK

The DSP on the 6713 DSK interfaces to on-board peripherals through a 32-bit wide EMIF (External
Memory Interface). The SDRAM, Flash and CPLD are all connected to the bus. EMIF signals are
also connected daughter card expansion connectors which are used for third party add-in boards. The
DSP interfaces to analog audio signals through an on-board AIC23 codec and four3.5 mm audio
jacks (microphone input, line input, line output, and headphone output).The codec can select the
microphone or the line input as the active input. The analog output is driven to both the line out
(fixed gain) and headphone (adjustable gain) connectors. McBSP0 is used to send commands to the
codec control interface whileMcBSP1 are used for digital audio data. McBSP0 and McBSP1 can be
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
re-routed to the expansion connector in software programmable logic device called a CPLD is used
to implement glue logic that ties the board components together. The CPLD has a register based user
interface that lets the user configure the board by reading and writing to its registers. The DSK
includes 4 LEDs and a 4 position DIP switch as a simple way to provide the user with interactive
feedback. Both are accessed by reading and writing to the CPLD registers. An included 5V external
power supply is used to power the board. On-board switching voltage regulators provide the +1.26V
DSP core voltage and +3.3V I/O supplies. The board is held in reset until these supplies are within
operating specifications. Code Composer communicates with the DSK through an embedded JTAG
emulator with a USB host interface. The DSK can also be used with an external emulator through
the external JTAG connector.

1.3 Basic Operation

The DSK is designed to work with TI’s Code Composer Studio development environment and ships
with a version specifically tailored to work with the board. Code Composer communicates with the
board through the on-board JTAG emulator. To start, follow the instructions in the Quick Start
Guide to install Code Composer. This process will install all of the necessary development tools,
documentation and
Drivers. After the install is complete, follow these steps to run Code Composer. The DSK must be
fully connected to launch the DSK version of Code Composer.
1) Connect the included power supply to the DSK.
2) Connect the DSK to your PC with a standard USB cable (also included).
3) Launch Code Composer from its icon on your desktop.

1.4 Memory Map

The C67xx family of DSPs has a large byte addressable address space. Program code and data can
be placed anywhere in the unified address space. Addresses are always32-bits wide. The memory
map shows the address space of a generic 6713 processor on the left with specific details of how
each region is used on the right. By default, the internal memory sits at the beginning of the address
space. Portions of the internal memory can be reconfigured in software as L2 cache rather than fixed
RAM. The EMIF has 4 separate addressable regions called chip enable spaces (CE0-CE3).The
SDRAM occupies CE0 while the Flash and CPLD share CE1. CE2 and CE3 are generally reserved
for daughter cards.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


1.5 Configuration Switch Settings

The DSK has 4 configuration switches that allows users to control the operational stateof the DSP
when it is released from reset. The configuration switch block is labelled SW3 on the DSK board,
next to the reset switch.Configuration switch 1 controls the endianness of the DSP while switches 2
and 3configure theboot mode that will be used when the DSP starts executing.Configuration switch
4 controls the on-chip multiplexing of HPI and McASP signalsbrought out to the HPI expansion
connector. By default all switches are off whichcorresponds to EMIF boot (out of 8-bit Flash) in
little endian mode and HPI signals onthe HPI expansion connector.

1. 6 Power Supply

The DSK operates from a single +5V external power supply connected to the mainpower input
(J5).Internally, the +5V input is converted into +1.26V and +3.3V usingseparate voltage regulators.
The +1.26V supply is used for the DSP core while the+3.3V supply is used for the DSP's I/O buffers
and all other chips on the board. Thepower connector is a 2.5mm barrel-type plug.There are three
power test points on the DSK at JP1, JP2 and JP4. All I/O currentpasses through JP2 while all core
current passes through JP1. All system currentpasses through JP4. Normally these jumpers are
closed. To measure the currentpassing through remove the jumpers and connect the pins with a
current measuringdevice such as a multimeter orcurrent probe.It is possible to provide the daughter
card with +12V and -12V when the external powerconnector (J6) is used.

RESULT: Study the architecture, Functional Overview, Basic Operation, Memory Mapof
TMS320C6713 DSP Processor

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Experiment No. -2
AIM:
Introduction to SCILAB and Code Composer Studio.

EQUIPMENTS:
 Operating System - Windows XP
 Software – SciLab 6.1.1 &ode Composer Studio. Introduction to Scilab: Basics

SciLab is a programming language that can be used for a wide array of numerical and computing
applications. SciLab has a quite astonishing array of built in functions which allow the user to
perform many needed operations. By making use of SciLab’s built in functions complicated
programs can be written quickly and efficiently.
SciLab is used primarily for numerical computing, as opposed to symbolic computations performed
by MathCad and Mathematica. For example, you cannot add x + x and get 2x unless you have
already defined a value for x, say 2, in which case x + x will return 4.
The following document will step you through basic SciLab functionality. The goal of this tutorial is
to give you an overview of SciLab command line structure, and to expose you to some basic
commands. As you enter the commands, ask yourself, “What should the result be?” Then see if you
were right or not. If you weren’t, figure out what happened.
Starting SciLab
Begin by starting SciLab. You will see a window with multiple insets. On the right hand inset you
will see the command line symbol, “>>”. When entering commands directly, type all commands
here.
Basic Syntax
The basic SciLab syntax has the following form
>> [assignment] [command] [termination]
[Termination] is the end of a SciLab line. Use; to suppress output to the screen and leave it blank to
write output to the screen.
[Commands] are the built-in or user-defined functions or operators that SciLab understands.
[Assignment] statements place the returned value of the command into a variable for storage; these
may be omitted.
Each of these will be discussed.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Basic Commands
At your command line type each of the following lines (but not ‘>>’). Separate each with the ‘enter’
key.

>> 1+1;
>>1+1
>>3*2
>>2^4
>>16.6-3/6

The preceding lines used basic SciLab operators, +,-,^,*, and / or calculations. Next, try out some
basic SciLab functions by typing the lines below, each followed by the ‘enter’ key. The argument is
in the parentheses.

>> sin (90)


>> sin(pi/2)
>>sind(90)
>> round(sind(45))

Notice that the reserved word ‘pi’ is employed and that the basic trig function require radians though
there are trig functions available that work in degrees. Also, in general you may pass anything that
would return a numerical value to any basic function, e.g the use of round.
Basic Assignment of Variables
Try out the following lines at your command line.
>> a = 1
>> b = 2
>> c = a + b
>> C = A + B

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


>> d = 5 + c
Note that we can only add a and b because they have been previously defined. Also, since A and B
are not defined, we cannot add them. Yes, SciLab is case sensitive.
Variable Types
You have up to this point been working with scalar variables, arrays in 1D having a single value.
SciLab also supports n-dimensional arrays. Type the following:
>> d
>> f = [1/ 5 ,23,6,3,-4,34.6,5, 1.3^5]
>> g = [a,b,c;0,0,7;3,2,1]
What is the function of the semicolon in this use?
What is the function of the comma? Why did we skip e as a variable name? Why do we have
integers in ‘g’ and floating point numbers in ‘f’?
Accessing Variables in Arrays
Use the (row, col) location to retrieve values.
>> c
>>g(2,3)
>>f(1,5)
>>g(2,3) + 4*f(1,5)
If you have not guessed yet, the comma is used to separate columns and the semicolon is used at the
end of a row in SciLab matrices. The final semicolon is normally omitted.
You can also assign variables to string values

>> h = ‘me’
>> k = ‘oh’
>> l = ‘my’
>> m = ‘ ‘
>> [h, k, l]
>> [h,,m,k,m,l]
>>h+m+k+l
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
Why were i andj skipped? Type i and j on your command line.
Useful Matrix Functions
The command ‘sort’ sorts within columns in ascending order by default. If this is not possible, it
defaults to a row-wise sort in ascending order.
>> sort(f)
>> sort(g)
For a quick description of how sort operates, type ‘help sort’. This will work with any command for
which SciLab has a definition.
Now try these commands, max, min, mean, std, operating on f and g.. What are they doing on f and
g? Also try typing f’ (note the apostrophe).
Matrix Operations
You can perform basic operations on matrices as long as the indices agree.
>> f+2*f
>> g*g
>> g^2
>>f+g
>> f*f’

SciLab will try to operate on all elements of a matrix with an operator or a function.
>> g-1
>> sin(f)
>> 2*f
You may also operate on all elements explicitly.
>>f.^2
Now
>> f^2
>>f.f
>>f.f’

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Note f’ is the transpose of f,f.fis the dot product. Operating only work when indices agree.
Matrix Assignment
Use the (row, col) location to place values in a matrix.
>> mat1 = zeros(4,4)
>> mat1(2,2)=16
>> mat1(1,:)=6
>> mat1(3,:)=[3,2,1,0]
What is the purpose of the colon?
Basic Plotting
Type the following commands to generate a simple line plot from data.
>> x=[1,2,3,4,5,6,7,8,9,10]
>> y=11-x
>> plot(x,y)
Where did all the values for y come from?
Basic Programming and Using the Editor
Click on the blank sheet icon in the SciLab main toolbar. This will open a SciLab editor window.
Begin typing the remainder of the tutorial in that window. The syntax for basic for loops is like
other programming languages:
for i=1:1:4
i
mat1(4,i)=i
pause
end

Note that the for loop is closed by an end statement. It also runs from 1 by 1 to 4 using the colons to
delimit the index definitions ( i=1:4 will produce the same result since the default increment is 1).
The pause is inserted so that you can see the results.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


To run the program, look for the ‘evaluate entire file’ icon on the toolbar in the editor. Click this.
You must hit the space bar to break the pause for each cycle.
By this point you should be familiar with basic SciLab commands and assignments for scalar
variables and for matrix variables. You should also be comfortable with programming a basic for
loop and plotting data.
Intro to Code Composer Studio (CCS)

CCS is a software integrated development environment (IDE) for building and debugging programs
for the DSK (Dsp Starter Kit), i.e. the dsp board. The software is used for three phases in the overall
DSP system design process:

1) Coding and building: writing code using the editor, creating a ‘project’, and compiling and
linking.
2) Debugging: syntax checking, probe points, break points
3) Analysis: statistics, benchmarking, real-time debugging

We will go through some elements of all three phases during this lab.

This lab is to get you familiar with the software, to give you a ‘feel’ of where things are located.
You are NOT expected to understand what you are doing. The ‘what is …’ questions will be
answered during the course of the semester.

The content of this lab is as follows:

I. CREATING PROJECTS

Create a ‘Project’
Create a Source File
Create a Command File
Add Files to a Project
Create the Executable File

II. DEBUGGING & ANALYSIS

Run the Program


View Memory
Graphical Display of Data
Check a Variable During Program Execution
Benchmarking

Resets
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
During the course of this exercise, you may need to reset the board. There are several ways to do
this at different levels:
- Debug> Reset CPU
- Close CCS. Start Button of Windows > Programs > Texas Instruments > Code Composer Studio
DSK Tools > Hardware Resets > Reset
- Close CCS. Unplug the board and turn it back on. Wait for the LED lights to quit flashing before
trying to use the board/open CCS again.

I. CREATING PROJECTS

An executable file is created from:


.c, .asm, .sa – source files
.cmd – command file
.h – header file
.lib – library files

To manage these files for a given project, we first create a ‘project’.

Create a ‘Project’

Choose Project > View.


Type in a Project Name and a location.
The type should be .out and the target 67xx.
Hit Finish
Your project.pjt should be in the Project View window.

Create a Source File

Choose File > New > Source File


An Editor window comes up.
Type in the following assembly code which declares 10 values:

.sect “.mydata”
.short 0
.short 7
.short 10
.short 7
.short 0
.short -7
.short -10
.short -7
.short 0
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
.short 7

Choose File > Save


Find your project folder, call the file initmem, and choose type .asm.
Hit Save.

Let’s create another source file, a C program. This program will do nothing at the beginning, but we
can develop it later on. Do as you did above, but this time for a C file which you should save as
main.c. The C code is:

#include <stdio.h>

void main()
{
printf(“Begin\n”);

printf(“End\n”);
}

Create a Command File

Often times you can use an existing .cmd file. But let’s put our data in a certain part of memory so
that we can access it.

Locate the Lab1.cmd file on the computer.


Choose File > Load and open the file.
After the line: .cio> IRAM,
type in: .mydata> SDRAM
This will put the data from your initmem file in a part of memory starting at 0x80000000.
Choose File > Save As. Save it in your project folder as Lab1.cmd

Although the files you have created are in your project folder, they have not been put in the folders
which will be used for assembling and linking. We have to add these files to the project for this
purpose.
Add Files to a Project

Project > Add Files to Project


Go to your project folder and open the initmem.asm file. This is now found under the Source folder
in the Project View window.
Do the same thing for the main.c and Lab1.cmd files.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


We also must add the run-time support library for the board since we have a C program. This file is
located at c:\ti\c6000\cgtools\lib\rts6701.lib. This file should appear under the Libraries folder in
the Project View window.

Create the Executable File, lab1.out:

Before we compile, assemble, and link, there are a number of options we can choose to determine
the amount of optimization done. There are four levels (Opt Level) of optimization: 0, 1, 2, and 3.
The lowest level is 0. However, sometimes, debugging can not be done when we use optimization.
So we will start out using no optimization to get things working.
Project > Options
Compiler, Basic – Check that Target Version: 671x and Opt Level: None
Linker, Basic – You can change the name of the executable file which will be produced.

Project > Build compiles, assembles, and links all of the files in the project and produce the
executable file lab1.out.
A window at the bottom shows if there are errors.
Project > Rebuild can be used when you have made a change to only a few files and now wish to
compile, assemble, and link with the changed files.
There are shortcut buttons on the window to do Project Build and Rebuild. FIND them. They will
be useful in the future.

You should have gotten a lot of errors upon building. Scroll up until you reach the first red line with
ERROR! in it. Double click on the line. The file initmem.asm opens at the line where the error
occurred. Assembly code required that all of the lines in this file NOT start in the first column. So
enter a space at the beginning of each line in the file and then save the file.

Since we didn’t change every file in the project, we can do a Project > Rebuild (you can also use the
shortcut button).

II. DEBUGGING & ANALYSIS

Run the Program

Now we can load the program into the DSP memory and execute the program.
File > Load Program and open the Lab1.out program which is in the Debug folder of your Lab1
project folder.

Debug > Run to run the program or use the shortcut button on the left. Find this button! It will be
useful in the future.

Begin and End should appear in the bottom Stouts window.


Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
View Memory:

Let’s see if the values of our initmem file are in the memory location we established in the .cmd file.

View > Memory


Type in 0x80000000 in memory location.
Format: 16bit Signed Int
A Memory window appears with the memory addresses and their contents.
## Write out on a piece of paper the memory locations for your data.
Why do you think there are two values per memory location?

Graphical Display of Data

We can graph the data which is in memory on the board:

View > Graph > Time/Frequency


Start Address: 0x80000000
Acquisition Buffer Size: 10
Display Data Size: 10
DSP Data Type: 16-bit signed integer
A graph should appear on the screen with a plot of your data.
## On a piece of paper, write down the value of the x-axis for the -10 data point.

**************************************

Before we look at additional debugging and analysis features, let’s modify our main.c program. We
will assign a pointer to the beginning of our data in memory. In this way, we can bring data into our
c program and print the data out.

Double-click on main.c in the project window.


Change the program so that it looks like the following:

#include <stdio.h>

void main()
{
int i;
short *point;
point= (short *) 0x80000000;
printf(“Begin\n”);
for (i=0;i<10;i++)
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
{
printf(“[%d] %d\n”,i, point[i]);
}
printf(“End\n”);
}

Save it, Rebuild (shortcut button on the top or Debug > Rebuild), and Load it into the DSP memory.
Run it.

Now we are ready to do some more analysis.

**************************************

Check a Variable During Program Execution

We use ‘breakpoints’ and ‘watch’ windows to watch variables while a program runs.

We will look at the values of the variable pointer in main.c before and after the pointer assignment
as well as the value of variable i.

File > Reload to reload the program (we loaded and ran it in the step before).

Double-click on main.c in the Project View window.


Put cursor on the line: point = (short *) 0x80000000
Set a breakpoint at this point by hitting the shortcut button (a hand) or right click and choose Toggle
Breakpoint.
If you get a message, and CCS moves the breakpoint that is okay. But click on Stdout window in
order to see the output results.
Repeat this with the line: printf("[%d] %d\n",i, point[i]);
Highlight the variable point in the line: point = (short*) … using the mouse.
Right click and select Add to Watch Window. A watch window opens which shows the variable
point.
Highlight the variable i in the line: printf(“[%d] … with the mouse.
Right click and select Add to Watch Window. This variable is now added to the window.

Hit the shortcut button for Run or Debug > Run.


The program stops at the breakpoint and the watch window shows the value of point before the
pointer is set. Now let’s see what it is after being set. Hit the shortcut button ‘step over a line’ or
Debug > Step Over. This moves you through the breakpoint to the next line. The pointer is now set,
and you can see the value of the pointer is 0x80000000.
## Write on a piece of paper the value of the pointer before it was set by the program.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Hit the shortcut button animate or Debug > Animate and watch the variable i as the program
progresses. On the other hand, you could hit the shortcut button ‘step over the line’ over and over to
see the variable i change. After using ‘animate’, you need to halt the system. You can do this with
the shortcut button on the left or with Debug > Halt.
If you want to do this exercise over again, go to Debug > Restart, Run, Step Over, etc.
Remove the breakpoints before continuing by hitting the shortcut button ‘Remove All Breakpoints’.

Result: Study the basic of SciLab and Code Composer Studio.

Short questions:
1) What is difference between CLC and close all?
2) What is command window?
3) What is editor file?
4) How to create m file?
5) What command is used for discrete signal?

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Experiment No.-3

Aim:
Write a SCILAB TOOL program for generation of basic signals such as unit impulse, unit step,
ramp, exponential sinusoidal and cosine.

Apparatus Required: SCILAB TOOL and PC.

Theory:
Continuous time and Discrete time signals
Continuous time signals:
A continuous signal or a continuous-time signal is a varying quantity (a signal) whose domain,
which is often time, is a continuum (e.g., a connected interval of the reals). That is, the function's
domain is an uncountable set. 

Discrete time signals:


A discrete signal or discrete-time signal is a timeseries consisting of a sequence of quantities. Unlike
a continuous-time signal, a discrete-time signal is not a function of a continuous argument; however,
it may have been obtained by sampling from a continuous-time signal

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Program:
clc;
clear ;
close all;
//Generation of sine wave
t =0:0.1:20;
f =0.2;
pi =3.14;
x1=sin (2* pi*f*t);
subplot(231) ;
plot (t,x1,'cya+','marker','d','markerfac','green','markeredg','red');
title ( ' Sinewave ' , ' color' ,'red','font size',4);
// x t i t l e ( ' Sinewave ' , ' Index ' , ' Amplitude ' ) ;
xlabel (" Index " , " font size " , 2," color " , " blue ");
ylabel ("Ampl i tude " , " font size " , 2, " color " , " blue ");
//Generation of cosine wave
t =0:0.1:20;
f =0.2;
pi =3.14;
x1=cos (2* pi*f*t);
subplot(232) ;
plot (t,x1,'cya+','marker','d','markerfac','green','markeredg','red');
title ( ' cosinewave ' , ' color' ,'red','font size',4);
// x t i t l e ( ' Sinewave ' , ' Index ' , ' Amplitude ' ) ;
xlabel (" Index " , " font size " , 2," color " , " blue ");
ylabel ("Ampl i tude " , " font size " , 2, " color " , " blue ");
//Generation of Impulsesignal
t1 = -10:10;
x3=[zeros(1,10),ones(1,1),zeros(1,10)];

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


subplot(233) ;
plot(t1,x3,'marker','d','marker fac','green','markeredg','red');
title ( ' Impulse ' , ' c o l o r ' , ' r ed ' , ' f o n t s i z e ' , 4);
xlabel (" Index " , " f o n t s i z e " , 2," c o l o r " , " blue ");
ylabel ("Ampl i tude " , " f o n t s i z e " , 2, " c o l o r " , " blue ");
//Generation of Ramp signal
t4 =0:10;
x4=t4;
// s c f ( ) ;
subplot(234) ;
plot (t4 ,x4, ,'marker','d','marker fac','green','markeredg','red');
title ( 'Ramp Wave ' , ' c o l o r ' , ' r ed ' , ' f o n t s i z e ' , 4);
xlabel (" Index " , " f o n t s i z e " , 2," c o l o r " , " blue ");
ylabel ("Ampl i tude " , " f o n t s i z e " , 2, " c o l o r " , " blue ");
//Generation of Exponential signal
t5 =0:10;
x5=exp(t5);
subplot(235) ;
plot (t5 ,x5 , ' cya+' , ,'marker','d','marker fac','green','markeredg','red');
title ('Exponetia l Wave ' , ' color ' , ' red ' , ' font size ' , 4);
xlabel (" Index " , " f o n t s i z e " , 2," c o l o r " , " blue ");
ylabel ("Ampl i tude " , " f o n t s i z e " , 2, " c o l o r " , " blue ");
//Generation of Step signal
n1 =1;
n0 =50;
n2 =100;
if((n0 <n1)|(n0 >n2)|(n1 >n2))
error( ' arugument incorrect ' );
end
n=[ n1:n2 ];
x6=[(n-n0)>=0,1];
subplot(236);
plot(n,x6(n1:n2),'marker','d','marker fac','green','markeredg','red');
title ( ' Step Sequence e ' , ' color ' , ' red ' , ' font size ' ,4);
xlabel (" Index " , " font size " , 2," color " , " blue ");
ylabel ("Amplitude " , " font size " , 2, " color " , " blue ");

Output:

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Result: Learning the plotting of various continuous-time signal and discrete time signals.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Experiment No. -4
AIM: To study matrix multiplication using code composer studio.

EQUIPMENTS:
 Operating System - Windows XP
 Software - Code Composer Studio.

Program:
#include <stdio.h>
int main()
{
int a[10][10], b[10][10], result[10][10], r1, c1, r2, c2, i, j, k;

printf("Enter rows and column for first matrix: ");


scanf("%d %d", &r1, &c1);

printf("Enter rows and column for second matrix: ");


scanf("%d %d",&r2, &c2);

// Column of first matrix should be equal to column of second matrix and


while (c1 != r2)
{
printf("Error! column of first matrix not equal to row of second.\n\n");
printf("Enter rows and column for first matrix: ");
scanf("%d %d", &r1, &c1);
printf("Enter rows and column for second matrix: ");
scanf("%d %d",&r2, &c2);
}

// Storing elements of first matrix.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


printf("\nEnter elements of matrix 1:\n");
for(i=0; i<r1; ++i)
for(j=0; j<c1; ++j)
{
printf("Enter elements a%d%d: ",i+1, j+1);
scanf("%d", &a[i][j]);
}

// Storing elements of second matrix.


printf("\nEnter elements of matrix 2:\n");
for(i=0; i<r2; ++i)
for(j=0; j<c2; ++j)
{
printf("Enter elements b%d%d: ",i+1, j+1);
scanf("%d",&b[i][j]);
}

// Initializing all elements of result matrix to 0


for(i=0; i<r1; ++i)
for(j=0; j<c2; ++j)
{
result[i][j] = 0;
}

// Multiplying matrices a and b and


// storing result in result matrix
for(i=0; i<r1; ++i)
for(j=0; j<c2; ++j)
for(k=0; k<c1; ++k)

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


{
result[i][j]+=a[i][k]*b[k][j];
}

// Displaying the result


printf("\nOutput Matrix:\n");
for(i=0; i<r1; ++i)
for(j=0; j<c2; ++j)
{
printf("%d ", result[i][j]);
if(j == c2-1)
printf("\n\n");
}
return 0;
}
Result:
Enter rows and column for first matrix: 3
2
Enter rows and column for second matrix: 3
2
Error! Column of first matrix not equal to row of second.

Enter rows and column for first matrix: 2


3
Enter rows and column for second matrix: 3
2

Enter elements of matrix 1:

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Enter elements a11: 3
Enter elements a12: -2
Enter elements a13: 5
Enter elements a21: 3
Enter elements a22: 0
Enter elements a23: 4

Enter elements of matrix 2:


Enter elements b11: 2
Enter elements b12: 3
Enter elements b21: -9
Enter elements b22: 0
Enter elements b31: 0
Enter elements b32: 4

Output Matrix:
24 29
6 25

clc;
clear all;
close all;
t=-2:1:2;
y=[zeros(1,2), ones(1,1), zeros(1,2)];
subplot(2,2,1);
plot(t,y);
ylabel('Amplitude -- >');
xlabel('(a) n -- >');

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


clc;
clear;
close all;
n= input('enter the N value');
t =-0:1:n-1;
y1=ones(1,n);
subplot(2,2,2);
plot(t,y1);
ylabel('Amplitude -- >');
xlabel('(b) n -- >');

clc;
clear;
close all;
n1=input('Enter the length of Ramp sequence');
t= 0:n1;
subplot(2,2,3);
plot(t,t);
ylabel('Amplitude -- >');
xlabel('(c) n -- >');

clc;
clear;
close all;
n2=input('enter the length of exponential sequence');
t=0:n2;
a=input('Enter the a value');
y2= exp(a*t);
subplot(2,2,4);
plot(t, y2);
ylabel('Amplitude -- >');
xlabel('(d) n -- >')

clc;
clear;
close all;
pi=3.14;
t=0:.01:pi;
y=sin(2*pi*t);
figure(2);
subplot(2,1,1);
plot(t,y);
ylabel('Amplitude -- >');
xlabel('(a) n -- >');

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


clc;
clear;
close all;
pi=3.14;
t=0:.01:pi;
y=cos(2*pi*t);
figure(2);
subplot(2,1,2);

Output:

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
Exp 4
clc;
clear;
close all;
N = input('Number of DFT points = ');
xn = input('Enter the sequence xn = ');// %Get the sequence from user
ln = length(xn);// %find the length of the sequence
xn = [xn zeros(1,N-ln)];
xk = zeros(1,N);// %initialize an array of same size as that of input sequence
ixk = zeros(1,N);// %initialize an array of same size as that of input sequence
//%code block to find the DFT of the sequence
for k = 0:N-1
for n = 0:N-1
xk(k+1) = xk(k+1)+(xn(n+1)*exp((-1i)*2*pi*k*n/N));
end
end
//%code block to plot the input sequence
t = 0:N-1;
subplot(2,2,1);
stem(t,xn);
ylabel('Amplitude ---->');
xlabel('n ---->');
title('Input Sequence ---->');
grid on;
magnitude = abs(xk);// %Find the magnitudes of individual DFT points
disp('DFT Sequence = ');
disp(magnitude);
%code block to plot the DFT sequence
t = 0:N-1;
subplot(2,2,2);
stem(t,magnitude);
ylabel('Amplitude ---->');
xlabel('K ---->');
title('DFT Sequence ---->');
grid on;
phase = angle(xk);// %Find the phases of individual DFT points
disp('Phase = ');
disp(phase);
%code block to plot the Phase Response
t = 0:N-1;
subplot(2,2,3);
stem(t,phase);
ylabel('Phase ---->');
xlabel('K ---->');
title('Phase Response');
grid on;
//% Code block to find the IDFT of the sequence
for n = 0:N-1

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


for k = 0:N-1
ixk(n+1) = ixk(n+1)+(xk(k+1)*exp(1i*2*pi*k*n/N));
end
end
ixk = ixk./N;
//%code block to plot the IDFT sequence
t = 0:N-1;
subplot(2,2,4);
stem(t,ixk);
disp('IDFT Sequence = ');
disp(ixk);
ylabel('Amplitude ---->');
xlabel('n ---->');
title('IDFT sequence ---->');
grid on;

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Experiment No. - 5
AIM: Write the SCILAB program to evaluate the DFT and IDFT of given signal x[n].
EQUIPMENTS:
 Operating System - Windows XP
 Software - SCILAB

THEORY: The DFT produces a sequence of N (typically complex) numbers, X0 … XN-1, via the
following:

N−1 k
−i2 π N n
X k = ∑ xn e
n=0
The IDFT (Inverse DFT) is defined as follows

N −1 k
1 +i2 π N n
xk =
N
∑ Xk e
k=0
PROGRAM
clear all;
clc ;
close ;

L = 10; // Length o f the sequence


N = 10; // N-point DFT
for n =0:L -1
x(n+1) = 1;
end

//Computing DFT
X = dft (x , -1)

//Computing IDFT
x_inv = real (dft(X ,1) )
n = 0:L -1;
K = 500;
k = 0:1: K;
w = 2* %pi*k/K;
X_W = x * exp(- sqrt ( -1)*n '*w);
Mag_X = abs (X_W);
Phase_X = atan( imag (X_W),real (X_W))
subplot (2 ,1 ,1)
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
plot2d (w, Mag_X )
xlabel( ' Fr equency in Radians ' )
ylabel( ' abs (X) ' )
title ( 'Magnitude Response' )
subplot (2 ,1 ,2)
plot2d (w, Phase_X )
xlabel( ' Fr equencyi n Radians ' )
ylabel( '<(X) ' )
title ( ' Phase Response' )
OUTPUT:
Enter the sequence for which DFT is to be calculated [1 1 1 1]
Enter the the value of N(Value of N in N-Point DFT ) 4
DFT of input sequence is
4 0 0 0
IDFT of input sequence is
1 0 0 0
RESULT: Evaluate a 4 – point DFT AND IDFT of x[n] = 1, 0<= n <= 3; 0 otherwise and result
show in figures.

Experiment No. -6
AIM: Write the SCILAB program to implement FFT algorithm.
EQUIPMENTS:
 Operating System - Windows XP
 Software - SCILAB

THEORY: The FFT is an efficient algorithm for computing the DFT. The FFT is based on the
divide-and-conquer paradigm. Take advantage of the symmetry and periodicity of the complex
exponential (let WN=e-j2p/N)
Signal System Lab, Deptt. of
k [N −n]
ECE kn ¿
−kn
IIMT, Gr. NOIDA
WN =W N =(W N )
Symmetry
Periodicity W kn k [n+N ]
=W [k+ N ]n
N =W N N
Note that two length N/2 DFTs take less computation than one length N DFT: 2(N/2)2<N2
Algorithms that exploit computational savings are collectively called Fast Fourier Transforms
Decimation-in-Time Algorithm: Consider expressing DFT with even and odd input samples:
N −1
X [ k ]= ∑ x [ n ]W nk
N
n=0
¿ ∑ N + ∑ x [n ]W N
x [ n ]W nk nk

n even n odd
N N
−1 −1
2 2

¿ ∑ x [2 r ](W 2N )rk +W kN ∑ x [ 2r +1 ]( W 2N )rk


r=0 r=0
N N
−1 −1
2 2

= ∑ x [2 r ]W N / 2 +W N ∑ x [ 2 r+ 1]W N /2
rk k rk

Result is the sum of two


r =0 N/2 length DFTs r=0

X[k]=G[k]underbracealignc N/⏟
2 DFT ¿ +W N⋅H[k]underbracealignc N/⏟
k
2 DFT ¿ ¿¿
of even samples ¿ of odd samples ¿
Then repeat decomposition of N/2 to N/4 DFTs, etc.
PROGRAM
clear all;
clc;
close ;
N = 1024;
SQNR = 30; //SQNR = 30 dB
v = log2 (N); // number o f s t a g e s
b = ( log2 (10^( SQNR /10) ) +2* v)/2;
b = ceil (b)
disp(b, 'The number o f b i t s r e q u i r e d rounded to : ' )

x = [1 ,1 ,1 ,1 ,1 ,1 ,1 ,1];
X = fft(x , -1)

// I n v e r s e FFT

x_inv = real (fft(X ,1) )

Mag_X = abs (X_W);


Phase_X = atan( imag (X_W),real (X_W))
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
subplot (2 ,1 ,1)
plot2d (w, Mag_X )
xlabel( ' Fr equency in Radians ' )
ylabel( ' abs (X) ' )
title ( 'Magnitude Response' )
subplot (2 ,1 ,2)
plot2d (w, Phase_X )
xlabel( ' Fr equencyi n Radians ' )
ylabel( '<(X) ' )
title ( ' Phase Response' )

OUTPUT:
Enter the sequence x[n]= [1 1 1 1 1 1 1 1 ]
Enter the value N point= 8
N point DFT is X[k] =
36.0000
-4.0000 + 9.6569i
-4.0000 + 4.0000i
-4.0000 + 1.6569i
-4.0000 - 0.0000i
-4.0000 - 1.6569i
-4.0000 - 4.0000i
-4.0000 - 9.6569i
RESULT: Evaluate a 8 – point fft of given sequence x[n] and result show in figures.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Experiment No. -7
AIM: Write the SCILABprogram to design FIR Low pass filter, FIR High-pass Filter, FIR Band-
pass Filter using Blackman and Hamming window Techniques.
EQUIPMENTS:
 Operating System - Windows XP
 Software - SCILAB

THEORY:
Finite Impulse Response (FIR) Filter
FIR filters are digital filters with finite impulse response. They are also known as non-recursive
digital filters as they do not have the feedback (a recursive part of a filter), even though recursive
algorithms can be used for FIR filter realization. Hence it is an all zero filter. Therefore input and
output difference equation for FIR filter is given by
y(n)=b0x(n)+b1x(n−1)+b2x(n−2)+...+bM−1x(n−N+1)
Where b0, b1, b2 ... b(M-1) are filter coefficients. FIR filters are particularly useful for applications
where exact linear phase response is required. The FIR filter is generally implemented in a non-
recursive way which guarantees a stable filter.
The ideal filter frequency response is used when designing FIR filters using window functions. The
objective is to compute the ideal filter samples. FIR filters have finite impulse response, which

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


means the ideal filter frequency sampling must be performed in a finite number of points. As the
ideal filter frequency response is infinite, it is easy to produce sampling errors. The error is less as
the filter order increases. Figure 4.a and 4.b illustrates the transfer functions of two standard ideal
filters

PROGRAM
clc ;
close ;
clear ;

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


// ftype=input ( ' Ent e r the Filter Type : ' , ' s ' ) ;
// forder=input ( ' Enter Order of Filter : ' ) ;
// cfreq=input ( ' Enter Cut-Off Frequency Vector : ' ) ;
//wtype=input ( ' Enter the Window Type : ' , ' s ' ) ;
// fpar=input ( ' Enter Window Parameter : ' ) ;

ftype = ' bp ' ;


forder =33;
fs =8000;
cfreq=[(450/ fs) (500/ fs)];
wtype = ' kr' ;
fpar=[0.8 0];
[wft ,wfm ,fr ]= wfir (ftype ,forder ,cfreq ,wtype , fpar );
clf ();
plot (fr ,wfm , ' b ' );
title ( ' Frequency Responce ' , ' color ' , ' red ' , ' font size ' ,4);
xlabel (" Frequency " , " font size " , 2," color " , " blue ");
ylabel ("Magnitude " , " font size " , 2, " color " , " blue ");

RESULT: Thus FIR - LPF, HPF, BPF, BSF using Blackman AND Hamming Window Technique
was implemented using SCILAB.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Experiment No. 8

AIM:Write a SCILAB Program to implementButterworth IIRanalog low pass filter for a 4KHz cut-
off frequency.

EQUIPMENTS:
 Operating System - Windows 10
 Software - SCILAB

THEORY:
The Butterworth filter provides a maximally flat response. However, this also has the advantage that
the calculations are somewhat simpler than those for other forms of filter.
This simplicity combined with a level of performance that is more than adequate for many
applications means that the Butterworth filter is widely used in many areas of electronics from RF to
audio active filters.
Using the equations for the Butterworth filter, it is relatively easy to calculate and plot the frequency
response as well as working out the values needed.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Specify from passband, determine N from stopband:

PROGRAM:

clc;
close ;
clear ;

ftype = ' l p ' ;


approx = ' cheb2 ' ;
om =[0.3 0.5];
deltap =0.1;
deltas =0.4;
[cells ,fact , zzeros , zpoles ]= eqiir(ftype , approx ,om ,
deltap , deltas );
h= fact * poly ( zzeros , ' z ' )/ poly ( zpoles , ' z ' );
pole_real=[];
pole_imag=[];
for i=1: length ( zpoles )
pole_real=[pole_realreal ( zpoles (i))];
pole_imag=[pole_imagimag( zpoles (i))];
End

mtlb_axis ([ -1 1 -1 1]) ;
xgrid();
plot ( pole_real , pole_imag , ' cya+' , ' marker ' , ' d ' , 'markerfac ' , ' r ed ' , ' markeredg ' , ' red ' );
title ( ' Pol e Lo c a t i o n ' , ' c o l o r ' , ' r ed ' , ' f o n t s i z e ' , 4);
xlabel ("Real Axi s " , " f o n t s i z e " , 2," c o l o r " , " blue ");
ylabel (" Imaginary Axi s " , " f o n t s i z e " , 2, " c o l o r " , "blue ");
Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
As an Example, Value

Enter the Passband ripple: 0.04


Enter the Stopband filter: 0.05
Enter Passband frequency: 1500
Enter Stopband frequency: 2000
Enter Sampling frequency: 8000

RESULT: Thus, the Butterworth IIR analog low pass filter for a 4KHz cut-off frequency.
was designed using SCILAB.

Experiment No.-9

AIM: To implement circular Convolution using code composer studio.

EQUIPMENTS:
 Operating System - Windows 10
 Constructor - Simulator
 Software - Code Composer Studio

Theory: For DFT, time domain circular convolution implies frequency domain multiplication, and
vice versa.Consider a periodic sequence. Its DTFT is both periodic and discrete in frequency.
Multiplication in the frequency domain results in a convolution of the two corresponding periodic
sequences in the time domain. Now let’s consider a single period of the resulted sequence. Since the
two sequences are both periodic, the convolution appears as ‘folding’ the rear of a sequence to the
front one by one, and superimposing the inner products so obtained, in a single period.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


x 3 [ n ]=x 1 [n ]⊗ x 2 [ n ]=x 2 [n ]⊗ x 1 [ n ]
N −1 N −1
¿ ∑ x 2 [ m] x 1 [(( n−m))N ]= ∑ x 2 [ m ]x 1 [(n−m)mod N ]
m=0 m=0

Symbol for representing circular convolution:  or N.If the DFT of x1[n], x2[n], and x3[n] are X1[k],
X2[k], and X3[k], respectively.Time domain circular convolution implies frequency domain
multiplication:

x 3 [ n ]=x 1 [n ]⊗ x 2 [ n]↔ X 3 [ k ]= X 1 [ k ] X 2 [ k ]

Program:

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


As an Example:

Enter the length of the first sequence


4

Enter the length of the second sequence


4

Enter the first sequence


1234

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Enter the second sequence
1 234

The circular convolution is


2628 26 20 28

RESULT: - Thus the Circular Convolution was implemented using code composer studio.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Experiment No. 10

AIM: To implement circular Convolution using code composer studio.

EQUIPMENTS:
 Operating System - Windows 10
 Constructor - Simulator
 Software - Code Composer Studio

Theory:

Program:

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA
RESULT: - Thus the Linear Convolution was implemented using code composer studio.

Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA


Signal System Lab, Deptt. of ECE IIMT, Gr. NOIDA

You might also like