Document Sample

Wavelets (Chapter 7) CS474/674 – Prof. Bebis Multiresolution Analysis • Many signals or images contain features at various levels of detail (i.e., scales). – e.g., buildings and people Small size objects should be examined at a high resolution. Large size objects should be examined at a low resolution. Fourier Analysis • Fourier analysis expands signals or functions in terms of sinusoids (or complex exponentials). • Identifies all spectral components present in a signal or a function. (inverse DFT) where: (forward DFT) Fourier Analysis – Examples (cont’d) f1 (t ) cos(2 5 t ) f 2 (t ) cos(2 25 t ) f 3 (t ) cos(2 50 t ) Fourier Analysis – Examples (cont’d) F1(u) F2(u) F3(u) Fourier Analysis – Examples (cont’d) f 4 (t ) cos(2 5 t ) cos(2 25 t ) cos(2 50 t ) F4(u) Limitations of Fourier Analysis 1. Fourier analysis cannot not provide simultaneous time and frequency localization. 2. 3. Simultaneous time - frequency localization • Fourier analysis identifies all spectral components present in the signal, however it does not provide any information regarding the temporal (time) localization of these components. Simultaneous time - frequency localization (cont’d) • Frequency domain localization: – If the signal is a sinusoidal, it is better localized in the Fourier domain. – Small changes in frequency will produce changes everywhere in the spatial domain. Simultaneous time - frequency localization (cont’d) • Spatial domain localization: – If the signal is a simple square pulse, then it is better localized in the spatial domain. – Small changes in the spatial domain will produce changes everywhere in the frequency domain. Limitations of Fourier Analysis (cont’d) 1. Fourier analysis cannot not provide simultaneous time and frequency localization. 2. Not very useful for analyzing time-variant, non- stationary signals/functions. 3. Stationary vs non-stationary Signals • Stationary signals: time-invariant spectra f 4 (t ) • Non-stationary signals: time-varying spectra. f 5 (t ) Stationary vs non-stationary Signals (cont’d) F4(u) Perfect knowledge of what frequencies exist, but no information about where these frequencies are located in time F5(u) Limitations of Fourier Analysis 1. Fourier analysis cannot not provide simultaneous time and frequency localization. 2. Not very useful for analyzing time-variant, non- stationary signals/functions. 3. Not appropriate for representing discontinuities or sharp corners (i.e., takes a large number of Fourier components to represent discontinuities). Representing discontinuities or sharp corners Representing discontinuities or sharp corners FT Representing discontinuities or sharp corners Representing discontinuities or sharp corners Representing discontinuities or sharp corners Representing discontinuities or sharp corners Representing discontinuities or sharp corners Representing discontinuities or sharp corners Representing discontinuities or sharp corners Representing discontinuities or sharp corners Representing discontinuities or sharp corners Simultaneous time - frequency localization: revisited Need a local analysis scheme for a time-frequency representation (TFR). Windowed F.T. or Short Time F.T. (STFT) Segmenting the signal into narrow time intervals (i.e., narrow enough to be considered stationary). Take the Fourier transform of each segment. Short Time Fourier Transform (STFT) • Steps of STFT: (1) Choose a window function of finite length (2) Place the window on top of the signal at t=0 (3) Truncate the signal using this window (4) Compute the FT of the truncated signal, save. (5) Incrementally slide the window to the right (6) Go to step 3, until window reaches the end of the signal Short Time Fourier Transform (STFT) • For each time location where the window is centered, we obtain a different FT – Each FT provides the spectral information of a separate time-slice of the signal, providing simultaneous time and frequency information Short Time Fourier Transform (STFT) (cont’d) Time Frequency Signal to FT Kernel parameter parameter be analyzed (basis function) STFT fu (t , u ) f (t ) W (t t ) e j 2 ut dt t STFT of signal f(t): Windowing Windowing function Computed for each function centered at t=t’ window centered at t=t’ Short Time Fourier Transform (STFT) (cont’d) • STFT maps 1-D time domain signals to 2-D time- frequency signals (i.e., in u and t’ ) STFT (t , u ) f (t ) W (t t ) e j 2 ut dt f u t Example f(t) W(t) Example (cont’d) STFT (t, u) u f W(t) Practical Issues • How to choose the windowing function? • What shape? – Rectangular, Gaussian, Elliptic…? • How wide? – Wider window require less time steps. – Window should be narrow enough to make sure that the portion of the signal falling within the window is stationary. STFT Window Size STFT fu (t , u ) f (t ) W (t t ) e j 2 ut dt t W(t) infinitely long: W (t ) 1 STFT turns into FT, providing excellent frequency information (good frequency resolution), but no time information. W(t) infinitely short: W (t ) (t ) gives the time signal back, with a phase factor, excellent time localization but no frequency information. STFT fu (t , u ) f (t ) (t t ) e j 2 ut dt f (t ) e jut t STFT Window Size (cont’d) • Wide analysis window good frequency resolution, poor time resolution. • Narrow analysis window good time resolution, poor frequency resolution. • Once the window is chosen, the resolution is set for both time and frequency. Example different size windows (four frequencies, non-stationary) Example (cont’d) STFTfu (t, u) STFTfu (t, u) Example (cont’d) STFTfu (t, u) STFTfu (t, u) Heisenberg Principle 1 t f 4 Time resolution: How well Frequency resolution: How two spikes in time can be well two spectral components separated from each other in can be separated from each the transform domain. other in the transform domain t and f cannot be made arbitrarily small ! Heisenberg Principle (cont’d) • One cannot know the exact time-frequency representation of a signal. – We cannot precisely know at what time instance a frequency component is located. – We can only know what interval of frequencies are present in which time intervals. The Wavelet Transform • Overcomes the preset resolution problem of the STFT by using a variable length window (i.e., multi-resolution): – Analysis of high frequencies Use narrower windows for better time resolution. – Analysis of low frequencies Use wider windows for better frequency resolution. • The function used to window the signal is called the wavelet The Wavelet Transform (cont’d) Wide windows do not provide good localization at high frequencies. The Wavelet Transform (cont’d) Use narrower windows at high frequencies. The Wavelet Transform (cont’d) Narrow windows do not provide good localization at low frequencies. The Wavelet Transform (cont’d) Use wider windows at low frequencies. The Wavelet Transform (cont’d) • Using narrow windows for analyzing high frequencies and wide windows for analyzing low frequencies works quite well for signals having high frequency components for short durations and low frequency components for long durations. What is a Wavelet? • A wavelet is a "small wave“ of varying frequency and limited duration. • This is in contrast to sinusoids, used by FT, which have infinite energy. Sinusoid Wavelet What is a Wavelet? (cont’d) • There are many different wavelets … Haar wavelet Morlet wavelet Daubechies wavelet • Basis functions, satisfying certain properties (e.g., orthogonal) Basis Functions (quick review – Section 7.2.1) • Given a vector space of functions, S, then if any f(t) ϵ S can be expressed as f (t ) ak k (t ) k the set of functions φk(t) are called the expansion set of S. • If the expansion is unique, the set is a basis. Basis Functions (cont’d) • Starting a basis set φk(t), the vector space S can be defined as the set of all functions f(t) that can be expressed as: f (t ) ak k (t ) k • This is called the span of the basis set. What is a Wavelet? (cont’d) • The position and duration (scale) of wavelets vary. Continuous Wavelet Transform Translation parameter, Scale parameter, Normalization measure of time measure of frequency constant 1 t (forward CWTf ( , s) f t dt CWT) s t s Continuous wavelet transform The mother wavelet. All kernels are of the signal f(t) obtained by translating (shifting) and/or scaling the mother wavelet . Scale = 1/frequency Continuous Wavelet Transform (cont’d) • Inverse CWT: 1 t CWT f ( , s) ( s )d ds f (t ) s s CWT: Main Steps 1. Take a wavelet and compare it to a section at the start of the original signal. 2. Calculate wavelet coefficient (i.e., convolution). CWT: Main Steps (cont’d) 3. Shift the wavelet to the right and repeat steps 1 and 2 until you've covered the whole signal. CWT: Main Steps (cont’d) 4. Scale (stretch) the wavelet and repeat steps 1 through 3. 5. Repeat steps 1 through 4 for all scales. Coefficients of Wavelet Transform 1 t CWTf ( , s) f t dt s t s Properties of Wavelets • Simultaneous localization in time and scale (i.e, frequency) - The location of the wavelet allows to explicitly represent the location of events in time. - The shape of the wavelet allows to represent different detail or resolution. Properties of Wavelets (cont’d) • Sparsity: for functions typically found in practice, many of the coefficients in a wavelet representation are either zero or very small. • Linear-time complexity: transforming to and from a wavelet representation can generally be accomplished in O(N) time. – For some wavelets, it is still O(NlogN) Properties of Wavelets (cont’d) • Adaptability: wavelets can be adapted to represent a wide variety of functions (e.g., functions with discontinuities, functions defined on bounded domains etc.). – Well suited to problems involving images, open or closed curves, and surfaces of just about any variety. – Can represent functions with discontinuities or corners more efficiently (i.e., some have sharp corners themselves). Discrete Wavelet Transform (DWT) • Need to consider a subset of scales and positions rather than every possible scale and position. • Sample the time-frequency plane on a dyadic (octave) grid (i.e., power of two). Normalization 1 t CWT f ( , s) f t dt constant s t s jk (t ) 2 j 2 j t k j, k Z Discrete Wavelet Transform (cont’d) jk (t ) 2 j 2 j t k j, k Z for frequency localization (i.e., details) for time localization Discrete Wavelet Transform (cont’d) 2D array of coefficients a j ,k f (t ) *,k (t ) j t (forward DWT) f (t ) a j ,k j ,k (t ) (inverse DWT) k j where jk (t ) 2 j 2 j t k j, k Z DFT vs DWT • Fourier expansion: (inverse DFT) one parameter basis or f (t ) a l l (t ) l DFT vs DWT (cont’d) • Wavelet expansion: two parameter basis f (t ) a j ,k j ,k (t ) (inverse DWT) k j Multiresolution (i.e., hierarchical) Representation f (t ) high resolution ˆ f1 (t ) ˆ f2 (t ) … ˆ f s (t ) low resolution f (t ) a j ,k (t ) j ,k jkt(t ) 2 j j 2 jtj k j,jk k Z jk ( ) 2 2 t k , Z k j Efficient Implementation Using Filter Banks • The lower resolution coefficients can be calculated from the higher resolution coefficients by a tree- structured algorithm called a filter bank. ψ(2t - k) f1 (t ) a1,k 1,k (t ) ˆ a1,k (j=1) k j ψ(t - k) f 0 (t ) a0,k 0,k (t ) ˆ k j a0,k (j=0) Multiresolution Conditions of WT • If a set of functions can be represented by a weighted sum of ψ(t - k), then a larger set (including the original) can be represented by a weighted sum of ψ(2t - k). f(t) ψ(t - k) ψ(2t - k) Efficient Representation Using Details H3=L2+D3 details D3 H2=L1+D2 & L2=H2 details D2 & H1=L0+D1 L1=H1 details D1 & L0 Efficient Representation Using Details (cont’d) representation: L0 D1 D2 D3 A wavelet representation of a function consists of a coarse overall approximation together with detail coefficients that influence the function at various scales. Example - Haar basis • Suppose we are given a 1D "image" with a resolution of 4 pixels: [9 7 3 5] • This image can be represented in the Haar basis as follows: Example - Haar basis (cont’d) • Start by averaging the pixels together (pairwise) to get a new lower resolution image: • To recover the original four pixels from the two averaged pixels, store some detail coefficients. Example - Haar basis (cont’d) • Repeating this process on the averages gives the full decomposition: Example - Haar basis (cont’d) • The Harr decomposition of the original four-pixel image is: • We can reconstruct the original image to a resolution by adding or subtracting the detail coefficients from the lower-resolution versions. Example - Haar basis (cont’d) Note small magnitude detail coefficients! How to compute the details Di ? Basis functions: Vj : space spanned by ψ(2jt - k) ψ(t - k) V0 f (t ) a j ,k (t ) f(t) ϵ Vj k j j ,k ψ(2t - k) V1 … ψ(2jt - k) Vj Multiresolution conditions nested spanned spaces: V j V j 1 i.e., if f(t) ϵ V j then f(t) ϵ V j+1 How to compute Di ? (cont’d) • Let Wj be the orthogonal complement of Vj in Vj+1 - i.e., all functions in Vj+1 that are orthogonal to all functions in Vj Vj+1 = Vj + Wj How to compute Di ? (cont’d) • If f(t) ϵ Vj+1, then f(t) can be represented using basis functions fromVj+1: f (t ) ck (2 j 1 t k ) k •Alternatively, f(t) can be represented using basis functions from Vj and Wj: Vj+1 = Vj + Wj f (t ) ck (2 j t k ) d j ,k (2 j t k ) k k How to compute Di ? (cont’d) Think of Wj as a means to represent the parts of a function in Vj+1 that cannot be represented in Vj Vj+1 f (t ) ck (2 j 1 t k ) k f (t ) ck (2 j t k ) d j ,k (2 j t k ) k k Vj, Wj How to compute Di ? (cont’d) • Vj+1 = Vj + Wj - using recursion on Vj: Vj+1 = Vj-1+Wj-1+Wj = …= V0 + W0 + W1 + W2 + … + Wj if f(t) ϵ Vj+1 , then: f (t ) ck (t k ) d j ,k (2 j t k ) k k j V0 W0, W1, W2, … basis functions basis functions Wavelet expansion (Section 7.2) • Any given decomposition of a signal into wavelets involves pair of waveforms (mother wavelets): encode low encode details or resolution info φ(t) ψ(t) high resolution info • The two shapes are translated and scaled to produce wavelets (wavelet basis) at different locations and on different scales. φ(t-k) ψ(2jt-k) Wavelet expansion (cont’d) • f(t) is written as a linear combination of φ(t-k) and ψ(2jt-k) : f (t ) ck (t k ) d j ,k (2 t k ) j k k j scaling function wavelet function Note: in Fourier analysis, there are only two possible values of k ( i.e., 0 and π/2); the values j correspond to different scales (i.e., frequencies). Wavelet expansion (cont’d) • Haar scaling and wavelet functions: computes average computes details 1D Haar Wavelets • Think of a one-pixel image as a function that is constant over [0,1) examples: 0 1 • We will denote by V0 the space of all such functions. 1D Haar Wavelets • Think of a two-pixel image as a function having two constant pieces over the intervals [0, 1/2) and [1/2,1) examples: 0 ½ 1 • We will denote by V1 the space of all such functions. • Note that V0 V1 ϵ V1 1D Haar Wavelets (cont’d) • V j represents all the 2j-pixel images • Functions having constant pieces over 2j equal-sized intervals on [0,1). width: 1/2j examples: ϵ Vj ϵ Vj 1D Haar Wavelets (cont’d) V0, V1, ..., V j define a hierarchical representation i.e., V j V j 1 V0 low resolution V1 … VJ high resolution 1D Haar Wavelets (cont’d) • Let’s define a basis for V j : mother scaling function: 0 1 1D Haar Wavelets (cont’d) 1D Haar Wavelets (cont’d) 1D Haar Wavelets (cont’d) • Suppose W j is the orthogonal complement of V j in V j+1 – i.e., functions in Vj+1 which are orthogonal to Vj 1D Haar Wavelets (cont’d) • Let’s define a basis ψ ji for W j : mother wavelet function: j=1 1D Haar Wavelets (cont’d) basis for V 1 : dot product basis W 1 : j=1 is zero! 1D Haar Wavelets (cont’d) Basis functions ψ ji of W j form a basis in V j+1 Basis functions φ ji of V j 1D Haar Wavelets (cont’d) V3 = V2 + W2 1D Haar Wavelets (cont’d) V2 = V1 + W1 1D Haar Wavelets (cont’d) V1 = V0 + W0 1D Haar Wavelets (cont’d) φ(t) ψ(t) Example - Haar basis (revisited) Decompositions of f(x) φ0,2(x) V2 φ1,2(x) φ2,2(x) φ3,2(x) i ( x) i, j ( x) j Decompositions of f(x) (cont’d) φ0,1(x) V1and W1 φ1,1(x) V2=V1+W1 ψ0,1(x) ψ1,1(x) ij ( x) i, j ( x) ij ( x) i , j ( x) Example - Haar basis (revisited) Decompositions of f(x) (cont’d) φ0,0(x) V0 ,W0 and W1 ψ0,0(x) V2=V1+W1=V0+W0+W1 ψ0,1(x) ψ1,1(x) ij ( x) i, j ( x) ij ( x) i , j ( x) Example - Haar basis (revisited) Example Example (cont’d) Orthogonality and normalization • The Haar basis forms an orthogonal basis – not always true for other wavelet bases • It can become orthonormal through the following normalization: i j ( x) 2 j (2 j x i) i ( x) 2 y(2 x i) j j j since i , j ( x) 2 j , i , j ( x) 2 j Filter banks (analysis) • The lower resolution coefficients can be calculated from the higher resolution coefficients by a tree- structured algorithm called a filter bank. down-sampling h0(-n) is a lowpass filter and h1(-n) is a highpass filter Example - Haar basis (revisited) [9 7 3 5] low-pass, high-pass, down-sampling down-sampling (9+7)/2 (3+5)/2 (9-7)/2 (3-5)/2 V1 basis functions Filter banks (analysis) (cont’d) Example - Haar basis (revisited) [9 7 3 5] low-pass, high-pass, down-sampling down-sampling V1 basis functions (8+4)/2 (8-4)/2 Convention for illustrating the 1D Haar wavelet decomposition x x x x x x … x x average detail … re-arrange: V1 basis functions re-arrange: Convention for illustrating the 1D Haar wavelet decomposition (cont’d) average x x x x x x … x x detail … Examples of lowpass/highpass analysis filters Haar Daubechies Filter banks (synthesis) • The higher resolution coefficients can be calculated from the lower resolution coefficients using a similar structure. : up-sampling (i.e., add 0s between samples) Filter banks (synthesis) (cont’d) Examples of lowpass/highpass synthesis filters Haar (same as for analysis): Daubechies Computing the 2D Haar Wavelet Transform • The 2D Haar wavelet decomposition can be computed using 1D Haar wavelet decompositions (i.e., 2D Haar wavelet basis is separable). • Two decompositions – Standard decomposition – Non-standard decomposition • Each decomposition corresponds to a different set of 2D basis functions. Standard Haar wavelet decomposition • Steps (1) Apply the 1D Haar wavelet transform to each row of pixel values. (2) Apply the 1D Haar wavelet transform on the columns of the row-transformed array. Standard Haar wavelet decomposition (cont’d) average (1) row-wise Haar decomposition: detail re-arrange terms xxx … x … … xxx … x … … … . … … . … … . xxx ... x … Standard Haar wavelet decomposition (cont’d) average (1) row-wise Haar decomposition: detail from previous slide: row-transformed result … … … … … … . … … . … Standard Haar wavelet decomposition (cont’d) average detail (2) column-wise Haar decomposition: row-transformed result column-transformed result … … … … … … … . … … . … … Example row-transformed result … … … … . … Example (cont’d) column-transformed result … … … … . … 2D Haar basis for standard decomposition To construct the standard 2D Haar wavelet basis, consider all possible outer products of 1D basis functions. φ0,0(x) ψ0,0(x) V2=V0+W0+W1 ψ0,1(x) ψ1,1(x) 2D Haar basis for standard decomposition To construct the standard 2D Haar wavelet basis, consider all possible outer products of 1D basis functions. φ0,0(x), φ0,0(x) ψ0,0(x), φ0,0(x) ψ0,1(x), φ0,0(x) ij ( x) i, j ( x) ij ( x) i , j ( x) 2D Haar basis of standard decomposition V2 ij ( x) i, j ( x) ij ( x) i , j ( x) Non-standard Haar wavelet decomposition • Alternates between operations on rows and columns. (1) Perform one step of horizontal pairwise averaging and differencing in each row. (2) Apply vertical pairwise averaging and differencing in each column of the result. (3) Repeat the process for the quadrant containing averages in both directions. Non-standard Haar wavelet decomposition (cont’d) pairwise horizontal pairwise vertical Haar decomposition: Haar decomposition: xxx … x … … xxx … x … … … … . … … . … … . xxx ... x … … Note: averaging/differencing of detail coefficients shown as red again! Non-standard Haar wavelet decomposition (cont’d) re-arrange terms … … horizontal pairwise vertical pairwise Haar decomposition Haar decomposition … … . on “green” quadrant on “green” quadrant … … … … … … … . … Example re-arrange terms … … … … . … … Example (cont’d) … … … … . … 2D Haar basis for non-standard decomposition • Defined through 2D scaling and wavelet functions: ( x, y ) ( x) ( y ) 0,0 ( x, y ) ( x, y ) 0 ( x, y ) ( x) ( y ) kj, f ( x, y ) 2 j (2 j x k , 2 j y f ) ( x, y ) ( x) ( y ) kj, f ( x, y ) 2 j (2 j x k , 2 j y f ) ( x, y ) ( x) ( y ) kj, f ( x, y ) 2 j (2 j x k , 2 j y f ) Three sets of detail coefficients! 2D Haar basis for non-standard decomposition (cont’d) 0,0 ( x, y ) ( x, y ) LL: average LL 0 Detail coefficients LH: intensity variations along j k, f ( x, y ) 2 (2 x k , 2 y f ) j j j columns (horizontal edges) kj, f ( x, y ) 2 j (2 j x k , 2 j y f ) HL: intensity variations along rows (vertical edges) kj, f ( x, y ) 2 j (2 j x k , 2 j y f ) HH: intensity variations along diagonals 2D Haar basis for non-standard decomposition (cont’d) ij ( x) i, j ( x) V2 ij ( x) i , j ( x) Convention for illustrating 2D wavelet decomposition LL LH LH HH HL HH LL HL The wavelet transform can be applied again on the lowpass-lowpass version of the image, yielding seven subimages. Forward/Inverse DWT (using textbook’s notation) LL i=H,V,D H LH V HL D HH Forward 2D DWT (filter bank) H LH V HL D HH Inverse 2D wavelet transform • Enlarge the wavelet transform data to its original size (insert zeros between each value). • Convolve each of the four subimages with the corresponding inverse (lowpass, highpass) filters. • Sum the results to obtain the original image. Inverse 2D DWT (filter bank) H LH V HL D HH Applications • Noise filtering • Image compression – Fingerprint compression • Image fusion G. Bebis, A. Gyaourova, S. Singh, and I. Pavlidis, "Face Recognition by Fusing Thermal Infrared and Visible Imagery", Image and Vision Computing, vol. 24, no. 7, pp. 727-742, 2006. • Recognition/Classification • Image retrieval

DOCUMENT INFO

Shared By:

Categories:

Tags:
wavelet transform, Fourier transform, Daubechies wavelets, An Introduction to Wavelets, scaling function, orthogonal wavelets, signal processing, Discovering Wavelets, biorthogonal wavelets, Wavelet Analysis

Stats:

views: | 37 |

posted: | 5/11/2011 |

language: | English |

pages: | 141 |

OTHER DOCS BY pengxuebo

How are you planning on using Docstoc?
BUSINESS
PERSONAL

By registering with docstoc.com you agree to our
privacy policy and
terms of service, and to receive content and offer notifications.

Docstoc is the premier online destination to start and grow small businesses. It hosts the best quality and widest selection of professional documents (over 20 million) and resources including expert videos, articles and productivity tools to make every small business better.

Search or Browse for any specific document or resource you need for your business. Or explore our curated resources for Starting a Business, Growing a Business or for Professional Development.

Feel free to Contact Us with any questions you might have.