From Fourier Series to Analysis of Non-stationary Signals - X prof. Miroslav Vlcek December 12, 217
Contents 1 Nonstationary Signals and Analysis 2 Introduction to Wavelets 3 A note to your compositions 4 MATLAB project
Contents 1 Nonstationary Signals and Analysis 2 Introduction to Wavelets 3 A note to your compositions 4 MATLAB project
Contents 1 Nonstationary Signals and Analysis 2 Introduction to Wavelets 3 A note to your compositions 4 MATLAB project
Contents 1 Nonstationary Signals and Analysis 2 Introduction to Wavelets 3 A note to your compositions 4 MATLAB project
Limits in signal analysis There are several approaches available for addressing non-stationary signals - The Short Time Fourier Transform has in principle excellent frequency resolution, with the time resolution varying with the length of the window, which for some non-stationary signals fails to provide information about substantial time events.
Limits in signal analysis The Wavelet Transform possesses excellent time resolution, but in principle it has poorer frequency resolution than the Short Time Fourier Transform. The continuous wavelet functions are not generally orthogonal, so the signal reconstruction is ill-defined, while the Discrete Wavelet Transform (DWT) forms orthogonal or biorthogonal bases which do not produce redundant components in signal analysis.
Limits in signal analysis The Hilbert-Huang Transform, in spite of its good performance in analysing non-linear, non-stationary signals, has no inversion (e.g. there is no process for reconstructing the original signal).
Wavelet bases 1 Wavelet bases like Fourier bases reveal the signal properties through the coefficients of its expansion 2 Wavelets are well localized and few coefficients are needed to represent local transient structure. 3 Wavelet basis defines a sparse representation of piecewise regular signal which may include transients and singularities. 4 In images, the wavelet coefficients are located in the neighborhood of edges and irregular textures. Wavelets form bases for the image compression standard JPEG 2. 5 Wavelets hardly provides frequency content of the signal.
Wavelet bases The story began in 191, when Alfred Haar 1 constructed a piecewise constant function 1 if t <.5 ψ(t) = 1 if.5 t < 1 (1) otherwise the dilatations and translations of which generate an orthonormal basis {ψ l,n (t) = 2 l ψ ( 2 l t n ) } l,n Z 2 (2) 1 October 11, 1885 - March 16, 1933
Haar wavelets 1.8.6.4.2.2.4.6.8 1.5.5 1 1.5 t Figure: Mother Haar waveletψ(t) ψ, (t)
Haar wavelets 1 1.8.8.6.6.4.4.2.2.2.2.4.4.6.6.8.8 1 1.5 1 t.5 1 t Figure: Scaled Haar wavelets ψ 1, (t) and ψ 1,1 (t)
Haar wavelets 1 1.5.5.5.5 1.5 1 t 1.5 1 t 1 1.5.5.5.5 1.5 1 t 1.5 1 t Figure: Scaled Haar wavelets ψ 2, (t), ψ 2,1 (t), ψ 2,2 (t), ψ 2,3 (t)
Haar wavelets A general form of the Haar wavelets can be written explicitly as n 2 l if 2 l t < n+.5 2 l ψ l,n (t) = 2 l if n+.5 2 l t < n+1 2 l (3) else. Each Haar wavelet ψ l,n (t) has a zero average over its support n n+1 2l, 2 l of length 2 l. For any fixed l the function ψ l,n (t) is simply ψ l, (t) translated n units to the right. 2l+1
Haar wavelets Definition The support of a function f(t) defined on R is the closure of the set on which f(t) is nonzero. A function f(t) is said to be supported in a set A R, if the support of f(t) is contained in A. If a function f(t) is supported in a bounded interval, then f(t) is said to have compact support.
Haar wavelets Scalar product f(t) g(t) = 1 dt f(t) g (t) Norm Orthogonality f(t) 2 = 1 dt f(t) f (t) ψ l,n (t)ψ m,n (t) = 1 dt ψ l,n (t)ψ m,n (t) = 2 l δ l,m
Haar wavelets We define Haar scaling function as { 1 if t < 1 φ(t) = else. (4) then any function f(t) can be approximated in arbitrary precision in (, 1) L 2 L 1 f L+1 (t) = c φ(t)+ c l,n ψ l,n (t), (5) where c = f(t),φ(t) = l= n= 1 dt f(t) c l,n = f(t),ψ l,n (t) = 1 2 l dt f(t)ψ l,n (t)
Function approximation Proposition For any f(t) (, 1) with finite energy 1 dt f(t) f (t), the constant value of the approximation f L+1 (t) on any interval n 2 L,(n+1) 2 L is the average value of f(t) on that interval. Proof by induction!
Example 1: Let f(t) = t (1 t)(2 t) on interval t 1. Find approximation of this function with Haar wavelets with L = and L = 1. As the scale function φ(t) is equal 1 for then and c = 1 dt f(t) = 1 ] 1 [ t dt(t 3 3 t 2 4 + 2 t) = 4 t3 + t 2 = 1 4 a1 = 1 dt f(t)ψ, (t) = 2 [ t 4 = 2 4 t3 + t 2 1/2 ] 1/2 = 2 dt(t 3 3 t 2 + 2 t) ( 1 4 7 ) = 9 64 32 (6)
Example 1: a2 = 1 dt f(t)ψ, (t) = 2 [ t 4 = 2 4 t3 + t 2 ] 1 1/2 1 = 2 1/2 dt(t 3 3 t 2 + 2 t) ( 1 4 9 ) 64 = 7 32 (7) so that 9 f (t) = 32 ( 1) 7 32 = 7 32 if t <.5 if.5 t < 1. (8)
Example 1:.4.4.3.3.2.2.1.1.2.4.6.8 1 t.2.4.6.8 1 t Figure: Haar expansion using all waveletsψ, (t), ψ 1, (t) and ψ 1,1 (t) Derive by integration the constant values of [ ] 49 95 81 31 f 1 (t) = 256 256 256 256 and plot the diagrams.
Wavelets There is enormous number of wavelets having names after researchers in 8ties and 9ties. To name few of them Yves Mayer, Stephane Mallat, Ingrid Daubechies... For example, a simple request on Web of Knowledge for Wavelet Transform reveals close to 75 publications in 21/211.
Wavelets in MATLAB Typing waveinfo( wname ) you get information about wavelets Wavelet Family Short Name haar db sym bior rbior meyr dmey gaus mexh morl Wavelet Family Name Haar wavelet Daubechies wavelets Symlets Biorthogonal wavelets Reverse biorthogonal wavelets Meyer wavelet Discrete approximation of Meyer wavelet Gaussian wavelets Mexican hat wavelet Morlet wavelet
Christmas HW Compose your own carol as Jana Kuklová did!! Make your composition smart enough and submit as an extra homework with No.8 by December 19, 217.
Carol Figure: Spectrogram of a carol
Better sound... You can improve the performance of your music composition 1 by including some harmonics to an original tone, i.e. to the tone A, 44 Hz add 88 Hz, 132 Hz... 2 if you make a spectrogram of a real piano tone A you can see relative duration of harmonics
MATLAB homework 1 Deliver your composition by December 19. I am looking for it!
MATLAB project 1 Start MATLAB and create an artificial piecewise constant signal with y=zeros(256,1); y(1:16)=1.; 2 The Discrete Wavelet Transform is provided by MATALB under a variety of extension modes. We can perform a one-stage wavelet decomposition of the signal for example with [ca, cd]=dwt(y, bior2.2 ); 3 Here ca is a vector of the approximation coefficients and cd the detailed coefficients. 4 The bior2.2argument specifies the wavlets to be used, which in this case corresponds to La Gall 5/3 wavelet. 5 You can execute waveinfo( bior ) to see other orthogonal wavelets.
MATLAB project 6 Plot the vectors ca and cd. Since the signal is almost constant, calooks like an approximately half-length version of the original signal. There are some distortions at the jumps. 7 The vector cd is mostly zero except at the discontinuity which contains high frequency energy. 8 Since the signal is implicitly extended at the boundary by symmetric reflection, there are no discontinuities there. 9 We can reconstruct an approximation to the original full length using only coefficients ca by y2=upcoef( a,ca, bior2.2,1); 1 Plot y2!
MATLAB project 11 Change the extension mode to periodic extension with command dwtmode( per ) 12 Periodic extension introduces discontinuities at the signal boundaries. This is obvious in the plots ca and cd and in reconstruction y2 13 Repeat the above steps with another wavelet.
Example 2: Meyer wavelets % Set effective support and grid parameters. lb = -8; ub = 8; n = 124; % Meyer wavelet and scaling functions. [phi,psi,x] = meyer(lb,ub,n); subplot(211) plot(x,psi), grid title( Meyer wavelet ) subplot(212) plot(x,phi), grid title( Meyer scaling function )
Example 2: 1.5 Meyer wavelet 1.5.5 1 8 6 4 2 2 4 6 8 1.5 Meyer scaling function 1.5.5 8 6 4 2 2 4 6 8 Figure: Meyer wavelets