0% found this document useful (0 votes)
7 views67 pages

DSP Lab

The document is a lab manual for the Digital Signal Processing Lab (BEC502) for B.E. V Semester students, detailing the course objectives, outcomes, and assessment methods. It outlines the institute's vision and mission, departmental goals, and provides a syllabus along with a list of experiments to be conducted using programming languages like MATLAB. Additionally, it includes guidelines for lab conduct and evaluation criteria for student performance.

Uploaded by

sahanashreehkhk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views67 pages

DSP Lab

The document is a lab manual for the Digital Signal Processing Lab (BEC502) for B.E. V Semester students, detailing the course objectives, outcomes, and assessment methods. It outlines the institute's vision and mission, departmental goals, and provides a syllabus along with a list of experiments to be conducted using programming languages like MATLAB. Additionally, it includes guidelines for lab conduct and evaluation criteria for student performance.

Uploaded by

sahanashreehkhk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 67

DepartmentofElectronics&CommunicationEngineering

DIGITALSIGNALPROCESSINGLAB
(IPCC) (BEC502)
(NEP,OutcomeBasedEducation(OBE)and Choice
BasedCredit System (CBCS)

B.E -VSemester
LabManual2024-25

Name:

USN:

Batch: Section:
. (NAACAccredited&ISO9001:2015CertifiedInstitution)
NH206(B.H.Road),Gubbi,Tumkur–572216.Karnataka.

DepartmentofElectronics&CommunicationEngineering

DIGITALSIGNALPROCESSINGLAB
(IPCC) (BEC502)

Manual

Preparedby: Reviewedby:
1. Dr.VeenaKumariHM Dr.VeenaKumariHM
Professor Professor

2. Mr.SreenivasaTV
AssistantProfessor

3. Ms.DivyaShreeBS
AssistantProfessor

Approvedby:
Dr.SureshDS
Professor&HOD, Dept.
Of ECE

.
[Type text]

INSTITUTEVISION

 To create centers of excellence in education and to serve the society by


enhancing the quality of life through value based professional leadership.

INSTITUTEMISSION

 To provide high quality technical and professionally relevant education in a


diverse learning environment.
 To provide the values that prepare students to lead their lives with personal
integrity, professional ethics and civic responsibility in a global society.
 To prepare next generation of skilled professionals to successfully compete in
the diverse global market.
 To promote campus environment that welcomes and honors women and men of
all races, creeds and cultures, values and intellectual curiosity, pursuit of
knowledge and academic integrity and freedom.

 To offer wide variety of off-campus education and training programmes to


individuals and groups.

 To stimulate collaborative efforts with Industry, Universities, Government and


Professional Societies.

 To facilitate public understanding of technical issues and achieve excellence in


the operations of the institute.

QUALITYPOLICY

Our organization delights customers (Student, Parents and Society) by


providing value added quality education to meet the National and International
requirements. We also provide necessary steps to train the students for
placement and continue to improve our methods of education to the students
through effective. Quality Management System, Quality Policy and Quality
Objectives.
[Type text]

DepartmentofElectronics&CommunicationEngineering

VISIONOFTHEDEPARTMENT

“To create globally competent Electronics and Communication Engineering


professionalswithethicalandmoralvaluesforthebettermentofthesociety”

MISSIONOFTHEDEPARTMENT

 To nurture the technical/professional/engineering and entrepreneurial skills for

overall self and societal upliftment through co-curricular and extra-curricular

events.

 To orient the Faculty/Student community towards the higher education,

research and development activities.

 To create the Centres of Excellence in the field of electronicsand communication

in collaboration with industries/Universities by training the faculty through latest

technologies.

 To impart quality technical education in the field of electronics and

communication engineering to meet over the current/future global industry

requirements.
[Type text]

PROGRAMEDUCATIONALOBJECTIVES
(PEO’s)

PEO1: ApplyMathematical, Scientific andEngineeringskillsforsolvingproblems inthe


areas of Electronics and Communication Engineering.

PEO2: Expose to Emerging Technologies and excel in Industries/higher


studies/research.

PEO3: Apply analytical skills in the areas of Electronics and Communication


Engineering to become competent and Employable.

PEO4: Inculcate Professional ethics, human values, team work for solving Engineering
problems and contribute to societal needs.

PROGRAMSPECIFICOUTCOMES
PSO1: Build Analog and Digital Electronic systems for Multimedia Applications,
VLSIandEmbeddedSystemsinInterdisciplinaryResearch/Development.

PSO2: Design and Develop Communication Systems as per Real Time Application and
Current Trends.

COURSEOBJECTIVES
1. Preparation:Topreparestudentswithfundamentalknowledge/overviewinthefield of
Digital Signal Processing

2. CoreCompetence:ToequipstudentswithabasicfoundationofSignalProcessingby
delivering the basics of Discrete Fourier Transforms, their properties, efficient
computations & the design of digital filters.
[Type text]

COURSEOUTCOMES
CO1:Analyzethedifferenttypesofsignalsandsystemsusedindigitalsignalprocessing.

CO2:ComputetheresponseofanLTIsystemusingtimeandfrequencydomain
techniques.
CO3:DevelopalgorithmsfortheefficientcomputationsofDFTandIDFT.

CO4:DesignofdigitalFIRfiltersforthegivenspecificationsusingdifferentwindow
methods.

CO5:DesignofdigitalIIRdigitalfiltersusingbilineartransformationmethod.
[Type text]

PROGRAMOUTCOMES

1. Engineering knowledge: Apply the knowledge of mathematics, science,


engineering fundamentals, and an engineering specialization for the solution of
complex engineering problems.
2. Problem analysis: Identify, formulate, research literature, and analyse complex
engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering
problems and design system components or processes that meet the specified
needs.
4. Conduct investigations of complex problems: An ability to design and conduct
scientific and engineering experiments, as well as to analyze and interpret data to
provide valid conclusions
5. Modern tool usage: Ability to apply appropriate techniques, modern engineering
and IT tools, to engineering problems.
6. The engineer and society: An ability to apply reasoning to assess societal, safety,
health and cultural issues and the consequent responsibilities relevant to the
professional engineering practice
7. Environment and sustainability: An ability to understand the impact of
professional engineering solutions in societal and environmental contexts
8. Ethics: Apply ethical principles and commit to professional ethics and
responsibilities and norms of the engineering practice.
9. Individualandteamwork:Abilitytofunctioneffectivelyasanindividual, andasa
member or leader in a team, and in multidisciplinary tasks.
10. Communication: Ability to communicate effectively on engineering activities with
the engineering community such as, being able to comprehend and write effective
reports and design documentation, make effective presentations.
11. Project management and finance: An ability to apply knowledge, skills, tools,
and techniques to project activities to meet the project requirements with the aim
of managing project resources properly and achieving the project’s objectives.
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.
[Type text]

DepartmentofElectronics&CommunicationEngineering
Syllabus
VISVESVARAYATECHNOLOGICALUNIVERSITY,BELAGAVI
B.E:Electronics&CommunicationEngineering
NEP,OutcomeBasedEducation(OBE)andChoiceBasedCreditSystem(CBCS) SEMESTER – V

DIGITALSIGNALPROCESSINGLABORATORY(IPCC)(BEC502)

CourseCode BEC502 CIEMarks 50


TeachingHours/Week
(3:0:2:0) SEEMarks 50
(L: T: P: S)
40hoursTheory+
TotalHoursofPedagogy TotalMarks 100
8-10 Lab slots
Credits 04 ExamHours 03
PRACTICALCOMPONENTOFIPCC
ListofProgramstobeimplemented&executedusinganyprogramminglanguageslikeMoku:
Go/MATLAB/OCTAVE (but not limited to)
SL. Experiments
No
1 Programtogeneratethefollowingdiscretetimesignals.
a)Unitsamplesequence,b)Unitstepsequence,c)Exponentialsequence,d) Sinusoidal
sequence, e) Random sequence
2 Programtoperformthefollowingoperationsonsignals.
a)Signaladdition,b)Signalmultiplication,c)Scaling,d)Shifting,e)Folding
3 Programtoperformconvolutionoftwogivensequences(withoutusingbuilt-in function)
and display the signals
4 Consideracausalsystemy(n)=0.9y(n-1)+x(n).
a)DetermineH(z)andsketchitspolezeroplot.b)Plot|H(e jω)|and∠H(ejω)
c)Determinetheimpulseresponseh(n).
5 ComputationofNpointDFTofagivensequence(withoutusingbuilt-infunction)and to plot
the magnitude and phase spectrum.
6 UsingtheDFTandIDFT,computethefollowingforanytwogivensequences
a)Circularconvolutionb)Linearconvolution
7 VerificationofLinearityproperty,circulartimeshiftproperty&circularfrequency shift
property of DFT.
8 Developdecimationintimeradix-2FFTalgorithmwithoutusingbuilt-infunctions.
9 Designandimplementationofdigital lowpassFIRfilterusingawindowtomeetthe given
specifications
10 Designandimplementationofdigital highpassFIRfilterusingawindowtomeetthe given
specifications
11 Designandimplementationofdigital IIRButterworthlowpassfiltertomeetthe given
specifications
12 DesignandimplementationofdigitalIIRButterworthhighpassfiltertomeetthe given
specifications
[Type text]

