ENGI 4559 Signal Processing for Software Engineers Dr. Richard Khoury Fall 2009.

Slides:



Advertisements
Similar presentations
DCSP-13 Jianfeng Feng Department of Computer Science Warwick Univ., UK
Advertisements

3-D Computational Vision CSc Image Processing II - Fourier Transform.
Compressive Sensing IT530, Lecture Notes.
Ch.4 Fourier Analysis of Discrete-Time Signals
Frequency Domain The frequency domain
School of Computing Science Simon Fraser University
Sampling (Section 4.3) CS474/674 – Prof. Bebis. Sampling How many samples should we obtain to minimize information loss during sampling? Hint: take enough.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
2D Fourier Theory for Image Analysis Mani Thomas CISC 489/689.
Fourier Transform and Applications
DREAM PLAN IDEA IMPLEMENTATION Introduction to Image Processing Dr. Kourosh Kiani
Spectral Analysis Spectral analysis is concerned with the determination of the energy or power spectrum of a continuous-time signal It is assumed that.
First semester King Saud University College of Applied studies and Community Service 1301CT.
Goals For This Class Quickly review of the main results from last class Convolution and Cross-correlation Discrete Fourier Analysis: Important Considerations.
Sampling Theorem, frequency resolution & Aliasing The Sampling Theorem will be the single most important constraint you'll learn in computer-aided instrumentation.
Frequency Domain Representation of Sinusoids: Continuous Time Consider a sinusoid in continuous time: Frequency Domain Representation: magnitude phase.
EE513 Audio Signals and Systems Digital Signal Processing (Systems) Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
… Representation of a CT Signal Using Impulse Functions
G52IIP, School of Computer Science, University of Nottingham 1 Image Transforms Fourier Transform Basic idea.
Topic 7 - Fourier Transforms DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Fourier representation for discrete-time signals And Sampling Theorem
Discrete-Time and System (A Review)
EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 08-Sept, 98EE421, Lecture 11 Digital Signal Processing (DSP) Systems l Digital processing.
University of Ioannina - Department of Computer Science Filtering in the Frequency Domain (Fundamentals) Digital Image Processing Christophoros Nikou
Antialiasing CptS 548 Advanced Computer Graphics John C. Hart.
Vibrationdata 1 Unit 5 The Fourier Transform. Vibrationdata 2 Courtesy of Professor Alan M. Nathan, University of Illinois at Urbana-Champaign.
DTFT And Fourier Transform
Lecture 1 Signals in the Time and Frequency Domains
Motivation Music as a combination of sounds at different frequencies
Image Synthesis Rabie A. Ramadan, PhD 3. 2 Our Problem.
Fourier Series Summary (From Salivahanan et al, 2002)
Digital Signal Processing
1 Chapter 5 Image Transforms. 2 Image Processing for Pattern Recognition Feature Extraction Acquisition Preprocessing Classification Post Processing Scaling.
Chapter 5 Frequency Domain Analysis of Systems. Consider the following CT LTI system: absolutely integrable,Assumption: the impulse response h(t) is absolutely.
Discrete Fourier Transform Prof. Siripong Potisuk.
Part I: Image Transforms DIGITAL IMAGE PROCESSING.
Vibrationdata 1 Unit 5 The Fourier Transform. Vibrationdata 2 Courtesy of Professor Alan M. Nathan, University of Illinois at Urbana-Champaign.
Digital Image Processing Chapter 4 Image Enhancement in the Frequency Domain Part I.
Zhongguo Liu_Biomedical Engineering_Shandong Univ. Chapter 8 The Discrete Fourier Transform Zhongguo Liu Biomedical Engineering School of Control.
Wavelets and Multiresolution Processing (Wavelet Transforms)
Discrete Fourier Transform in 2D – Chapter 14. Discrete Fourier Transform – 1D Forward Inverse M is the length (number of discrete samples)
Vibrationdata 1 Unit 6a The Fourier Transform. Vibrationdata 2 Courtesy of Professor Alan M. Nathan, University of Illinois at Urbana-Champaign.
2D Sampling Goal: Represent a 2D function by a finite set of points.
Fourier Transform.
HOW JEPG WORKS Presented by: Hao Zhong For 6111 Advanced Algorithm Course.
Lecture 21: Fourier Analysis Using the Discrete Fourier Transform Instructor: Dr. Ghazi Al Sukkar Dept. of Electrical Engineering The University of Jordan.
Fourier and Wavelet Transformations Michael J. Watts
CS 376b Introduction to Computer Vision 03 / 17 / 2008 Instructor: Michael Eckmann.
The Frequency Domain Digital Image Processing – Chapter 8.
Fourier transform.
Sampling and DSP Instructor: Dr. Mike Turi Department of Computer Science & Computer Engineering Pacific Lutheran University.
Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
Linear Filters and Edges Chapters 7 and 8
CS 591 S1 – Computational Audio
… Sampling … … Filtering … … Reconstruction …
Linear Filters and Edges Chapters 7 and 8
MECH 373 Instrumentation and Measurements
Digital Signal Processing Lecture 4 DTFT
Unit 5 The Fourier Transform.
Fourier and Wavelet Transformations
EE Audio Signals and Systems
Dr. Nikos Desypris, Oct Lecture 3
Joshua Barczak CMSC435 UMBC
Fourier Analysis ENGI 4559 Signal Processing for Software Engineers
Sampling and the Discrete Fourier Transform
4. Image Enhancement in Frequency Domain
Digital Image Procesing Unitary Transforms Discrete Fourier Trasform (DFT) in Image Processing DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR) IN SIGNAL.
Lecture 4 Image Enhancement in Frequency Domain
ENEE222 Elements of Discrete Signal Analysis Lab 9 1.
DIGITAL CONTROL SYSTEM WEEK 3 NUMERICAL APPROXIMATION
Presentation transcript:

ENGI 4559 Signal Processing for Software Engineers Dr. Richard Khoury Fall 2009

Fourier Analysis in 2D: Overview 2D Extensions of Fourier Transform Aliasing and Moiré Patterns Fourier Transform of Images Matlab 2ENGI 4559 © Dr. Richard Khoury, 2009

2D Extensions: CTFT ENGI 4559 © Dr. Richard Khoury, 20093

2D Extensions: DTFT ENGI 4559 © Dr. Richard Khoury, 20094

2D Extensions: DFT ENGI 4559 © Dr. Richard Khoury, 20095

2D Extensions: Sampling Theorem 1D sampling theorem: If the maximum frequency contained in an analog signal is Ω max = B, then it can be perfectly reconstructed from samples taken at the sampling frequency Ω s = 2B (or more). 2D sampling theorem: If the maximum frequency contained in an analog signal is Ω 1 = B 1 in one direction and Ω 2 = B 2 in the other, then it can be perfectly reconstructed from samples taken at the sampling frequencies Ω s1 = 2B 1 in the first direction and Ω s2 = 2B 2 in the other. ENGI 4559 © Dr. Richard Khoury, 20096

2D Extensions: Aliasing ENGI 4559 © Dr. Richard Khoury, 20097

Aliasing in Images Imagine a perfect digital camera taking a picture of a checkerboard where each square is one pixel in size If we sample it (i.e. take the picture) at a resolution of several pixels per square, it works 16 pixels per square: 6 pixels per square: ENGI 4559 © Dr. Richard Khoury, 20098

Aliasing in Images At resolutions less than one pixel per square, severe aliasing occurs 0.9 pixels per square: ENGI 4559 © Dr. Richard Khoury, 20099

Aliasing in Images In DIP, modifying the sampling rate is not always possible Downsampling (shrinking) a picture would require access to the original scene to resample it Aliasing is unavoidable Often covered up by blurring the image slightly before resizing ENGI 4559 © Dr. Richard Khoury,

Aliasing in Images Aliasing is very visible in diagonal edges ENGI 4559 © Dr. Richard Khoury,

Moiré Patterns ENGI 4559 © Dr. Richard Khoury, Another common type of artefact Result of sampling an image that already has a sampled periodic element Typically visible in Two overlapping insect window screens Striped material on TV Digital scan of newspaper pictures

