Digital Signal Processing Laboratory (DSP Lab)
Transcript of Digital Signal Processing Laboratory (DSP Lab)
![Page 1: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/1.jpg)
Digital Signal Processing Laboratory (DSP Lab)
Dr. Roozbeh Rajabi
Spring 2018
![Page 2: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/2.jpg)
Reference
• Vinay K. Ingle, John G. Proakis, “Digital Signal Processing UsingMATLAB”, Third Edition, Cengage Learning, 2011
![Page 3: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/3.jpg)
Contents• 1. Introduction
• 2. Discrete-time signals and systems
• 3. The discrete-time fourier analysis
• 4. The z-transform
• 5. The discrete fourier transform
• 6. Implementation of discrete-time filters
• 7. FIR Filter Design
• 8. IIR Filter Design
• 9. Sampling Rate Conversion
• 10. Round-off Effects in Digital Filters
• 11. Applications in Adaptive Filtering
• 12. Applications in Communications
![Page 4: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/4.jpg)
Software
• MATLAB R2017b
• Code Composer Studio
![Page 5: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/5.jpg)
1. Introduction
• How are signals processed?
![Page 6: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/6.jpg)
1. Introduction
• Two important categories of DSP
![Page 7: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/7.jpg)
1. Introduction
• A Brief Introduction to MATLAB
![Page 8: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/8.jpg)
1. Introduction
• Example 1.1.
• 0:0.01:1
• Three Approaches.
![Page 9: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/9.jpg)
1. Introduction
• Scripts and Functions
• Write a script file to implement:
• Functions:
• Write a function
• Name: sinsum
• Inputs: t, ck
• Output: xt
![Page 10: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/10.jpg)
1. Introduction
• Plotting:• Plot sin(2*pi*t)
• Stem plot
• TeX Markup: \pi
• Set properties using handle
• Subplot
![Page 11: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/11.jpg)
1.3 Applications of DSP
• speech/audio (speech recognition/synthesis, digital audio, equalization,etc.),
• image/video (enhancement, coding for storage and transmission, roboticvision, animation, etc.),
• military/space (radar processing, secure communication, missile guidance,sonar processing, etc.),
• biomedical/health care (scanners, ECG analysis, X-ray analysis, EEG brainmappers, etc.)
• consumer electronics (cellular/mobile phones, digital television, digitalcamera, Internet voice/music/video, interactive entertainment systems, etc)and many more
![Page 12: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/12.jpg)
Musical Sound Processing
• a short snippet of
• Handel’s hallelujah chorus
• Available in MATLAB
• load handel;
![Page 13: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/13.jpg)
Musical Sound Processing
• Echo Generation:
• Add echo to original sound using filter
• Echo Removal
• Remove echo using inverse filtering
![Page 14: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/14.jpg)
Musical Sound Processing
• Digital Reverberation:
• Another Reverberation Model:
![Page 15: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/15.jpg)
2. Discrete-time Signals and Systems
• Discrete-time Signal:
• Unit sample sequence:
![Page 16: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/16.jpg)
2. Discrete-time Signals and Systems
• Unit step sequence:
![Page 17: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/17.jpg)
2. Discrete-time Signals and Systems
• Real-valued exponential sequence:
• Complex-valued exponential sequence:
• Sinusoidal sequence:
![Page 18: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/18.jpg)
2. Discrete-time Signals and Systems
• Random sequences:• Uniform distribution: rand
• Gaussian distribution: randn
• Periodic sequence:
![Page 19: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/19.jpg)
2. Discrete-time Signals and Systems
• Operations on sequences:• Signal addition:
![Page 20: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/20.jpg)
2. Discrete-time Signals and Systems
• Operations on sequences:• Signal multiplication
• Scaling
• Shifting:
![Page 21: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/21.jpg)
2. Discrete-time Signals and Systems
• Folding:
• Sample summation: sum
• Sample products: prod
![Page 22: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/22.jpg)
2. Discrete-time Signals and Systems
• Signal energy:
• Signal power:
![Page 23: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/23.jpg)
2. Discrete-time Signals and Systems
![Page 24: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/24.jpg)
2. Discrete-time Signals and Systems
![Page 25: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/25.jpg)
2. Discrete-time Signals and Systems
• Systems• Linearity
• LTI
• Stability
• Causality
• Convolution
![Page 26: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/26.jpg)
2. Discrete-time Signals and Systems
• MATLAB Implementation• Convolution
• y=conv(x,h)
• Without timing information
![Page 27: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/27.jpg)
2. Discrete-time Signals and Systems
• MATLAB Implementation• Modified Convolution
• y=conv_m(x,nx,h,nh)
• Including timing information
![Page 28: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/28.jpg)
2. Discrete-time Signals and Systems
• MATLAB Implementation• Modified Convolution
• y=conv_m(x,nx,h,nh)
• Example
![Page 29: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/29.jpg)
2. Discrete-time Signals and Systems
• MATLAB Implementation• Modified Convolution
• y=conv_m(x,nx,h,nh)
• Example
![Page 30: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/30.jpg)
2. Discrete-time Signals and Systems
• MATLAB Implementation• Crosscorrelation between vectors x and y
• xcorr(x,y)
• Autocorrelation of vector x
• xcorr(x)
• Without timing information
![Page 31: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/31.jpg)
2. Discrete-time Signals and Systems
• MATLAB Implementation• Crosscorrelation using conv_m
![Page 32: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/32.jpg)
2. Discrete-time Signals and Systems
• MATLAB Implementation• Example:
![Page 33: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/33.jpg)
2. Discrete-time Signals and Systems
• Difference Equations
![Page 34: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/34.jpg)
2. Discrete-time Signals and Systems
• Difference Equations• Solution:
![Page 35: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/35.jpg)
2. Discrete-time Signals and Systems
• Difference Equations• Example:
![Page 36: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/36.jpg)
2. Discrete-time Signals and Systems
• Difference Equations• Example:
![Page 37: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/37.jpg)
2. Discrete-time Signals and Systems
• Digital Filters• FIR Filter:
• IIR Filter:
![Page 38: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/38.jpg)
3. The Discrete-Time Fourier Transform (DTFT)
• DTFT:
• IDTFT:
• Properties:
• 1. Periodicity
• 2. Symmetry: real-valued
![Page 39: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/39.jpg)
3. The Discrete-Time Fourier Transform (DTFT)
![Page 40: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/40.jpg)
3. The Discrete-Time Fourier Transform (DTFT)
![Page 41: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/41.jpg)
3. The Discrete-Time Fourier Transform (DTFT)
• Finite Duration x(n)
![Page 42: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/42.jpg)
3. The Discrete-Time Fourier Transform (DTFT)
• Finite Duration x(n)
![Page 43: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/43.jpg)
3. The Discrete-Time Fourier Transform (DTFT)
• Finite Duration x(n)
![Page 44: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/44.jpg)
3. The Discrete-Time Fourier Transform (DTFT)
• Finite Duration x(n)
![Page 45: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/45.jpg)
3. The Discrete-Time Fourier Transform (DTFT)
• Finite Duration x(n)
![Page 46: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/46.jpg)
3. The Discrete-Time Fourier Transform (DTFT)
• Finite Duration x(n)
![Page 47: Digital Signal Processing Laboratory (DSP Lab)](https://reader030.fdocuments.us/reader030/viewer/2022040517/624a58882825941e835e1848/html5/thumbnails/47.jpg)
3. The Discrete-Time Fourier Transform (DTFT)
• Finite Duration x(n)