SuggestedLearningResources
1.Proakis&Manolakis,“DigitalSignalProcessing- Principles
Algorithms&Applications”,4thEdition,Pearson
education,NewDelhi,2007.ISBN:81-317-1000-9.
2. Li Tan, Jean Jiang, “Digital Signal processing Fundamentals
TextBooks andApplications”,AcademicPress,2013,ISBN:978-0-12-
415893.
3.VinayK.Ingle,JohnGProakis,“DigitalSignalProcessing Using
MATLAB, A problem Solving Companion”,
CengageLearning,2018,ISBN:93-86668-11-4
1.SimonHaykinandBarryVanVeen,“SignalsandSystems”,
2ndEdition,2008,WileyIndia.ISBN9971-51-239-4.
2.SanjitKMitra,“DigitalSignalProcessing,AComputer Based
Approach”, 4th Edition, McGraw Hill Education,
2017. ISBN:978-1-25-909858
ReferenceBooks 3.Oppenheim&Schaffer,“DscreteTimeSignalProcessing",
PHI,2003.
4.DGaneshRaoandVineethPGejji,“DigitalSignal
Processing"CengageIndiaPrivateLimited,2017,ISBN:
9386858231
Web links and Video Digital Signal processing,
Lectures(e-Resources): https://nptel.ac.in/courses/117102060
COURSEASSESSMENTANDEVALUATION
DirectAssessmentMethods
Contributing
When/Where Evidence
to Course
What Towhom (Frequencyin Max.Marks Collected
outcomes
the course)

Observation
bookwritten
Every lab at each lab
session +
Record CO1– CO5
(Avg.ofall 15 Record
&Observati
CIE Students experiment submittedat
on
marks) each lab
+
Viva
CO1– CO5
IATest one 10 BlueBooks

MAPPINGOFCOURSEOUTCOMESWITHPROGRAM
OUTCOMES
PO PSO
1 2 3 4 5 6 7 8 9 10 11 12 1 2
1 2 1 1 2 1
2 2 1 1 2 1
3 2 1 1 2 1
CO 4 2 1 1 2 1
5 2 1 1 2 1
Sum 10 5 5 10 5
Avg 2 1 1 2 1

3:Highcorrelation,2:Mediumcorrelation,1:Lowcorrelation
InstructionstotheCandidates

GeneralLabGuidelines:
• Conduct yourself in a responsible manner at all times in the laboratory. Intentional
misconduct will lead to the exclusion from the lab.
• Do not wander around, or distract other students, or interfere with the laboratory
experiments of other students.
• Read the handout and procedures before starting the experiments. Follow all written and
verbal instructions carefully. If you do not understand the procedures, ask the instructor
or teaching assistant.
• Attendance in all the labs is mandatory, absence permitted only with prior permission
from Class teacher.
• Theworkplacehastobetidybefore,duringandaftertheexperiment.
• Donoteatfood,drinkbeveragesorchewguminthelaboratory.
• Every student should know the location and operating procedures of all Safety equipment
including First Aid Kit and Fire extinguisher.

DO’S:-
 UniformandIDcardaremust.
 Strictlyfollowtheproceduresforconductionofexperiments.
 Recordshavetobesubmittedeveryweekforevaluation.
 Chairsandstoolsshouldbekeptundertheworkbencheswhennotinuse.
 After the lab session, switch off every supply, disconnect and disintegrate the
experiments and return the components.
 Keepyourbelongingsindesignatedarea.
 Never use damagedinstruments, wires orconnectors. Handthese parts to the
instructor/ teaching assistant.
 Signthelogbookwhenyouenter/leavethe laboratory.

DONT’S:-
 Don't touch open wires unless you are sure that there is no voltage.Alwaysdisconnect
the plug by pulling on the connector body not by the cable. Switch off the supply while
you make changes to the experiment.
 Don’t leave the experiment table unattended when the experimental setup supply is
on.
 Students are not allowed to work in laboratory alone or without presence of the
teaching staff/ instructor.
 Noadditionalmaterialshouldbecarriedbythestudentsduringregularlabs.
 Avoidsteppingonelectricalwiresoranyothercomputercables
University
EvaluationofDIGITALSIGNALPROCESSINGLABORATORY(IPCC) weightage
Marks
(BEC502)

Labinternal:Conductionfor50marks
1. Writeup–10M
DiscreteExperiments:
(Aim–1M,Circuit–3M,Design–3M,Waveforms–3M)
ProgrammingExperiments:(Aim–1M,Flowchart–3M,Program–6M)
2. ProgramExecution–30M
(Program/CodeOutput–25M,Comments–3M,Optimization–2M, (Partial 10
output – 25M, No Output – 00M )
3. Results&Viva–10M
(Identifying&Showingtheinputsandoutputs–2Mand/or
theoretical calculations – 2M, Output Verification – 1M)

RecordandObservation:
Conductionfor30marks(10Mrecordand20MObservation)
15
(Aim&Apparatus,Algorithm/flowchart(eachexperimentshouldhaveatleastone
flowchart, Calculations, Input/Output observations & Result (10+20=30M)
TotalMarks 25

CONTENTS

SL. PAGENO.
PARTICULARS
NO

1 IntroductionToMATLAB 1-5

2 ProcedureToExecuteMATLABPrograms 6-10
Programtogeneratethefollowingdiscretetimesignals.
a) Unit sample sequence, b) Unit step sequence, c)
3 11-14
Exponentialsequence,d)Sinusoidalsequence,e)Random
sequence
Programtoperformthefollowingoperationsonsignals.
4 a) Signaladdition,b)Signalmultiplication,c)Scaling,d)Shifting,e) 15-20
Folding
Programtoperformconvolutionoftwogivensequences(without using
5 21-22
built-in function) and display the signals
Consideracausalsystemy(n)=0.9y(n-1)+x(n).
a) DetermineH(z)andsketchitspolezeroplot.
6 23-24
b) Plot|H(ejω)|and∠H(ejω)
c) Determinetheimpulseresponse h(n).
ComputationofNpointDFTofagivensequence(withoutusingbuilt- in
7 25-26
function) and to plot the magnitude and phase spectrum.
UsingtheDFTandIDFT,computethefollowingforanytwogiven sequences
8 a) Circularconvolutionb)Linearconvolution 27-28

VerificationofLinearityproperty,circulartimeshiftproperty&circular
9 29-34
frequency shift property of DFT.
Developdecimationintimeradix-2FFTalgorithmwithoutusingbuilt- in
10 35-36
functions.
DesignandimplementationofdigitallowpassFIRfilterusinga window to
11 37-38
meet the given specifications
DesignandimplementationofdigitalhighpassFIRfilterusinga window to
12 39-40
meet the given specifications
DesignandimplementationofdigitalIIRButterworthlowpassfilterto meet
13 41-42
the given specifications
DesignandimplementationofdigitalIIRButterworthhighpassfilter to
14 43-44
meet the given specifications
15 BeyondSyllabusExperiments 45-52
16 VIVA QUESTIONS 53-54
DigitalSignalProcessingLab(IPCC) BEC502

