Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
24 views
DSP Lab File
DSP LAB FILE
Uploaded by
mdshahnawaz1639
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save DSP Lab File For Later
Download
Save
Save DSP Lab File For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
24 views
DSP Lab File
DSP LAB FILE
Uploaded by
mdshahnawaz1639
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save DSP Lab File For Later
Carousel Previous
Carousel Next
Save
Save DSP Lab File For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 14
Search
Fullscreen
digital Signal Processing Lab Name: Khushi Ranj Trade: GEC-29 Registration No.: 2130573 Institute: Sant Longowal Institute of Engineering and Technology Teacher In-char; “Alka Singla INDEX SL] Name of the Document [Page [Date of | Date of, | No no. | exp. | ale a [3-s UJor hs ENS > Ht ]e9 25) (1. | Introduction to MATLAB . | Generation of Discrete Time Signal \ "3 | Shifting of Signals po 19 )03/x3 | \ + | Verification of Sampling Theorem both ] in time and frequency domains, 5S. | Linear Convolution of two given sequences 6. Circular Convolution of two given __Sequences using summation formula Linear convolution from circular ‘convolution with zero padding —__ a 8. Linear and Circular Convolution by DFT land IDFT method ___ fee; [Po-?*Exp No. D0! Signa! Processing tb . ate POPC TS es To implement LP FIR filter for a given sequence |? a2 oF g Wt Ee —_[To implement HP FIR filter fora given sequence |r-34 Zo. M2 7 uy LC LE 1.Introduction to MATLAB AIM: To get familiarise with basic elements of MATLAB, MATLAB windows and general commands APPARATUS REQUIRED: Software used: Matlab Online THEORY: MATLAB stands for Matrin Laboratory is fourth generation high level programming language and interactive environment for numerical computation, visualization and programming. Desktop-basics: Desktop includes these panels: ~ Current Folder: for accessing file. ~ Command Window: Enter commands at the command line, indicated by the prompt. &) Workspace: Explore data that you create import files. As you work in MATLAB, you issue commands that create variable and call functions. For eg.- Create a variable named by typing this statement ast Matlab adds variable ‘a’ to the workspace and displays the result in the command 2" Exp No. Date:emo. Digital Signal Processing Lob . ote: PCEC-713 Example Cod clear all X= input("Enter these numbers"); SE((1)> x(3) && x(1) > X(2)) {printf ("%d is the largest number", x(1)) else if x (2) > x(3) && x(2) > x(1) fprintf ("9d is the largest number", x(2)) else fprinti("96d is the largest number", x(3)) end , Input: Enter there numbers. 123 Output: 3 is the largest number ‘Types of Files: There are of files in MATLAB three different types (2) M.files (2) MAT. Files (3) MEX. files Milles: These are standard ASCII text files with a (.m) extension to the file name. Any Program written ina MATLAB editor is saved as mJfiles, Manfiles: It provides access to any data you saved. Opening the file starts the import wizard to load the data into the matlab workspace, mexcfiles: It controls compiled executable code that exten some manner. ids MATLAB functionality in You execute these files just as you would write script program. The original code is written in either FORTRAM or C++ and compiled for a specific platform, MATLAB commands: MATLAB commands for managing a session, Variable: You can create new variable in the works pace by running MATLAB Code or RARE enter existing variables. To create new variable enter the variable name in the Command window, followed by an equal sign (=) and the value you want to assign to the variable. Ex: >>> ast peB osotot sional Processing tab : PCEC-713 ‘Command Purpose la —~*+| clears command window exist check for existence of variables global declare variable to the global Took for ‘Search for a Key word quit ‘stops MATLAB, PRECAUTIONS: 1. fix problems in code 2. View code analyzer messages 3. Check code for errors and warnings using the code analogy. 4. Enable continuous code checking RESULT: We have got familiar with the basic elements of MATLAB, Exp Mo. Date:AIM: Digital Signal Processing Lab : Exp No, PCEC TIS Date: 2.Generation of Discrete Time Signal ~ ‘To generate a discrete time signal sequence (Impulse, Unit Step, Ramp, Exponential, Sine, Cosine, Rising and decaying exponential) using MATLAB function APPARATUS REQUIRED: © Software- MATLAB THEORY: In signal processing experiments, we need the help of some fundamental signals such as impulse, unit step, ramp wave, exponential wave, sine wave, cosine wave, etc. A digital signal can be either a deterministic signal that can be predicted with certainity, or a random signal that is unpredictable. Due to ease in signal generation and need for predictability, deterministic signal can be used for system simulation studies. Standard forms of some deterministic signals that are frequently used in DSP are discussed below: . Impulse: The simplest signal is the unit impulse signal which is defined as, 6(n)=1forn=0 =Ofornz0 . Step: The general form of step function is, u(n} fornz0 =O forn<0 |. Ramp: This signal is given by, r(n)=nfornz0 =Oforn<0 . Exponential: The decaying exponential is a basic signal in DSP whose general formis, x(n) =anforalln. . Sine: A sinusoidal sequence is defined as, x(n) = sin(n) . Cosine: A cosine sequence is defined as, x(n) = cos(a) . Rising exponential: A rising exponential is given by, . . .© Digital Signol Processing Lob, : Exp Na, Digito! Signo! Processing Lob, fp h PCEC-713 8. Decaying exponenti; A decaying exponential is given by, PROCEDURE: 1. Start the MATLAB program. 2. Open new M-file 3. Typethe program 4, Save in current directory S. Compile and Run the program 6. Ifany error occurs in the program correct the error and run it again 7 8. . For the output see command window\ Figure window Stop the program. . PROGRAM & OUTPUT: delta =(n ‘stem(n, delta); title(Impulse Signal’); xlabel(‘n’); ylabel(‘Amplitude’); Unit Step Signal: = -10:10; u=(n>=0); stem(n, u); tide(Unit Step Signal’); xlabel(n); ylabel( Amplitude’);Degital Signal Processing Lab, PCECT13 . fap to. ote: Ramp Signal: n=-10:10; rent (n>=0): stem(n.r): title(‘Ramp Signal’); sdabel('n}; ylabel( Amplitude’); Exponential Signal: n=-10:10; alpha = 05: x=alpha*n: stem(n. x}: utle( Exponential Signal’): xtabel('n'): ylabel( Amplitude’); ‘Sine Signal n= 0:01:10; fel xesin(2pta): plor{n, x): dithe(Sine Signal}; {LeDPBS Spe Marreny Lod - ae Ntabel( Time’) vladei(Amplirade’}; Cosine Signal (Similar to the sine signal): R= OML10: fei; | xe cos(? pitta): Plog{a x): te(Casine Signal): i wiabel( Time): siabel[ Amplitude): Decaying Exponential Signal (Sisnilar to the exponential signal): neeaiie aipha = OS: a ep(aipha* a}Digital Signa! Processing tab . Exp No... Pac TA3 Date: plor(n, x): tide(Decaying Exponential Signal’ xtabel( Time’); ylabel Amplitude’); RESULT: Thus the MATLAB programs for functional sequence of a signal (Impulse, Unit Step, Ramp, Exponential, Sine, Cosine. Rising and Decaying exponential) using MATLAB fonction written and the results were plotted \Digitol Signal Processing Lob. : Expo. . PCEC-713 Date: 3, Shifting of Signals AIM: Write a program in MATLAB to generate and plot the sequences: (shifted signals) over the indicated interval. APPARATUS REQUIRED: Software: MATLAB . THEORY: Shifting signals in MATLAB typically involves changing the time or frequency axis of a signal to create a new version of the signal that is shifted in time or frequency. This can bbe useful in various signal processing and communication applications. ‘Time shifting involves moving a signal along the time axis. Suppose you have a signal x(t), and you want to create a shifted version of x.shifted(t), delayed by a certain amount of tine T seconds. The basic theory Involves applying a time shift operation as follows: xshifted(t) = x{t-T) Sequences given are: 1 x(n)=25(n¢2)- 6(n-4), -5
=n0) 3 SU end Problem1 Code: MATLAB Dawelprotiern | m ~ _ ee 1 } Xproblemi:2*impulse(n42)-impulse(n-4) 2 q Kusing impulse function 3 4 Ly1,n1}=impseq(-2,-5,5)5 s [y2,n2]}=impseq(4,-5,5)5 6 ye2*yl-y2; 7 | neni; & sten(n,y, filled’, black’); 3 | xlabel(‘n*);] 18 ylabel(*x(n)")5 wn title("1. output’); 12 grid on; 13 | print("-clipboard" ,*-dmeta’) i i. Digital Signal Processing Lob, . fp Wo PEC TY bate Problem? Code: MATLAD Deweppnatiern? m [I Xprobhem2:x(ny=n(u(n)-u(n-10)) +10%exp(-0.3(-10))" (uln-A8) ule 2)) 2 2b ausing untt step function 3 | nto; 4 | n2e20; 5 nemdinds 6 | xden. *(unttstepfun(O,nt,n2)-unitstapfun(1a,ni402))5 7 | xze20%exp(-0..3*(n-10)) 4 s | xSeunit stepfun(10,n1,n2) -unitatepfun(20,n1,n2)5 ° yenten2 x33 10 | stem(nsy, Filled, “black"): 21 | xlabel(*n* a2 | ylabel(‘x(n)"), a | title("2. output 24 | grid on; 35 | print (clipboard *-daeta") Problem 3 Code: BETAS Oweprstiend m : i Zx(n)ecos(0.O4nn)10.2u(n), O¢ence50 where w(n) 15 @ Gaussian Random 2 Xsequence with zero mean end unit variance 3 | 5 | itn) 40, 2*randn(size(m)); 6 7 | title( “Sequence tn Problem 3° 2 xlabel ('n"); 9 | ylabel (x(n) D5No. “_pigital Signal Processing lab. . nae Date: PCEC-713 Sequence In Problem 3 RESULT: ‘The sequences over the indicated interval are shifted and plotted. va
You might also like
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Mark Manson
4/5 (6125)
Principles: Life and Work
From Everand
Principles: Life and Work
Ray Dalio
4/5 (627)
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Brené Brown
4/5 (1148)
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
Chris Voss
4.5/5 (932)
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Jeannette Walls
4/5 (8214)
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Angela Duckworth
4/5 (631)
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
Jesmyn Ward
4/5 (1253)
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Stephen Chbosky
4/5 (8365)
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Phil Knight
4.5/5 (860)
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
Carmen Maria Machado
4/5 (877)
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Margot Lee Shetterly
4/5 (954)
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Ben Horowitz
4.5/5 (361)
Steve Jobs
From Everand
Steve Jobs
Walter Isaacson
4/5 (2922)
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
Ashlee Vance
4.5/5 (484)
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
Siddhartha Mukherjee
4.5/5 (277)
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Fredrik Backman
4.5/5 (4972)
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
Colm Toibin
3.5/5 (2061)
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Frank McCourt
4.5/5 (444)
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
Garth Stein
4/5 (4281)
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
Sarah M. Broom
4/5 (100)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
Meik Wiking
3.5/5 (447)
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Thomas L. Friedman
3.5/5 (2283)
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
Roxane Gay
4/5 (1068)
Yes Please
From Everand
Yes Please
Amy Poehler
4/5 (1987)
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
Gilbert King
4.5/5 (278)
The Outsider: A Novel
From Everand
The Outsider: A Novel
Stephen King
4/5 (1993)
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
Ruth Ware
3.5/5 (2619)
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
Betty Smith
4.5/5 (1936)
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
Viet Thanh Nguyen
4.5/5 (125)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Dave Eggers
3.5/5 (692)
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Doris Kearns Goodwin
4.5/5 (1912)
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
Hilary Mantel
4/5 (4074)
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Naomi Klein
4/5 (75)
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Bob Woodward
3.5/5 (830)
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Jay Sekulow
3.5/5 (143)
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
Jennifer Egan
3.5/5 (901)
John Adams
From Everand
John Adams
David McCullough
4.5/5 (2530)
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
M L Stedman
4.5/5 (790)
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
George Packer
4/5 (45)
Little Women
From Everand
Little Women
Louisa May Alcott
4/5 (105)
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel
John le Carré
3.5/5 (109)
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Principles: Life and Work
From Everand
Principles: Life and Work
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Steve Jobs
From Everand
Steve Jobs
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
Yes Please
From Everand
Yes Please
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
The Outsider: A Novel
From Everand
The Outsider: A Novel
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
John Adams
From Everand
John Adams
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
Little Women
From Everand
Little Women
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel