530 likes | 1.09k Views
“Wavelets”. Texas Instruments University Programme Teaching Materials. Wavelets. Introduction. The Fourier Transform has limitations when used with real-world signals such as audio, video and medical data
E N D
“Wavelets” Texas Instruments University Programme Teaching Materials
Introduction • The Fourier Transform has limitations when used with real-world signals such as audio, video and medical data • In this chapter we shall analyse signals using finite waveform blocks known as wavelets • Wavelets can be used for the analysis of medical signals, fingerprints, audio denoising and video compression.
Objectives • To introduce the concept of wavelets • To introduce three wavelet transforms: • the Continuous Wavelet Transform (CWT) • the Discrete Wavelet Transform (DWT) • the Inverse Wavelet Transform (IDWT) • To implement wavelet analysis of an audio signal on the TMS320C5505 USB Stick.
Fourier Transform and its Limitations • Multiplies the signal s(t) by an infinite sine wave • No means of identifying exactly where an event occurs • Does not cope well with signals with discontinuous bursts such as video, music and seismic data.
A Wavelet • Instead of an infinite sine wave for the transform, use a wavelet of finite duration: Morlet Wavelet t
The Continuous Wavelet Transform • The Continuous Wavelet Transform (CWT) is defined as: • This can be interpreted as convolving the signal s(t) with the wavelet.
Convolve Wavelet with Noise Click Noise “Click” Convolve by sliding wavelet across signal Position of Noise is identified by Wavelet
Wavelet Scaling “Stretch” the original wavelet to work with low frequencies. “Compress” the original wavelet to work with high frequencies. Narrow Frequency Band Wide Frequency Band
The Discrete Wavelet Transform (DWT) • Based on dyadic (2^) analysis • Uses several wavelets to characterise a signal • Is computationally efficient.
Diadic Filter Structure • The DWT uses wavelet filtering and down sampling • It is a reversible process • Breaks the signal down into a series of: • aj (“average”) coefficients • dj (“detail”) coefficients.
Result of Analysis • The DWT has separated the signal from the noise • Most of the important information is contained at the “a3” level. Low sampling rate, good for compression • The high frequency noise is contained at the “d1” level. This can be discarded to reduce the noise.
Reconstruction using IDWT The input is reconstructed using the Inverse Discrete Wavelet Transform (IDWT) by up sampling. IDWT Reconstruction DWT Analysis
Shrink Wavelet Coefficients Scheme for Wavelet Denoising Estimate Noise Level and Set Thresholds Noisy Signal Recovered Signal Wavelet Transform Inverse Wavelet Transform
Noise Thresholds Hard Thresholding Soft Thresholding
Hard and Soft Thresholding • Hard Thresholding: • Ignore signals below noise threshold • Sharp transition from on/off. • Soft Thresholding: • Ignore signals below noise threshold • Attenuate low-level signals • Smooth transition between on/off.
Denoising a Signal Signal + Noise Signal with noise removed Noise
Some Wavelet Types Wavelets do not have to be symmetrical. Daubechies Meyer Symmlet3
Wavelet Selection • Arbitrary, but some guidelines available. • Wavelets have individual properties: • Local symmetries. Mexican hat (Morlet) • Orthogonal basis. Daubechies (db) • Linear phase. Biorthogonal • Compactly supported. db1 vs. db4 for two discontinuities • Smoothness measured by derivatives or vanishing moments. db2 vs. db5.
Selection of Decomposition Level • Dependent on the type of signal. • Too little decomposition: • noise still present • Too much decomposition: • detail lost • slow processing speed.
Level 1 Decomposition a1 still noisy
Level 2 Decomposition a2 signal more clear
Level 3 Decomposition a3 signal extracted from noise.
Other Uses of Wavelets • Image / video compression (2D, 3D) • DWT(JPEG2000), fingerprint image compression (FBI) • Data with transients for financial, seismic, ECG • Pattern matching for biometrics • Feature extraction using detail as signature in metallurgy • Multi-sensor data for multi-recording EEG and multi-scale PCA • Communication systems, raised cosine filter is special case of Meyer.
Debauchies.c • The code in this chapter uses the Debauchies db4 wavelet in daubechies.c and daubechies.h • Implements LEVEL 2: Frame length 8 16-bit words • The terms produced are: • a2 (2 words) • d2 (2 words) • d1 (4 words) • Uses a fixed-point implementation.
Installing the Application • Use the code given in Application 12 Wavelets • Follow the steps previously given in Chapter 1 to set up the new project.
Microphone Setup TMS320C5505 USB to PC Microphone Headphones
Alter the Coefficients • After the function Daubechies() has been executed, the wavelet coefficients are in coefficients[]. • Change the coefficients in main.c: • Leave A2 unchanged. Make D1 = 0 and D2 = 0 • Leave D2 unchanged. Make A2 = 0 and D1 = 0 • Leave D1 unchanged. Make A2 = 0 and D2 = 0.
Decomposition Level • In the file daubechies.c, LEVEL 2 has been implemented. This uses a frame size N of 8 • Change the decomposition to LEVEL 3, that is, use a frame length N of 16.
Programming Challenge • To remove the values of a1, d1 and d2, “hard thresholding” has been used • Modify the code in main.c to use “soft thresholding”.
Questions • What are the differences between the Fourier Transform and the Discrete Wavelet Transform (DWT)? • What influences the choice of wavelet? • Give 5 practical examples of applications of wavelets.
References • Internet: “The Wavelet Tutorial” by Robi Polikar. Part I to Part IV. • www.bearcave.com A wavelet lifting scheme. Contains C++/Java code for Daubechies4. Written by Ian Kaplan. • Digital Signal Processing, A Practical Approach by Emmanuel C. Ifeachor and Barrie W. Jervis. ISBN 0201-59619-9