INTRODUCTIONTOMATLAB
MATLAB stands for Matrix Laboratory. It is a high-performance language
that is used for technical computing. It was developed by Cleve Molar of the
company MathWorks. INC in the year 1984.It is written in C, C++, Java. It
allows matrix manipulations, plotting of functions, implementation of
algorithms and creation of user interfaces. It is both a programming language
as well as a programming environment. It allows the computation of
statements in the command window itself.

built-infunctionsofMATLABoffertop-notchresourcesforperforming
calculations, including optimization, linear algebra, numerical solution of
ordinary differential equations (ODEs), data analysis, quadrate, signal
processing,andmanyotherscientifictasks.Modernalgorithmsareusedforthe
majorityofthesefunctions.Therearemanyoftheseforbothanimationsand2- D and
3-D graphics. MATLAB also supports an external interface.

TheusercancreatetheirownfunctionsintheMATLABlanguage.Thus,theyare not
restricted to using only the built-in functions. Additional toolboxes are provided
by MATLAB. These toolboxes were created for common uses such as neural
networks, symbolic computations, image processing, control system design,
and statistics.

The various uses of MATLAB are: Developing algorithms, performing linear


algebrathatislinear,Graphplottingforlargerdatasets,Datavisualizationand
analysis, Numerical Matrix Computation

MATLABisgenerallyusedforthesetypesoftasks:
 Signalprocessing
 Optimizationoffunctions
 Controlsystemdesign
 ImageandAudioprocessing
 MachinelearningandDeeplearning

FeaturesofMATLAB

 MATLAB is a high-level language: MATLAB Supports Object


oriented programming. It also supports different types of
programming constructs like Control flow statements (IF-ELSE, FOR,
WHILE). MATLAB also supports structures like in C programming,
Functional programming (writing functions to contain commonly used
code and later calling them). It also contains Input / Output
statements like disp() and input().

 Interactive graphics: MATLAB has inbuilt graphics to enhance user


experience. We can actually visualize whatever data is there in forms
of plots and figures. It also supports processing of image and
displayingthemin2Dor3Dformats.Wecanvisualizeandmanipulate

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

our data across any of the three dimensions (1D, 2D, and 3D).We
canplotthefunctionsandcustomizethemalsoaccordingtoourneeds like
changing bullet points, line color and displaying/not displaying grid.

 A large library of Mathematical functions: MATLAB has a huge


inbuilt library of functions required for mathematical analysis of any
data. It has common math functions like sqrt. factorial etc. It has
functions required for statistical analysis like median, mode and std
(to find standard deviation), and much more. MATLAB also has
functions for signal processing like filter, butter(Butterworth filter
design)audioread,Conv,xcorr,fft,fftshiftetc.Italsosupportsimage
processingandsomecommonfunctionsrequiredforimageprocessing in
MATLAB are rgb2gray, rgb2hsv, adaptthresh etc.

 taaccessandprocessing: MATLABallowsaccessingofdata from


external sources like image files (.jpg, .PNG), audio files (.mp), and
real-time data from JDBC/ ODBC. We can easily read data from
externalsources usingthe inbuiltMATLAB functions like audioread for
reading audio files and imread for reading external images.

 Interactive environment: MATLAB offers interactive environmentby


providing a GUI (Graphical user interface) and different types of tools
like signal analyses and tuners. MATLAB also has tools for debugging
and the development of any software. Importing and
exportingfilesbecomeseasyinMATLABthroughtheGUI.Wecanview
theworkspacedataasweprogressinthedevelopmentofoursoftware and
modify it according to our needs.
 MATLAB can interface with different languages: We can write a
set of codes (libraries) in languages like PERL and JAVA, and we can
call those libraries from within the MATLAB itself. MATLAB also
supports ActiveX and .NET libraries.

 MATLAB and Simulink : MATLAB has an inbuilt feature of Simulink


wherein we can model the control systems and see their real-time
behavior. We can design any system either using code or building
blocksandseetheirreal-timeworking throughvariousinbuilttools. It has
lucid examples of basic control systems and their working.

 MATLAB’s Application programming interface (API): MATLAB


consistsofanextensive API.ThroughthisAPI, we canlink our C/C++
programs directly to MATLAB. Some options available in MATLAB API
are calling MATLAB programs, read and write M-files, and using
MATLAB asan interface torun applications. MATLAB can be used both
as a computation and analysis tool.
 Machine Learning, Deep Learning, and Computer vision: The
most demanding technologies like Machine learning, Deep learning,
andComputervisioncanbedoneinMATLAB.Wecancreateand

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

interconnect layers of a deep neural network, We can build custom


training loops and training layers with automatic differentiation. For
machine learning, we can use the DBSCAN algorithm to discover
clusters and noise in DATA. For computer vision, we can do object
tracking, object recognition, gesture recognition, and processing 3D
point clouds.

 ComputationalBiologytoolbox: Thistoolboxprovidesagreat way for


biologists and researchers to create and analyze new
algorithmsandpatternsfor developmentinbiologicalandbiochemical
domains. We can build biological models and analyze them using this
toolbox. Moreover, for students, this toolbox can be very much
educational if they want to explore the biological domain.

WritingaMATLABProgram

1. Using Command Window: Only one statement can be typed and


executed at a time. It executes the statement when the enter key is
pressed. This is mostly used for simple calculations. Note: ans is a
default variable created by MATLAB that stores the output of the
given computation.

2. Using Editor: Multiple lines of code can be written here and onlyafter
pressing the run button (or F5) will the code be executed. It is
alwaysagoodpracticetowriteclc,clearandcloseallinthebeginning of the
program.Note: Statements ending with a semicolon will not be
displayed in the command window, however, their values will be
displayed in the workspace. Any statement followed by % in MATLAB
is considered as a comment

3. Vector Operations: Operations such as addition, subtraction,


multiplication and division can be done using a single command
instead of multiple loops

BasicFunctionsinMATLAB

Function Description

The values or the text printed within single quotes is


disp()
displayed on the output screen

clear Toclearallvariables

closeall Tocloseallgraphicswindow

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Function Description

clc Toclearthecommandwindow

exp(x) Tocomputetheexponentialvalueofxtothebasee

abs(x) Tocomputetheabsolutevalueofx

sqrt(x) Tocomputethesquarerootofx

log(x) Tocomputethelogarithmicvalueofxtothebasee

log10(x) Tocomputethelogarithmicvalueofxtothebase10

rem(x,y) Tocomputetheremainderofx/y

sin(x) Tocomputethesineofx

cos(x) Tocomputethecosineofx

tan(x) Tocomputethetangentofx

AdvantagesofMATLAB

 Easy to use interface: A user-friendly interface with features you


want to use is one click away.

 A large inbuilt database of algorithms: MATLAB has numerous


important algorithms you want to use already built-in, and you just
have to call them in your code.

 Extensive data visualization and processing: We can process a


large amount of data in MATLAB and visualize them using plots and
figures.

 Debuggingof codeseasy: There are many inbuilt tools like analyser


and debugger for analysis and debugging of codes written in MATLAB.

 Easy symbolic manipulation: We can perform symbolic math


operationsinMATLABusingthesymbolicmanipulationalgorithmsand
tools in MATLAB

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

DisadvantagesofMATLAB

 MATLAB is slow since it is an interpreted language that is MATLAB


programs are not converted into Machine language but are run by
external software, so it can sometimes be slow.
 WecannotcreatetheOUTPUTfileinMATLAB.
 One cannot use graphics in MATLAB with -nojvm option, on doing so,
we will get a runtime error.
 We cannotmakefunctionsinone single .mfile aswe haveinthe case of
