eecs 373 design of microprocessor-based systems farhan hormasji matthew diffenderfer
DESCRIPTION
EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer University of Michigan Efficient Algorithms November 27, 2012. Outline. Overview DFT algorithms FFT Cooley–Tukey FFT Bluestein's FFT Goertzel Edge Detection Algorithms Canny Sobel Prewitt - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/1.jpg)
1
EECS 373Design of Microprocessor-Based Systems
Farhan HormasjiMatthew DiffenderferUniversity of Michigan
Efficient AlgorithmsNovember 27, 2012
![Page 2: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/2.jpg)
2
Outline
• Overview
• DFT algorithms– FFT– Cooley–Tukey FFT– Bluestein's FFT– Goertzel
• Edge Detection Algorithms– Canny– Sobel– Prewitt– Roberts Cross
• Questions
![Page 3: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/3.jpg)
Algorithms
What to look for:• Usefulness• Methodology• Implementation
Tradeoffs:• Cost• Code Size• Runtime• Availability
3
![Page 4: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/4.jpg)
4
Outline
• Overview
• DFT algorithms– FFT– Cooley–Tukey FFT– Bluestein's FFT– Goertzel
• Edge Detection Algorithms– Canny– Sobel– Prewitt– Roberts Cross
• Questions
![Page 5: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/5.jpg)
Discrete Fourier Transform (DFT): Overview
• What?– Converts a sampled function from time domain to frequency domain
• Use?– DFTs reveal periodicities in input data as well as the relative strengths of any periodic components
5
![Page 6: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/6.jpg)
Discrete Fourier Transform (DFT): Mathematical Interpretation
6
![Page 7: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/7.jpg)
Discrete Fourier Transform (DFT): Applications
• Spectral Analysis– Most signals are sinusoidal– DFT tells you frequency, phase, and amplitude components
• Frequency Response of Systems– All input and output signals can be represented as cosine waves
– By observing change in magnitude and phase, any linear system can be described
• Convolution in the Frequency Domain– Convolution in time domain is multiplication in frequency domain
– Speed of computation greatly reduced
7
![Page 8: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/8.jpg)
Fast Fourier Transform (FFT): Overview
• What?– An efficient algorithm to compute the DFT and its inverse
• Why use it?– O(Nlog2N)
• Tradeoff– Input data must be a power of 2– If it’s not, data is either truncated or padded with zeros
• Many different types
8
![Page 9: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/9.jpg)
FFT: Cooley-Tukey algorithm
• Most common FFT algorithm– Divide and conquer algorithm
• Methodology– Breaks up DFT of N samples into N=N1N2
• Benefit– Can be combined with any other DFT algorithm
– What Matlab fft function does for optimization
9
![Page 10: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/10.jpg)
FFT: Cooley-Tukey algorithmMethodology
10
![Page 11: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/11.jpg)
Fast Fourier Transform (FFT): Bluestein
• Also called chirp z-transform algorithm
• Methodology– Expresses DFT as a convolution
• Benefit– Computes DFT of arbitrary sizes– Can be used to compute more general transforms
• Tradeoff– Only O(Nlog2N) complexity for prime-sized DFTs
11
![Page 12: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/12.jpg)
Fast Fourier Transform (FFT): BluesteinMethodology
12
![Page 13: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/13.jpg)
Goertzel Algorithm
13
![Page 14: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/14.jpg)
Goertzel Algorithm
• Tradeoff– O(NM)– N is number of DFT terms, M is the set of DFT terms to calculate
• Benefit– Simple structure of algorithm makes it well suited to small processors
– More efficient than FFT for small number of frequencies ( if M < log2N)
• Applications– Used to recognize DTMF tones produced by buttons on telephone keypad
– Call progress (dial tone, busy)14
![Page 15: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/15.jpg)
Runtime Performance Comparison
15
![Page 16: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/16.jpg)
Runtime Performance Comparison:Matlab
16
![Page 17: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/17.jpg)
17
Outline
• Overview
• DFT algorithms– FFT– Cooley–Tukey FFT– Bluestein's FFT– Goertzel
• Edge Detection Algorithms– Canny– Sobel– Prewitt– Roberts Cross
• Questions
![Page 18: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/18.jpg)
Edge DetectionOverview
• Use– Tool used in image processing– Goal is to identify points in a digital image where image brightness changes sharply or has discontinuities
– Reduce amount of data in image so that further image processing may occur
– Reduce images to shapes
• Applications– Most image processing
18
![Page 19: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/19.jpg)
Edge Detection: Canny
• Use– Optimal edge detection
• the algorithm should mark as many real edges in the image as possible
• edges marked should be as close as possible to the edge in the real image
• a given edge in the image should only be marked once
• image noise should not create false edges
• Benefits– Adaptable to most images– Generally has short runtime, well-suited for real time implementations in FPGAs
• Constraints– Size of Gaussian filter– Calibration of thresholds
19
![Page 20: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/20.jpg)
Edge Detection: CannyMethodology
• Convolves image with Gaussian filter– To eliminate noise
• Uses other types of edge detection to determine intensity gradient vertically, horizontally, and diagonally– 4 filters
• Goes through matrix to determine if gradient magnitude is a local maximum based on gradient direction– Determine high and low threshold
• Go through image and mark pixel as edge or non-edge based on thresholds
20
![Page 21: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/21.jpg)
Edge Detection: Sobel
• Use– Discrete differentiation operator– Computes the gradient of the image intensity
• Benefits– Few number of computations– Can be implemented simply in both hardware and software
• Tradeoffs– Poor gradient approximation for high frequency variations in image
21
![Page 22: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/22.jpg)
Edge Detection: SobelMethodology
• 2 kernels convolved with original image to calculate gradient in vertical and horizontal direction
– Where A is the original image
• Compare gradient value to threshold similar to Canny algorithm
22
![Page 23: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/23.jpg)
Edge Detection: Prewitt
• Same as Sobel algorithm but with two key differences
• The two kernels used have slightly different values
• Magnitude and Direction of gradient in Sobel:
• Magnitude and Direction of gradient in Prewitt:
23
![Page 24: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/24.jpg)
Edge Detection: Roberts Cross
• Use– One of the first edge detectors– Intensity of edges should correspond as close as possible to what a human would perceive
• Benefits– Only finds gradient in diagonal direction due to simple kernels, so algorithm has high simplicity
• Tradeoffs– Speed of modern computers make this simplicity negligable
– Edge detection suffers from sensitivity to noise
24
![Page 25: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/25.jpg)
Edge Detection: Roberts CrossMethodology
• 2 kernels convolved with original image to calculate gradient in diagonal direction
• Magnitude and direction of gradient found similar to Sobal
• Compare gradient value to threshold similar to Canny algorithm
25
![Page 26: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/26.jpg)
Block M
26
![Page 27: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/27.jpg)
Canny
27
![Page 28: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/28.jpg)
Sobel
28
![Page 29: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/29.jpg)
Prewitt
29
![Page 30: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/30.jpg)
Roberts Cross
30
![Page 31: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/31.jpg)
Edge Pixels Detected: Block M
31
![Page 32: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/32.jpg)
Prabal
32
![Page 33: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/33.jpg)
Canny
33
![Page 34: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/34.jpg)
Sobel
34
![Page 35: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/35.jpg)
Prewitt
35
![Page 36: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/36.jpg)
Roberts Cross
36
![Page 37: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/37.jpg)
Edge Pixels Detected: Prabal
37
![Page 38: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/38.jpg)
Blur
38
![Page 39: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/39.jpg)
Canny
39
![Page 40: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/40.jpg)
Sobel
40
![Page 41: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/41.jpg)
Prewitt
41
![Page 42: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/42.jpg)
Roberts Cross
42
![Page 43: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/43.jpg)
Edge Pixels Detected: Blur
43
![Page 44: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/44.jpg)
Gray
44
![Page 45: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/45.jpg)
Canny
45
![Page 46: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/46.jpg)
Sobel
46
![Page 47: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/47.jpg)
Prewitt
47
![Page 48: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/48.jpg)
Roberts Cross
48
![Page 49: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/49.jpg)
Edge Pixels Detected: Grayscale
49
![Page 50: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/50.jpg)
Final Comparison
50
![Page 51: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/51.jpg)
51
Questions?
Comments?
Discussion?
![Page 52: EECS 373 Design of Microprocessor-Based Systems Farhan Hormasji Matthew Diffenderfer](https://reader036.vdocuments.us/reader036/viewer/2022062422/5681332a550346895d9a1b1d/html5/thumbnails/52.jpg)
52
References
• Everything– Wikipedia– Mathworks
• DFT/FFT– The Scientist and Engineer's Guide to Digital Signal Processing By
Steven W. Smith, Ph.D.– http://www.robots.ox.ac.uk/~sjrob/Teaching/SP/l7.pdf– http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/OWENS/
LECT4/node3.html
• Goertzel– http://www.numerix-dsp.com/goertzel.html
• Edge Detection– http://dasl.mem.drexel.edu/alumni/bGreen/www.pages.drexel.edu/
_weg22/can_tut.html– http://www.cse.unr.edu/~bebis/CS791E/Notes/EdgeDetection.pdf
• Edge Detection Images– Prabal: web.eecs.umich.edu/~prabal/– Block M: www.umich.edu– Grayscale: www.colorsimulator.com– Blur: www.dreamstime.com (Royalty Free Stock Photos)