Moiré Patterns Take two patterns that are individually Clean and devoid of interference Periodic or nearly periodic At different angles from each other Superimposing one on the other creates a new pattern with frequencies that do not exist in the originals ENGI 4559 © Dr. Richard Khoury,

Fourier Transform of Images The Fourier transform of an image is generally a complex number where ENGI 4559 © Dr. Richard Khoury,

Fourier Transform of Images The magnitude r 12 is the Fourier spectrum or frequency spectrum r 12 ² is the power spectrum The exponent ω 12 is the phase angle We can display the resulting matrices as images! ENGI 4559 © Dr. Richard Khoury,

Fourier Transform of Images Let’s run an experiment! We’ll use this image We compute the DFT and display the spectrum All the highest values are in the corners They correspond to the zero frequencies It’s more convenient (and conventional) to shift the graphic to display them in the middle Still too dark to make out the details So we normalize and display ENGI 4559 © Dr. Richard Khoury,

Fourier Transform of Images The phase angle can be displayed directly What does it mean? The spectrum represents the amplitude of the sinusoids that form the signal The phase is the displacement of each sinusoid to the origin ENGI 4559 © Dr. Richard Khoury,

ENGI 4559 © Dr. Richard Khoury,

Fourier Transform of Images ENGI 4559 © Dr. Richard Khoury,

Fourier Transform of Images The Fourier Spectrum represents intensities Their positions in the spectrum has meaning too ENGI 4559 © Dr. Richard Khoury, Center value (origin, since we shifted the graph) is the average intensity value of the image Low frequency values (near the origin) are slow- varying intensity regions High frequency values (far from the origin) are regions with fast variations in intensity

Matlab Matlab already implements the 1D and 2D DFT F = fft2(M) computes the 2D DFT of a matrix M M = ifft2(F) computes the 2D inverse DFT of a Fourier matrix, recovering the original matrix M F = fftshift(M) performs a quadrant shift of the matrix, which is convenient to display the Fourier spectrum ENGI 4559 © Dr. Richard Khoury,

Matlab >> z = 4 + 3i; >> r = abs(z) r = 5 >> r = sqrt(real(z)^2 + imag(z)^2) r = 5 >> theta = atan2(imag(z),real(z)) theta = >> z = r *exp(i *theta) z = i ENGI 4559 © Dr. Richard Khoury,

Matlab Computing the Fourier spectrum and phase angle %Read the image using the method we know imagereal = imread('lenna.png'); %Convert from uint8 to double for math imagereal = double(imagereal); %Fourier transform F = fft2(imagereal); %Fourier spectrum Spectrum = sqrt( real(F).^2 + imag(F).^2 ); %Shift the spectrum, as per convention SpectrumS = fftshift(Spectrum); %Phase angle Phase = atan2( imag(F), real(F) ); ENGI 4559 © Dr. Richard Khoury,

Matlab Displaying the spectrum and phase figure; colormap(gray) imagesc(1+log10(SpectrumS)) title('Fourier Spectrum') figure; colormap(gray) imagesc(Phase) title('Phase angle') ENGI 4559 © Dr. Richard Khoury, Don’t forget to normalize the spectrum display!

Matlab Reconstructing the image %Shift the spectrum back SpectrumSS = fftshift(SpectrumS); %Compute the values of Fourier Transform F2 = SpectrumSS.* exp(sqrt(-1)* Phase ); %Perform the inverse DFT %Note that rounding errors can leave a small % imaginary part (  ) which we must discard reconstructed = real(ifft2(F2)); %Display the image figure; colormap(gray) imagesc(reconstructed) title('Reconstructed image') ENGI 4559 © Dr. Richard Khoury,

Summary We learned the 2D equations of the continuous-time, discrete-time, and discrete Fourier transform, and of the sampling theorem We considered the effect of aliasing and Moiré patterns, and the difference between these two phenomena We applied our knowledge by computing the Fourier transform of images, and splitting the result into the frequency spectrum and phase angle components And we learned the meaning of these two components ENGI 4559 © Dr. Richard Khoury,