other programming languages. We have to create different files for
different functions.
 Sometimes, the error messages are not much informative, so you
have to figure out the error yourself.

prOCEDURETOEXECUTEMATLABPROGRAMS

Step1:DoubleClickonMATLABIcon onthe Desktop

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

MATLABWindowsis openas follows:

itContains threewindows

1. CurrentFolderWindow
2. CommandWindow
3. Work Space

Step2: Click on New button and select M-File, An Editor window will open as
follows

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Step3:TypeMATLABProgramineditor window

Step4:SavetheMATLABPrograminadesignatedfolderwith.mExtension.

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

AfterSavingMATLABProgramEditorWindowwilllookasfollows.

Step5:BySelectingEditorButtonClickonRUNButtontoExecuteMATLAB Program
Click on Change folder

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Step6: If any error is present in MATLAB Program it will be displayed in


Command window as follows. Correct the respective error.

Step7: After Correcting the error click on the RUN button again, MATLAB
program will be Executed and result will be displayed in command window and
respective result will be displayed.

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNO1
PROGRAMTOGENERATETHEFOLLOWINGDISCRETE TIME
SIGNALS.
a)UNITSAMPLESEQUENCEb)UNITSTEPSEQUENCE
c)EXPONENTIALSEQUENCEd)SINUSOIDALSEQUENCE
e)RANDOM SEQUENCE

1a)ProgramToGenerateUnitSampleSequence

Program:
clc;cleara
ll;
N=input('enterthevalueoftimeconstant');%Lengthofsequence n =
-N/2:N/2; % Define the time index range
x=(n==0);%Createtheunitsamplesequence(impulsefunction) stem(n, x,
'filled');
xlabel('n');
ylabel('x[n]');
title('UnitSampleSequence');
grid on;

Result1a:

enterthevalueoftime constant20

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

1b)ProgramToGenerateUnitStepSequence Program:
clc;cleara
ll;
N=input('enterthevalueoftimeconstant');%Lengthofsequence n =
-N/2:N/2; % Define the time index range
u=(n>=0);%Createtheunitstepsequence stem(n,
u, 'filled');
xlabel('n');
ylabel('u[n]');
title('UnitStepSequence');
grid on;

Result1b:

enterthevalueoftimeconstant20

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

1c)ProgramToGenerateExponentialSequence

Program:
clc;cleara
ll;
N=input('enterthevalueoftimeconstant');%Lengthofsequence n = 0:N-
1; % Time index ranging from 0 to N-1
A=input('enterthevalueofaAmplitude');
a=input('enterthevalueofaGrowthconstant');
b=input('enterthevalueofaDecay constant');
%Definetheexponentialfactor x =
A * a.^n; % Growing signal
y=A*-b.^n;%Decayingsignal
%Plotthegeneratedexponentialsignals figure;
subplot(2,1,1);
plot(n,x);
xlabel('Time');
ylabel('Amplitude');
title('GrowingExponentialSignal'); subplot(2,
1, 2);
plot(n,y);
xlabel('Time');
ylabel('Amplitude');
title('DecayingExponentialSignal');

Result1c:
enterthevalueoftimeconstant20 enter
the value of a Amplitude5
enterthevalueofaGrowthconstant2
enter the value of a Decay constant2

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

1d)ProgramToGenerateRandomSequence
Program:

clc;cleara
ll;
N=input('enterthevalueLengthoftherandomsequence');
x=rand(1,N);%Generatesa1xNarrayofrandomnumbersbetween
0and1
stem(x, 'filled');
title('RandomSequence');
xlabel('Index');
ylabel('x[n]');
grid on;

Result1d:

enterthevalueLengthoftherandomsequence20

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNO2
PROGRAMTOPERFORMTHEFOLLOWING
OPERATIONS ON SIGNALS.
a)SIGNALADDITIONb)SIGNALMULTIPLICATIONc)SCALINGd)SHIFTING,
e) FOLDING

2a)ProgramToPerformtheSignalAdditionoperation

Program:
clc;cleara
ll;
x =input('enter the value of first signal Sequence');
y=input('enterthevalueofSecondsignalSequence'); z=x+y;
figure;
subplot(3,1,1);
stem(x);
xlabel('Time');
ylabel('Amplitude');
title('First Signal');
subplot(3, 1, 2);
stem(y);
xlabel('Time');
ylabel('Amplitude');
title('SecondSignal');
subplot(3, 1, 3);
stem(z);
xlabel('Time');
ylabel('Amplitude');
title('AdditionofTwoSignalZ=X+Y');

Result2a:
enterthevalueoffirstsignalSequence[1234]

enterthevalueofSecondsignalSequence[1111]

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

2b)ProgramToPerformtheMultiplicationoperationon Signals

Program:
clc;cleara
ll;
T=input('enterthelengthofSequence');
t=0:0.01:T-1;
f=input('enterthevalueofFrequency');
t1=2*pi*f*t;
x1=sin(t1);
subplot(3,1,1)
stem(t,x1)
title('FirstSignalX1')
xlabel('Time');
ylabel('Amplitude')grid
on;
x2=cos(t1);
subplot(3,1,2)
stem(t,x2)
title('SecondSignalX2')
xlabel('Time');
ylabel('Amplitude')
gridon;
y=x1.*x2;%Multiplication
subplot(3,1,3)
stem(t,y)
title('MultiplicationResultSignalY=x1*x2')
xlabel('Time')
ylabel('Amplitude')
grid on;
Result2b:
enterthelengthofSequence2
enterthevalueof Frequency4

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

2c)ProgramToPerformtheScalingoperationonSignals.

Program:
clc;cleara
ll;
T=input('enterthelengthofSequence');
t=0:0.01:T-1;
f=input('enterthevalueofFrequency');
t1=2*pi*f*t;
x=sin(t1);
subplot(3,1,1)
plot(t,x)
title('OriginalSignal')
xlabel('Time')
ylabel('Amplitude')grid
on;
y=sin(t1/2);
subplot(3,1,2)
plot(t,y)
title('ExpandedSignal')
xlabel('Time')
ylabel('Amplitude')grid
on;
z=sin(t1*2);
subplot(3,1,3)
plot(t,z)
title('CompressedSignal')
xlabel('Time')
ylabel('Amplitude')
gridon;

Result2c:
enterthelengthofSequence4
enterthevalueof Frequency2

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

2d)ProgramToPerformtheShiftingoperationonSignals.

Program:
clc;cleara
ll;
N=input('EnterthelengthofSequence');
x=input('EnterthevalueofSignalSequenceofLengthN'); n1=input('Enter
the amount to be delayed');
n2=input('Entertheamounttobeadvanced');
n=0:N-1;
subplot(3,1,1);
stem(n,x);
title('Signalx(n)');
m=n+n1;
y=x;
subplot(3,1,2);
stem(m,y);
title('Delayedsignalx(n-n1)');
t=n-n2;
z=x;
subplot(3,1,3);
stem(t,z);
title('Advancedsignalx(n+n2)');

Result2d:
EnterthelengthofSequence4
EnterthevalueofSignalSequenceofLengthN[1234] Enter the
amount to be delayed2
Entertheamounttobe advanced3

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

2e)ProgramtoPerformtheFoldingoperationonSignals.

Program:
clc;cleara
ll;
N=input('EnterthelengthofSequence');
x=input('EnterthevalueofSignalSequenceofLengthN'); n=0:N-1;
subplot(2,1,1)
stem(n,x)
title('OriginalSignal')
xlabel('Time')
ylabel('Amplitude')grid
on;
y=fliplr(x);
subplot(2,1,2)
stem(n,y)
title('FoldedSignal')
xlabel('Time')
ylabel('Amplitude')
grid on;

Result2e:
EnterthelengthofSequence4
EnterthevalueofSignalSequenceofLengthN[1234]

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNO3
PROGRAMTOPERFORMCONVOLUTIONOFTWO
GIVENSEQUENCES(WITHOUTUSINGBUILT-IN
FUNCTION) AND DISPLAY THE
SIGNALS

Program:
clc;cleara
ll;
x =input('Enter the value of First Signal Sequence x[n]');
h=input('EnterthevalueofSecondSignalSequenceh[n]');
% convolution
m=length(x);
n=length(h);
X=[x,zeros(1,n)];
H=[h,zeros(1,m)];
for i=1:n+m-1
Y(i)=0;
forj=1:m
if(i-j+1>0)
Y(i)=Y(i)+X(j)*H(i-j+1);
else
end
end
end

figure;
subplot(3,1,1);
stem(x,'filled');
xlabel('n');
ylabel('x[n]');
title('FirstSignalSequencex[n]'); grid
on;

subplot(3,1,2);
stem(h,'filled');
xlabel('n');
ylabel('h[n]');
title('SecondSignalSequenceh[n]'); grid
on;

subplot(3,1,3);
stem(Y,'filled');
ylabel('Y[n]');
xlabel('n');
grid on;
title('ConvolutionofTwoSignalswithoutconvfunction');
[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Result3a:
Enter the value of First Signal Sequence x[n][1 2 3 1]
EnterthevalueofSecondSignalSequenceh[n][111]

Result3b:
Enter the value of First Signal Sequence x[n][1 1 1 1]
EnterthevalueofSecondSignalSequenceh[n][1231]

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNO4
CONSIDERACAUSALSYSTEMy(n)=0.9y(n-1)+x(n).
a) DETERMINEH(z)&SKETCHITSPOLEZEROPLOT.
b) PLOT|H(ejω)|AND∠H(ejω)
c) DETERMINETHEIMPULSERESPONSEh(n).

Program:
clc;cleara
ll;
numerator = [1]; % Numerator of H(z)
denominator=[1-0.9];%DenominatorofH(z)

%Createapole-zeroplot figure;
zplane(numerator, denominator);
title('Pole-ZeroPlotofH(z)');
omega=linspace(-pi,pi,1000);%Definefrequencyrange
H=exp(1j*omega)./(exp(1j*omega)-0.9);%CalculateH(e^j?) magnitude_H =
abs(H);% Magnitude response
phase_H=angle(H);%Phaseresponse

%PlotMagnitudeResponse figure;
plot(omega, magnitude_H);
title('|H(e^{j\omega})|');
xlabel('\omega'); ylabel('|
H(e^{j\omega})|');

%PlotPhaseResponse
figure;
plot(omega, unwrap(phase_H)); title('\
angleH(e^{j\omega})'); xlabel('\omega');
ylabel('\angleH(e^{j\omega})');

%Definetheimpulseresponse n =
0:50; % Time index
h=(0.9.^n);%Impulse response

%Plotimpulseresponse
figure;
stem(n, h, 'filled');
title('ImpulseResponseh(n)');
xlabel('n');
ylabel('h(n)');

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Result:

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNO5
COMPUTATION OF N POINT DFT OF A GIVEN
SEQUENCE (WITHOUT USING BUILT-IN FUNCTION)
AND TO PLOT THE MAGNITUDE & PHASE SPECTRUM.

Program:
clc;cleara
ll;
x=input('EnterthevalueofSignalSequencex[n]'); N =
length(x); % Length of the sequence
X=zeros(1,N);

%ComputetheN-pointDFT for k
= 0:N-1
sum=0;
forn=0:N-1
%ComputetheDFTusingtheformula
sum=sum+x(n+1)*exp(-1j*2*pi*k*n/N);
end
X(k+1)=sum;%Storetheresult
end

%Computemagnitudeandphasespectra magnitude_X
= abs(X);
phase_X=angle(X);

%Plotthemagnitudespectrum
figure;
subplot(2,1,1);
stem(0:N-1,magnitude_X,'filled');
title('Magnitude Spectrum');
xlabel('Frequency Index'); ylabel('|
X[k]|');
gridon;

%Plotthephasespectrum
subplot(2, 1, 2);
stem(0:N-1,unwrap(phase_X),'filled');
title('Phase Spectrum');
xlabel('Frequency Index'); ylabel('?
X[k]');
gridon;

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Result5a:
Enter the value of Signal Sequence x[n][1 2 3 4]
magnitude_X = 10.0000 2.8284 2.0000 2.8284
phase_X=0135.0000 -180.0000-135.0000

Result5b:
EnterthevalueofSignalSequencex[n][112233]
magnitude_X= 12.0000 3.0000 1.7321 0.0000 1.7321 3.0000
phase_X=0120.0000150.0000-90.0000-150.0000-120.0000

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNO6
USING THE DFT AND IDFT, COMPUTE THE
FOLLOWINGFORANYTWOGIVENSEQUENCES
a) CIRCULARCONVOLUTION
b) LINEARCONVOLUTION

6a)Programtocomputecircularconvolution

Program:
clc;cleara
ll;
x=input('EnterthevalueofSignalSequencex[n]');
h=input('EnterthevalueofSignalSequenceh[n]'); N =
max(length(x), length(h));
x_padded=[x,zeros(1,N-length(x))];
h_padded=[h,zeros(1,N-length(h))];
%ComputetheDFTofbothsequences
X=fft(x_padded)
H=fft(h_padded)
Y=X.*H%MultiplytheDFTs(element-wise)
y=ifft(Y);%ComputetheIDFTtogetthecircularconvolution disp('Circular
Convolution Result: y');
disp(y);

Result 6a1:
EnterthevalueofSignalSequencex[n][1234]
EnterthevalueofSignalSequenceh[n][1111]
X=10.0000+0.0000i-2.0000+2.0000i-2.0000+0.0000i-2.0000-2.0000i
H =4 0 0 0
Y= 40 0 0 0
CircularConvolutionResult:
10 10 10 10
Result 6a2:
EnterthevalueofSignalSequencex[n][2311]
EnterthevalueofSignalSequenceh[n][1353]
X=7.0000+0.0000i 1.0000-2.0000i-1.0000+0.0000i 1.0000+2.0000i
H =12 -4 0 -4
Y=84.0000+0.0000i-4.0000+8.0000i 0.0000+0.0000i-4.0000-8.0000i
CircularConvolutionResult:y
19 17 23 25

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

6b)Programtocomputelinearconvolution

Program:
clc;cleara
ll;
x=input('EnterthevalueofSignalSequencex[n]');
h=input('EnterthevalueofSignalSequenceh[n]'); Lx =
length(x);
Lh=length(h);
N=Lx+Lh-1;%Lengthofthelinearconvolutionresult x_padded =
[x, zeros(1, N - Lx)];
h_padded=[h,zeros(1,N-Lh)];
%ComputetheDFTofbothsequences
X=fft(x_padded)
H=fft(h_padded)
Y=X.*H%MultiplytheDFTs(element-wise)
y=ifft(Y);%ComputetheIDFTtogetthelinearconvolution disp('Linear
Convolution Result: y');
disp(y);

Result6b:
EnterthevalueofSignalSequencex[n][12 3 4]
EnterthevalueofSignalSequenceh[n][23 1 1]
X=
Columns1through5

10.0000+0.0000i-2.0245-6.2240i 0.3460+2.4791i 0.1784-


2.4220i 0.1784+2.4220i

Columns6through7

0.3460-2.4791i-2.0245+6.2240i H =
Columns1through5

7.0000+0.0000i 2.7470-3.7543i 1.0550-1.7091i-0.3019-


1.4947i-0.3019+1.4947i

Columns6through7

1.0550 + 1.7091i 2.7470+3.7543i Y


=
Columns1through5

70.0000+0.0000i-28.9279-9.4967i 4.6020+2.0240i-3.6741+
0.4646i-3.6741-0.4646i

Columns6through7

4.6020-2.0240i-28.9279+9.4967i

LinearConvolutionResult:y
2.0000 7.0000 13.0000 20.0000 17.0000 7.0000 4.0000

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNO7
VERIFICATIONOFLINEARITYPROPERTY,CIRCULAR TIME
SHIFT PROPERTY AND CIRCULAR FREQUENCY SHIFT
PROPERTY OF DFT.
7a)VerificationofLinearitypropertyofDFT
Linearityproperty: DFT{a.x1(n)+b.x2(n)}=a.X1(K)+b.X2(K)

Program:
clc;cleara
ll;
x1=input('EnterthevalueofSignalSequencex1[n]');
x2=input('EnterthevalueofSignalSequencex2[n]');

a=input('Enterthevalueofconstantsa');
b=input('Enterthevalueofconstantsb');

%ComputetheDFTsofx1andx2 X1 =
fft(x1);
X2= fft(x2);

%Computethelinearcombinationofx1andx2
x_combined = a * x1 + b * x2;

%ComputetheDFTofthelinearcombination
X_combined = fft(x_combined);

%ComputethelinearcombinationoftheDFTs
X_combined_direct = a * X1 + b * X2;

%Displayresults
disp('DFTofLinearCombination:');
disp(X_combined);

disp('LinearCombinationofDFTs:');
disp(X_combined_direct);

%Verifyiftheyareapproximatelyequal
ifisequal(round(X_combined,10),round(X_combined_direct, 10))
disp('Linearitypropertyisverified:DFT(a*x1[n]+b*x2[n]) equals
a*X1[k] + b*X2[k].');
else
disp('Linearitypropertyisnotverified.');
end
[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Result 7a1:

EnterthevalueofSignalSequencex1[n][1234]
EnterthevalueofSignalSequencex2[n][2311] Enter
the value of constants a 2
Enterthevalueofconstantsb3
DFT of Linear Combination:
41.0000+0.0000i-1.0000 -2.0000i-7.0000+0.0000i-1.0000+2.0000i

LinearCombinationofDFTs:
41.0000+0.0000i-1.0000 -2.0000i-7.0000+0.0000i-1.0000+2.0000i

Linearitypropertyisverified:DFT(a*x1[n]+b*x2[n])equalsa*X1[k]+b*X2[k].

Result 7a2:

EnterthevalueofSignalSequencex1[n][1234]
EnterthevalueofSignalSequencex2[n][1111] Enter
the value of constants a 5
Enterthevalueofconstantsb10
DFT of Linear Combination:
90.0000+0.0000i-10.0000+10.0000i-10.0000+0.0000i-10.0000-10.0000i

LinearCombinationofDFTs:
90.0000+0.0000i-10.0000+10.0000i-10.0000+0.0000i-10.0000-10.0000i

Linearitypropertyisverified:DFT(a*x1[n]+b*x2[n])equalsa*X1[k]+b*X2[k].

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

7b) Verification of circular time shift property of DFT


Circulartimeshiftpropertyifx(n)⟷X(K)thenDFT[x(n-m)]=e-j2ϖkm/NX(K)

Program:
clc;cleara
ll;
N=input('EntertheLengthofthesignal'); x=
input('Enter the input sequence=');
m=input('EntertheNumberofcircularshifts=');
X=fft(x);%ComputeDFToftheoriginalsignal
x_shifted=circshift(x,m);%Circularlyshiftthesignalbym X_shifted =
fft(x_shifted)% Compute DFT of the shifted signal

%Computetheexpectedphase-shiftedDFT k =
0:N-1; % Frequency indices
expected_X_shifted=X.*exp(-1j*2*pi*k*m/N)

subplot(2,1,1);
stem(0:N-1, abs(X_shifted), 'filled');
title('MagnitudeofDFTofShiftedSignal');
xlabel('Frequency Index');
ylabel('Magnitude');

subplot(2,1,2);
stem(0:N-1, abs(expected_X_shifted), 'filled');
title('MagnitudeofExpectedPhase-shiftedDFT');
xlabel('Frequency Index');
ylabel('Magnitude');

Result7b1:
Enter the Length of the signal4
Entertheinputsequence=[1234]
EntertheNumberofcircularshifts=2
X_shifted =
10.0000+0.0000i 2.0000-2.0000i-2.0000+0.0000i 2.0000+2.0000i

expected_X_shifted=
10.0000+0.0000i 2.0000-2.0000i-2.0000 -0.0000i 2.0000+2.0000i

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Result7b2:
Enter the Length of the signal4
Entertheinputsequence=[5673]
EntertheNumberofcircularshifts=3
X_shifted =
21.0000+0.0000i 3.0000-2.0000i-3.0000+0.0000i 3.0000+2.0000i
expected_X_shifted=
21.0000+0.0000i 3.0000-2.0000i-3.0000 -0.0000i 3.0000+2.0000i

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

7c)Verificationofcircularfrequencyshiftpropertyof DFT
Circularfrequencyshiftpropertyifx(n)⟷X(K)then x(n)e-j2ϖkl/N=X((K-l))N

Program:
clc;cleara
ll;
N=input('EntertheLengthofthesignal'); x=
input('Enter the input sequence=');
l=input('EntertheNumberofcircularshifts=');
X=fft(x);%ComputeDFToftheoriginalsignal

%Frequencyshiftmultiplier n
= 0:N-1;
e_jw=exp(1j*2*pi*l*n/N);%Complexexponential x_shifted =
x .* e_jw;% Modified signal
X_shifted=fft(x_shifted)%ComputeDFTofthemodifiedsignal

expected_X_shifted=circshift(X,-l)%Circularfrequency-shifted DFT

subplot(2,1,1);
stem(0:N-1, abs(X_shifted), 'filled');
title('MagnitudeofDFTofFrequency-shiftedSignal');
xlabel('Frequency Index');
ylabel('Magnitude');

subplot(2,1,2);
stem(0:N-1, abs(expected_X_shifted), 'filled');
title('MagnitudeofCircularfrequency-shiftedDFT');
xlabel('Frequency Index');
ylabel('Magnitude');

Result7c1:
Enter the Length of the signal4
Entertheinputsequence=[1234]
EntertheNumberofcircularshifts=2

X_shifted =

-2.0000+0.0000i-2.0000-2.0000i10.0000-0.0000i-2.0000+2.0000i

expected_X_shifted=

-2.0000+0.0000i-2.0000 -2.0000i10.0000+0.0000i-2.0000+2.0000i

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Result7c1:
Enter the Length of the signal4
Entertheinputsequence=[5623]
EntertheNumberofcircularshifts=3
X_shifted =
3.0000-3.0000i-2.0000+0.0000i 3.0000+3.0000i16.0000-0.0000i
expected_X_shifted=
3.0000+3.0000i16.0000+0.0000i 3.0000-3.0000i-2.0000+0.0000i

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNO8
DEVELOP DECIMATION IN TIME RADIX-2 FFT
ALGORITHMWITHOUTUSINGBUILT-INFUNCTIONS

Program:
clc;cleara
ll;
x=input('Entertheinputsequence='); N =
length(x);

%Bit-reversalpermutation
num_bits = log2(N);
reversed_indices=bit_reverse(0:N-1,num_bits); x
= x(reversed_indices + 1);

%FFT computation
%InitiallengthoftheFFT
current_len = 2;

whilecurrent_len<=N
half_len=current_len/2;
twiddle_factor=exp(-2i*pi*(0:half_len-1)/current_len);

fork=1:current_len:N
even=x(k:k+half_len-1);
odd=x(k+half_len:k+current_len-1);

x(k:k+current_len-1)=[even+twiddle_factor.*odd,even
-twiddle_factor.*odd]; end

current_len=current_len*2;
end

% Display the result


disp('FFToftheinput:');
disp(x);

%Bitreversalfunction
functionreversed_indices=bit_reverse(indices,num_bits)
% Reverse the bits of the indices
reversed_indices=zeros(size(indices));
for k = 1:length(indices)
bin_str = dec2bin(indices(k), num_bits);
reversed_bin_str = bin_str(end:-1:1);
reversed_indices(k)=bin2dec(reversed_bin_str);
end
end

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Result8a:
Entertheinputsequence=[12345678] FFT of
the input:
Columns1 through5

36.0000+0.0000i-4.0000+9.6569i-4.0000+4.0000i-4.0000+
1.6569i-4.0000+0.0000i

Columns6 through8

-4.0000-1.6569i-4.0000-4.0000i-4.0000-9.6569i

Result8b:
Entertheinputsequence=[1100 -1-100] FFT of
the input:
Columns1 through5

0.0000+0.0000i 3.4142- 1.4142i 0.0000+0.0000i 0.5858- 1.4142i


0.0000+0.0000i

Columns6 through8

0.5858+1.4142i 0.0000+0.0000i 3.4142+1.4142i

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNO9
DESIGN AND IMPLEMENTATION OF DIGITAL LOW
PASSFIRFILTERUSINGAWINDOWTOMEETTHE
GIVEN SPECIFICATIONS

SummaryofParametersforCommonWindows:

Program:
clc;cleara
ll;
closeall;
fs=input('EntertheValueofSamplingfrequency(fs)inHz='); fc=
input('Enter the Value of Cutoff frequency (fc)in Hz=');
N=input('EntertheOrder(ODDOrder)')
wc=fc/(fs/2);
h=fir1(N,wc,'low',hamming(N+1));
freqz(h,1,1024,fs)

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Result9a:
EntertheValueofSamplingfrequency(fs)inHz=8000
Enter the Value of Cutoff frequency (fc)in Hz=2000
Enter the Order (ODD Order)30

Result9a:
EntertheValueofSamplingfrequency(fs)inHz=2000
Enter the Value of Cutoff frequency (fc)in Hz=500
Enter the Order (ODD Order)20

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNO10
DESIGNANDIMPLEMENTATIONOFDIGITALHIGH PASS
FIR FILTER USING A WINDOW TO MEET THE GIVEN
SPECIFICATIONS

Program:
clc;cleara
ll;
closeall;
fs=input('EntertheValueofSamplingfrequency(fs)inHz='); fc=
input('Enter the Value of Cutoff frequency (fc)in Hz=');
N=input('EntertheOrder(ODDOrder)');
wc=fc/(fs/2);
h=fir1(N,wc,'high',hamming(N+1));
freqz(h,1,1024,fs)

Result 10a:
EntertheValueofSamplingfrequency(fs)inHz=8000
Enter the Value of Cutoff frequency (fc)in Hz=2000
Enter the Order (ODD Order)30

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Result10b:
EntertheValueofSamplingfrequency(fs)inHz=2000
Enter the Value of Cutoff frequency (fc)in Hz=500
Enter the Order (ODD Order)20

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNO11
DESIGNANDIMPLEMENTATIONOFDIGITALIIR
BUTTERWORTH LOW PASS FILTER TO MEET THE
GIVEN SPECIFICATIONS.
Program:
clc;
clearall
fs=input('EntertheValueofSamplingfrequency(fs)inHz=');
kp=input('Enter the Value of Pass band Attenuation in dB=');
ks=input('Enter the Value of Stop band Attenuation in dB=');
fp=input('Enter the Value of Pass band Frequency in Hz=');
fstop=input('Enter the Value of Stop band Frequency in Hz=');
wp=fp/(fs/2);
wstop=fstop/(fs/2);
[N,wc]=buttord(wp,wstop,kp,ks)
[b, a]=butter(N,wc,'low')
freqz(b,a,1000,fs)

Result 11a:
EntertheValueofSamplingfrequency(fs)inHz=1000
Enter the Value of Pass band Attenuation in dB=3
Enter the Value of Stop band Attenuation in dB=60
Enter the Value of Pass band Frequency in Hz=40
Enter the Value of Stop band Frequency in Hz=150
N =5
wc=0.0810
b=1.0e-03*0.0227 0.1136 0.2272 0.2272 0.1136 0.0227
a =1.0000 -4.1768 7.0358 -5.9686 2.5478 -0.4375

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Result11b:
EntertheValueofSamplingfrequency(fs)inHz=5000
Enter the Value of Pass band Attenuation in dB=7
Enter the Value of Stop band Attenuation in dB=70
Enter the Value of Pass band Frequency in Hz=50
Enter the Value of Stop band Frequency in Hz=500
N= 4
wc =0.0276
b=1.0e-04 *0.0315 0.1259 0.1888 0.1259 0.0315
a =1.0000 -3.7737 5.3464 -3.3701 0.7974

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNO12
DESIGN AND IMPLEMENTATION OF DIGITAL IIR
BUTTERWORTHHIGHPASSFILTERTOMEETTHE
GIVEN SPECIFICATIONS.
Program:
clc;
clearall
fs=input('EntertheValueofSamplingfrequency(fs)inHz=');
kp=input('Enter the Value of Pass band Attenuation in dB=');
ks=input('Enter the Value of Stop band Attenuation in dB=');
fp=input('Enter the Value of Pass band Frequency in Hz=');
fstop=input('Enter the Value of Stop band Frequency in Hz=');
wp=fp/(fs/2);
wstop=fstop/(fs/2);
[N,wc]=buttord(wp,wstop,kp,ks)
[b, a]=butter(N,wc,'high')
freqz(b,a,1000,fs)

Result 12a:
EntertheValueofSamplingfrequency(fs)inHz=1000
Enter the Value of Pass band Attenuation in dB=3
Enter the Value of Stop band Attenuation in dB=60
Enter the Value of Pass band Frequency in Hz=40
Enter the Value of Stop band Frequency in Hz=150
N =5
wc =0.0810
b=0.6615 -3.3073 6.6145 -6.6145 3.3073 -0.6615
a =1.0000 -4.1768 7.0358 -5.9686 2.5478 -0.4375

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

Result 12a:
EntertheValueofSamplingfrequency(fs)inHz=5000
Enter the Value of Pass band Attenuation in dB=7
Enter the Value of Stop band Attenuation in dB=70
Enter the Value of Pass band Frequency in Hz=50
Enter the Value of Stop band Frequency in Hz=500
N=4
wc =0.0276
b=0.8930 -3.5719 5.3579 -3.5719 0.8930
a =1.0000 -3.7737 5.3464 -3.3701 0.7974

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

BeyondSyllabusExperiments

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNOA
COMPUTEAUTOCORRELATIONANDCROSS
CORRELATION OF SEQUENCES
Program:
clc;
clearall
x =input('Enter the Value of First sequence=');
y=input('EntertheValueofSecondsequence=');

[r,lags]=xcorr(x,'coeff');%Computeautocorrelation figure;
stem(lags, r);
title('Autocorrelationofx');
xlabel('Lag');
ylabel('Autocorrelation');
[r,lags]=xcorr(x,y,'coeff');%Computecross-correlation figure;
stem(lags,r);
title('Cross-Correlationbetweenxandy'); xlabel('Lag');
ylabel('Cross-Correlation');

ResultA:
EntertheValueofFirstsequence=[1234]
EntertheValueofSecondsequence=[5623]

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNOB
IMPULSERESPONSEOFFIRSTANDSECONDORDER
SYSTEMS
Program:
clc;closea
ll;
clearall;
n=0:10;
%impulseresponseoffirstordersystem b=[2
0 0];
a=[1-0.90];
y=dimpulse(b,a,length(n));
subplot(2,1,1);
stem(n,y);
xlabel('n--->'); ylabel('amplitude');
title('impulseresponseoffirstordersystem'); b=[1 0 0];
a=[10.60.8];
y1=dimpulse(b,a,length(n)); subplot(2,1,2);
stem(n,y1); xlabel('n>');
ylabel('amplitude');
title('impulseresponseofsecondordersystem');

ResultB:

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNOC
PROGRAMTOPROVETHEPARSEVALSTHEOREM

Parseval’stheoremcanbeexpressedas

Fordiscrete-timesignals,the theoremcanbewrittenas:

Program:
clc;cleara
ll;
closeall;
x1=input('enterthe1stinputseq=')
x2=input('enterthe2ndinputseq=')
N=4;
X1=fft(x1,N)
X2=fft(x2,N)
y1=sum(x1.*conj(x2))
y2=sum(X1.*conj(X2))./N
ify1==y2
disp('parsevalstheoremproved'); else
disp('parsevalstheoremnotproved') end

ResultC:
enterthe1stinputseq=[1234]
x1 =1 2 3 4
enterthe2ndinputseq=[5623]
x2 =5 6 2 3
X1 =
10.0000+0.0000i-2.0000+2.0000i-2.0000+0.0000i-2.0000-2.0000i X2 =
16.0000+0.0000i 3.0000-3.0000i-2.0000+0.0000i 3.0000+3.0000i
y1 =
35
y2 =
35

Parseval’stheorem proved

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNOD
COMPUTATIONOFNPOINTDFTOFAGIVEN SEQUENCE
BY USING BUILT-IN FUNCTION
ANDTOPLOTTHEMAGNITUDE&PHASESPECTRUM.

Program:
clc;cleara
ll;
closeall;
N=input('enterthevalueofN=');
n=0:1:(N-1);
x=input('entertheinputsignal,x(n)=');
X=fft(x,N)
mag=abs(X)
phase=angle(X)
subplot(3,1,1),stem(n,x);
xlabel('Time (s)');
ylabel('Amplitude');
title('Timedomain-Inputsequence');
subplot(3,1,2);
stem(n,mag)
xlabel('Frequency'); ylabel('|
X(k)|');
title('Frequencydomain-Magnituderesponse'); subplot(3,1,3);
stem(n,unwrap(phase));
ylabel('phase(X(k))');
title('Frequencydomain-phaseresponse');

ResultD1:

enterthevalueofN=4
entertheinputsignal,x(n)=[1234] X =

10.0000+0.0000i-2.0000+2.0000i-2.0000+0.0000i-2.0000-2.0000i

mag=

10.0000 2.8284 2.0000 2.8284

phase=

0 2.3562 3.1416 -2.3562

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

ResultD2:
enterthevalueofN=6
entertheinputsignal,x(n)= [112233]
X=12.0000+0.0000i-1.5000+2.5981i-1.5000+0.8660i 0.0000
+ 0.0000i-1.5000 - 0.8660i -1.5000 - 2.5981i
mag=
12.0000 3.0000 1.7321 0 1.7321 3.0000
phase=
0 2.0944 2.6180 0 -2.6180 -2.0944

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

EXPERIMENTNOE
PROGRAM TO PERFORM CONVOLUTION OF TWO
GIVENSEQUENCESBYUSINGBUILT-INFUNCTION
AND DISPLAY THE SIGNALS.
Program:
clc;cleara
ll;
x =input('Enter the value of First Signal Sequence x[n]');
h=input('EnterthevalueofSecondSignalSequenceh[n]'); y =
conv(x, h);% convolution
figure;
subplot(3,1,1);
stem(x,'filled');
xlabel('n');
ylabel('x[n]');
title('FirstSignalSequencex[n]'); grid
on;
subplot(3,1,2);
stem(h,'filled');
xlabel('n');
ylabel('h[n]');
title('SecondSignalSequenceh[n]'); grid
on;
subplot(3,1,3);
stem(y,'filled');
ylabel('Y[n]');
xlabel('n');
grid on;
title('ConvolutionofTwoSignalswithoutconvfunction');

ResultE1:
Enter the value of First Signal Sequence x[n][1 1 1 1]
EnterthevalueofSecondSignalSequenceh[n][1234]

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

ResultE2:
Enter the value of First Signal Sequence x[n][1 2 3 1]
EnterthevalueofSecondSignalSequenceh[n][111]

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

VIVAQUESTIONS

1. Definesignal,GiveExamplesfor 1-D,2-D,3-Dsignals.
2. Definetransform.Whatis theneedfortransform?
3. DifferentiateFouriertransformanddiscreteFouriertransform.
4. DifferentiateDFTandDTFT
5. ExplainmathematicalformulaforcalculationofDFT.
6. ExplainmathematicalformulaforcalculationofIDFT.
7. HowtocalculateFTfor1-D signal?
8. Whatis meantbymagnitudeplot,phaseplot,power spectrum?
9. ExplaintheapplicationsofDFT.
10. Whatareseparabletransforms?
11. Explainthesignificanceof convolution.
12. Definelinear convolution.
13. Whylinear convolutioniscalledasaperiodicconvolution?
14. Whyzeropaddingisusedinlinear convolution?
15. Whatarethefourstepstofindlinearconvolution?
16. Whatis thelengthoftheresultantsequenceinlinearconvolution?
17. HowlinearconvolutionwillbeusedincalculationofLTIsystem response?
18. ListfewapplicationsoflinearconvolutioninLTIsystem design.
19. Givethepropertiesoflinear convolution.
20. Howthelinearconvolutionwillbeused tocalculatetheDFTofa signal?
21. Definetransform.Whatistheneedfortransform?
22. DifferentiateFouriertransformanddiscreteFouriertransform.
23. DifferentiateDFTandDTFT.
24. WhataretheadvantagesofFFTover DFT?
25. DifferentiateDITFFTandDIFFFT algorithms.
26. Whatis meantby radix?
27. Whatis meantbytwiddlefactorandgiveits properties?
28. HowFFTisusefultorepresenta signal?
29. CompareFFTandDFTwithrespecttonumberofcalculations required?
30. Howtheoriginalsignalis reconstructedfromtheFFTofasignal?
31. Definefilter.
32. Whatarethedifferenttypesof filters?
33. WhyareFIRfiltersgenerallypreferredoverIIRfiltersinmultirate
(decimating and interpolating) systems/
34. DifferencebetweenIIRandFIRfilters?
35. Differentiateidealfilterandpracticalfilterresponses.
36. Whatisthefilterspecificationsrequiredtodesigntheanalogfilters?
37. Whatismeantbyfrequencyresponseof filter?
38. Whatismeantbymagnitude response?
39. Whatismeantbyphase response?

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

40. DifferencebetweenFIRlowpassfilterandhighpass filter


41. Listsomeadvantagesofdigitalfiltersoveranalogfilters.
42. WritesomedifferencesbetweenFIRandIIR filters.
43. WhatarethedifferentmethodstodesignIIRfilters?
44. WhyIIRfiltersare not reliable?
45. WhataredifferentapplicationsofIIRfilters?
46. WhatareadvantagesofIIRfilters?
47. WhataredisadvantagesofIIRfilters?
48. DifferentiateButterworthandChebyshevapproximations.
49. Whatismeantbyimpulse response?
50. DifferencebetweenIIRlowpassandHighpass filters
51. Whatissampling theorem?
52. Whatdoyou meanbyprocessof reconstruction.
53. Whataretechniquesofreconstructions.
54. WhatdoyoumeanAliasing?Whatistheconditiontoavoidaliasingfor
sampling?
55. Writetheconditionsof sampling.
56. Howmanytypesofsamplingthere?
57. Explainthestatement-t=0:0.000005:0.058.Intheaboveexamplewhat does
colon (: ) and semicolon (; ) denotes.
58. Whatisa)Undersamplingb)nyquistplotc) Oversampling.
59. WritetheMATLABprogramfor Oversampling.
60. Whatis theuseofcommand ‘legend’?
61. Writethedifferencebetweenbuiltinfunction,plotandstemdescribethe
function.
62. Whatis thefunctionofbuiltinfunctionand subplot?
63. Whatis linearconvolution?
64. Explainhowconvolutionsyntaxbuiltin function works.
65. Howtocalculatethebeginningandendofthesequenceforthetwosided
controlled output?
66. Whatis thetotaloutputlengthoflinear convolutionsum.
67. WhatisanLTIsystem?Describeimpulseresponseofafunction.20.Whatis the
difference between convolution and filter?
68. Howtocalculateoutputlengthofthelinearandcircularconvolution
69. Whatiswindowmethod?HowyouwilldesignanFIRfilterusingwindow
method.
70. Whatdoyou meanbycut-offfrequency?

[Type text]
DigitalSignalProcessingLab(IPCC) BEC502

[Type text]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy