Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Master Thesis MEE-98-01 A SURVEY ON METHODS FOR TIME-FREQUENCY ANALYSIS Jan Mark de Haan _____________________________________________ Master of Science program in Electrical Engineering 1998 University of Karlskrona/Ronneby Department of Signal Processing Examiner: Benny Lövström Supervisor: Jens Augustsson, SSPA Maritime Consulting Version nr Date Updates 1.0 24-06-1997 Start Chapter 1 and Chapter 2. 1.1 07-09-1997 Start Chapter 3 and 4. 1.9 10-10-1997 Towards version 2.0 (Deliverance of chapter 1, 2, 3 and 4). 2.0 16-10-1997 Deliverance of chapter 1, 2, 3 and 4. 2.9 19-12-1997 Chapter 4 rewritten. Addition of 5, 6, 7 and 8. Towards 3.0 3.0 26-01-1998 Deliverance of chapter 5, 6, 7 and 8. 4.0 13-03-1998 Final version. Version 4.0 March 1998 Master Thesis MEE 98-01 Keywords: Signal processing, Time-frequency analysis, Wavelets, Wavelet Packets. $FNQRZOHGJHPHQWV 2 This Master's thesis is the result of my final project at the University of Karlskrona/Ronneby. There are many people whom I'd like to thank for their assistance during the project. First, I would like to thank Jens Augustsson and Erik Pavlica, working at SSPA Maritime Consulting, for their guidance and the possibility to gain knowledge in an exciting field of science. In this context I also would like to thank Martin Almgren. Thanks also goes to Mathias Winberg for the useful discussions and Benny Lövström, both working at the Department of Signal Processing at the University of Karlskrona/Ronneby, for the final comments on my thesis and for the possibility to work on my project at the department. Last but not least, I would like to thank Karl Thorén for reading my thesis thoroughly and Nedelko Grbic and Xiao-Jiao Tao for their inspiring suggestions. Finally I would like to thank everyone who helped me during my project, and Lisa Lorentz for putting up with me during my studies in Sweden. Jan Mark de Haan Ronneby, Sweden 13 March 1998 3 4 $EVWUDFW Time analysis and frequency analysis are both well-established ways in engineering to gain more knowledge about a physical phenomena. Time and frequency analysis can be combined in a joint time and frequency distribution. A simple method to gain a joint distribution is to window segments of the data at different time locations and calculate its Fourier transform. By doing this a set of ´local´ spectra are gained and joined to present a time-frequency distribution. This method is well known as the Short-Time Fourier Transform. The Short-Time Fourier Transform has the disadvantage that is does not localize time and frequency phenomena very well. Instead the time-frequency information is scattered which depends on the length of the window. This can be attended to by altering the length of the window but a certain balance between good time and good frequency localization is unavoidable. To cope with this disadvantage, the Wavelet Transform uses dilated and translated functions, which are local in time, and frequency, which results in good frequency resolution for lowfrequency phenomena and good time resolution for high-frequency phenomena. The advantage of the Wavelet Transform is its efficient fast transform in discrete time. But still, there is no complete solution to the localization problem. Adaptive Time-Frequency Analysis can be advantageous for solving the localization problem. The functionality of methods is hereby adapted to the time-frequency content of the signal. The Adaptive Wavelet Packets Transform is based upon the Wavelet Transform but is a more general way to gain a time-frequency distribution. It is even possible to gain a time-frequency distribution similar to the Short-Time Fourier Transform. The energy levels in the frequency bands determine the frequency resolution. Much energy located in a small frequency band will result in good frequency resolution for that specific band. Other frequency areas will be analyzed with as good time resolution as possible. Sine wave with constant frequency precedes time phenomena. The method is implemented using a fast Quadrature Mirror Filter bank tree which form determines resolution of the analysis. In the Adaptive Window Short-Time Fourier Transform, the time phenomena precede sine waves in the analysis. Good time resolution is gained where the time-frequency concentration is highest for short windows. Other time intervals will be analyzed with a longer window, to gain better frequency resolution. The method is implemented using a set of Fast Fourier Transform calculations. 5 6 7DEOHRI&RQWHQWV Acknowledgements.................................................................................................3 Abstract...................................................................................................................5 Table of Contents....................................................................................................7 1 1.1 1.2 1.3 1.4 Introduction ..........................................................................................................11 Representations ......................................................................................................11 Objectives of this work...........................................................................................12 Mathematical Notations .........................................................................................13 Thesis Organization ................................................................................................13 2 2.1 2.2 2.3 2.4 Uniform Resolution Time-Frequency Analysis..................................................15 Introduction............................................................................................................15 The Fourier transform ............................................................................................15 Towards Time-Frequency Analysis........................................................................17 The Short-Time Fourier transform .........................................................................17 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 Definition ..........................................................................................................................................17 Windowing in the Time-domain........................................................................................................19 Windowing in the Frequency-domain................................................................................................20 The Time-Frequency Plane................................................................................................................21 Time and Frequency Uncertainty.......................................................................................................22 The Heisenberg Uncertainty Principle...............................................................................................26 The Spectrogram ...............................................................................................................................28 The disadvantages of the Short-Time Fourier Transform..................................................................28 2.5 Other Uniform Resolution Time-Frequency Representations................................31 2.5.1 The Gabor transform .........................................................................................................................31 3 3.1 3.2 3.3 Multiresolution Time-Frequency Analysis ........................................................33 Introducing Scale....................................................................................................33 The Multiscale Short-Time Fourier transform........................................................33 The Continuous Wavelet Transform......................................................................36 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 Introduction .......................................................................................................................................36 Definition ..........................................................................................................................................36 Properties of the Continuous Wavelet Transform..............................................................................38 The Continuous Wavelet Transform and the Time-Frequency Plane .................................................39 Profile of the Continuous Wavelet Transform ...................................................................................40 Wavelet radius and bandwidth..........................................................................................................41 The Scalogram...................................................................................................................................41 4 4.1 4.2 Adaptive Time-Frequency Analysis....................................................................43 Introduction............................................................................................................43 The Multiresolution Fourier Transform..................................................................44 4.2.1 4.2.2 Profile of the Multiresolution Fourier Transform..............................................................................44 Wavelet Duration and Bandwidth......................................................................................................46 4.3 Adaptive Window Short-Time Fourier Transform.................................................46 4.3.1 4.3.2 Short-Time Time-Frequency Concentration ......................................................................................47 Optimal Window Time-Frequency Representation ...........................................................................47 5 5.1 5.2 Discrete Short-Time Fourier Transform and Implementations.......................49 Introduction............................................................................................................49 Parameter Discretization ........................................................................................49 7 5.3 Discrete Short-Time Fourier Transform................................................................. 51 5.3.1 5.3.2 Discrete Fourier Transform.............................................................................................................. 51 Windowing in discrete time .............................................................................................................. 52 5.4 Time domain based implementations..................................................................... 53 5.4.1 5.4.2 Redundant discrete STFT ................................................................................................................. 54 Non-redundant discrete STFT........................................................................................................... 56 5.5 Frequency domain based implementations............................................................ 58 5.5.1 5.5.2 Redundant discrete STFT ................................................................................................................. 58 Non-redundant discrete STFT........................................................................................................... 60 6 6.1 6.2 6.3 Wavelet Transforms and Implementations........................................................ 63 Introduction ........................................................................................................... 63 Parameter Discretization: Discrete Wavelet Transform........................................ 63 Multiresolution Analysis ........................................................................................ 65 6.3.1 6.3.2 Subspaces, Scaling functions and Wavelet functions ........................................................................ 65 Wavelet composition and decomposition ......................................................................................... 67 6.4 Fast Wavelet Transform ........................................................................................ 68 6.4.1 6.4.2 Quadrature Mirror Filter Bank.......................................................................................................... 68 Discrete Wavelet Transform implemented by a QMF-tree ............................................................... 69 6.5 Implementations..................................................................................................... 70 6.5.1 6.5.2 Continuous Wavelet Transform......................................................................................................... 70 Fast Wavelet Transform.................................................................................................................... 71 7 7.1 7.2 Adaptive Transforms and Implementations ...................................................... 73 Introduction ........................................................................................................... 73 Wavelet Packets .................................................................................................... 74 7.2.1 7.2.2 7.2.3 7.2.4 7.2.5 7.2.6 Expansion of the MRA...................................................................................................................... 74 Wavelet Packets composition and decomposition ............................................................................ 75 FWT based upon the expanded MRA ............................................................................................... 76 Energy Prediction and Tree Pruning ................................................................................................. 77 Calculation of Filter Coefficients ..................................................................................................... 77 Implementation.................................................................................................................................. 78 7.3 Adaptive Window Short-Time Fourier Transform................................................. 80 7.3.1 7.3.2 Optimal adaptive window ................................................................................................................ 80 Towards an efficient implementation................................................................................................ 80 8 8.1 8.2 8.3 Conclusions........................................................................................................... 85 Introduction ........................................................................................................... 85 Comparison of Results........................................................................................... 85 Further Reading ..................................................................................................... 88 References............................................................................................................. 91 Index...................................................................................................................... 95 Appendix............................................................................................................... 99 Appendix A: Symbol List..................................................................................... 101 Appendix B: Abbreviations ................................................................................. 103 Appendix C: Mathematical Proof........................................................................ 105 8 9 1 Introduction THIS PAGE IS NOT PART OF THE THESIS DOCUMENT COVERS PAGES 1-14 Organization of this chapter: 1 Introduction _________________________________________________________ 10 Representations___________________________________________________________ 11 1.2 Objectives of this work ____________________________________________________ 13 1.3 Mathematical Notations ____________________________________________________ 13 1.4 Thesis Organization _______________________________________________________ 13 10 1.1 &KDSWHU ,QWURGXFWLRQ 5HSUHVHQWDWLRQV When dealing with physical objects, many of its different faces, or, representations are encountered. For example numbers in various systems can be represented depending on the application; in real life we use the decimal system, while for use in computers we employ the binary representation of numbers. Consequently in many fields, such as signal processing, a preliminary task is to find an adapted representation of the data that may be particularly suitable for a problem. A certain representation can reveal certain aspects; other representations preserve integrity while reducing the amount of data. A way to obtain a specific representation is to decompose a datasequence or signal into elementary building blocks, which have certain importance. This is often achieved with a technique that is called transformation. Moreover, these building blocks have to reveal unique information. Then the question raises how to decompose a signal. A fast algorithm is desired, to perform the decomposition, since otherwise a particular decomposition might be only of theoretical importance. In a practical situation, the possibilities concerning speed of computations and the data storage space are limited. Once these building blocks are collected, the data sequence might be composed of the blocks to approximate the original sequence as good as possible, usually with an inverse transform. A goal of a transform might be the reduction of size of the signal; therefore we need to be able to compose the signal with only the few building blocks we gained from the transform, so that it is a desirable approximation of the original signal. One of the classic sets of tools to achieve a different representation of a signal is the Fourier theory. The Fourier integral gives a continuous-time decomposition while its discrete variant gives a discrete-time decomposition, which can be implemented using a fast algorithm. 11 Although the algorithms differ, the underlying mathematical ideas are the same for these representations. The representation of a signal by means of the Fourier theory is essential to solve many problems in pure mathematics and in applied science. However, it is in some instances not the most natural or useful way of representing a signal. For example, music or speech are signals in which the spectrum evolves over time in a significant way. At each moment in time the ear hears a certain combination of frequencies, and that these frequencies are constantly changing. This time evolution of frequencies is not reflected in the Fourier transform1, because it decomposes over the infinite time interval. In theory a signal can be reconstructed from its Fourier transform, but the transform contains information about the frequencies of the signal over all times instead of showing how the frequencies vary with time. It is desired to see how the frequency content of a signal varies with time in the way musical score serves the musician see figure 1.1. An analysis is wanted comparable to an exercise called musical dictation which is writing a note, or a set of notes, at certain pitch levels (frequencies) at the proper horizontal position (time) on the bars. Figure 1.1: Musical score can be seen as a time-frequency representation. A representation, which combines time and frequency, is gained by performing timefrequency analysis. Several methods exist to decompose a signal in time-frequency components. The most common methods can be divided in two groups: • Uniform time-frequency analysis • Multiresolution time-frequency analysis. 1 The Fourier Transform is usually split up in an amplitude spectrum and a phase spectrum. The amplitude spectrum representation, which is meant in the text, does not show time information of the original signal. The time information is however conserved in the phase spectrum. 12 2EMHFWLYHVRIWKLVZRUN The main objective of this work is to describe the properties and limitations of time-frequency analysis, by presenting basic methods to give background to its problems and an introduction to more advanced methods, dealing with these limitations. The aspects of wavelets in general are investigated, and more thorough, their benefits in time-frequency analysis. Simply how wavelets can be used to workaround the limitations of basic methods. Adaptive time-frequency analysis is investigated, and how it can increase the value of a multiresolution time-frequency analysis with wavelets. The discussed methods will be implemented in MATLAB, to show advantages, disadvantages and above all the distinctions between the methods. 0DWKHPDWLFDO1RWDWLRQV The mathematical notations in this thesis make use of many superscripts and subscripts. In order to make this thesis readable for a relatively large audience; an attempt has been made to use this notation in a consistent manner. A large letter indicates a continuous variable, which can adopt a value out of an infinite amount of numbers. A small letter indicates the discrete version, which can only adopt a number out of a finite amount of numbers. If they have a subscript attached they are a constant and do not vary within a range of values. Functions, however, are written with small letters for continuous functions as well as discrete functions. The large letters are used to refer to other representations than time-domain representation, e.g. the Fourier Transform. 7KHVLV2UJDQL]DWLRQ This thesis is divided into two main parts. The first part describes the fundamental theories and the continuous cases of the time-frequency analysis. The second part describes the discrete cases and implementations. Each part is divided in three chapters, see table 1.1. PART 1, Chapter 2-4 1. Uniform 2. Multires PART 2, Chapter 5-7 3. Adaptive 1. Uniform 2. Multires 3. Adaptive Fundamental theory Fundamental theory Fundamental theory Discrete parameters Discrete parameters Wavelet Packetes Continuous STFT Continuous WT Continuous MRFT Full discrete STFT Full discrete WT Adap. window STFT Adap. window STFT Implementations Implementations Implementations Table 1.1: Thesis organization. 13 14 &KDSWHU 8QLIRUP5HVROXWLRQ7LPH)UHTXHQF\ $QDO\VLV ,QWURGXFWLRQ This chapter is divided in four parts. The first part describes one of the most important transforms in signal processing, which is the Fourier transform. The Fourier transform reveals the notion of frequency in a signal. The time-frequency analysis introduced in this chapter is based on this transform. After a short introduction towards time-frequency analysis, the easiest method for uniform resolution time-frequency analysis is introduced: the short-time Fourier transform, and its spectrogram representation. The time-frequency plane is described which is the basis for a representation of a signal in both time and frequency. The windowing-in-time technique and its filterbank interpretation are discussed. Also the name for this chapter is justified, resulting in a general limitation of combined time-frequency analysis; the Heisenberg uncertainty principle. Finally the disadvantages of uniform resolution time-frequency analysis are depicted. The last section gives a short overview of other, to the short-time Fourier transform related time-frequency representations. 7KH)RXULHUWUDQVIRUP Time-frequency analysis exploits ordinary frequency analysis with the Fourier transform. The latter of the time-frequency methods use the time wise decomposition of a signal in its frequencies. With the Fourier transform, a time representation of a signal, x( T ) , is transformed into a new function X FT (F ) of which the absolute value gives a frequency representation. 15 First in 1807, Jean-Baptiste Fourier discovered, partly based on work done by Daniël Bernoulli, that any periodic function could be decomposed into only sinewaves. The Fourier series of any periodic function (Theorem of Euler-Fourier) shows how it is composed of elementary infinite sines and cosines. This theorem concerns only those sines and cosines that are integer multiplies of a base frequency 2Tπ0 [CM90]: 2πkT 2πkT + bk sin x( T ) = a 0 + ∑ a k cos T0 T0 k =1 ∞ 1 2 The coefficients a and b rely on the function being analyzed and are called its Fourier coefficients. The term 12 a0 is the coefficient of the constant function cos2π 0T = 1 . It is in many aspects easier to work with the complex exponential function e jθ instead of the trigonometric functions cosθ and sin θ because it reduces computational efforts, for example 1 with differentiation and addition . Using the relations cosθ = 21 (e jθ + e − jθ ) and sin θ = 1 2j (e jθ − e − jθ ) , the Fourier series expansion can be rewritten to: ∞ ∑c e x( T ) = k =−∞ where c0 = 21 a0 , c k = 1 2 (a k − jbk ) and c− k = 1 2 j 2πkT T0 k (a k + jbk ) for k = 1,2,3,... The coefficients c k can be calculated with the following formula [CM90]: 1 ck = T0 T0 2 ∫ x( T ) e − j 2πkT T0 dT − T0 2 The Fourier transform calculates the Fourier coefficients X FT ( F ) of a Fourier series expansion of the non-periodic function x( T ) on the whole real line R = − ∞ , ∞ . The expansion is defined as continuous superpositions of the analyzing function e − j 2πFT : X FT ( F ) = ∞ ∫ x (T )e − j 2πFT dT (2-1) −∞ or, if using the angular frequency Ω = 2π F : ∞ X (Ω) = ∫ x( T ) e − jΩT dT −∞ The analysis coefficients X FT ( F ) in (2-1) define the notion of frequency F in the signal. The inverse Fourier transform is defined by: 1 d dθ 16 e jθ = je jθ , e j (θ +ξ ) = e jθ e jξ x(T ) = 1 2π ∞ ∫ X FT (F )e j 2πFT dF −∞ The analysis function is a complex periodic function. As a result, Fourier analysis works well if x( T ) is composed of stationary (wave) components2. However, any abrupt change in time in a non-stationary signal is spread out over the whole frequency domain in X FT (F ) . Therefore, an analysis adapted to non-stationary signals requires more than the Fourier transform. 7RZDUGV7LPH)UHTXHQF\$QDO\VLV The usual approach is to introduce time dependency into the Fourier analysis while preserving linearity. In the next section, a translation-parameter is introduced which refers to the specific time interval or window wherein the signal is approximately stationary. A function of two variables, time and frequency, is introduced, meant to be a joint distribution representing the time-varying spectral properties of the signal. A time-frequency distribution should show which frequencies are present at a given time. A simple and intuitive way to achieve such a distribution is through the use of the short-time Fourier transform (STFT). In the next section the STFT will be introduced, a transform that results in a local spectrum with the windowing-in-time technique. Then a relationship with the ordinary Fourier transform is established, which shows that windowing in the time-domain is equal to windowing in the frequency-domain. The result of the transform can be mapped into a twodimensional plane, which is called the time-frequency plane. The following section then shows by examples that windowing in time and frequency involves the loss of measuring accuracy and thus introduces uncertainty, which is known as the Heisenberg uncertainty principle. 7KH6KRUW7LPH)RXULHUWUDQVIRUP 'HILQLWLRQ The Short-Time Fourier Transform (STFT) or windowed Fourier transform is a transform that yields a representation of sequences of any length by breaking them into shorter sections, and applying the Fourier transform to each section. This is a time-frequency localization technique in that it computes the frequencies associated with small segments of the signal. For each section, the STFT calculates its Fourier transform. The continuous STFT is defined as [CC92]: 2 x(T ) = ∑e jΩ nT ∀n 17 X STFT (Tˆ , Fˆ ) = ∞ − j 2πF T dT ∫ x(T )w(T − Tˆ )e ˆ (2-2) −∞ The window w( T ) that is used is local in time, it is zero for values of T outside the window. The line above the window function means complex conjugate. The choice of the window function is important. Section 2.4.5 will clarify the need to consider carefully the choice of window duration and the shape. If we compare the transform to the ordinary Fourier transform, it can be recognized that the analyzing function e − j 2πFT is replaced by a variant, which is local in time, since it's multiplied with the window function. The new analyzing function is therefore local in time and has a fixed duration for all frequencies. The frequency inside this window varies, just like the frequency of the analyzing function in the ordinary Fourier transform does indefinitely over all times. The analyzing function of the STFT is defined as [CC92]: 2 ˆ g Tˆ , Fˆ (T ) = w(T − Tˆ )e j πFT (2-3) It contains the variables Tˆ and F̂ that represent time and frequency in the so-called timefrequency plane which will be discussed in section 2.4.4 Figure 2.1 shows the analyzing function with a specified length and for a specific value of the frequency F̂ . a) b) 1 1 1 0.5 0.5 g(T) g(T) 0 Amplitude 0 Amplitude 0 -0.5 0 -0.5 -1 -1 -1 -1.5 1 -50 -1 -50 00 Time T 5050 -1.5 -50 -50 00 Time T 5050 Figure 2.1: The analyzing function of the STFT g 0,4 (T ) . a) Real part, b) Imaginary part. F̂ =4 and the window used is a Hamming window with duration 100. The analyzing function has instances, each connected to specific values for Tˆ and F̂ . The instances are translated across the time-domain due to parameter Tˆ . This translation is shown in figure 2.2. Three instances of the analyzing function are given at different locations Tˆ , and have different values for F̂ . Notice that the analyzing function can be located at any Tˆ , 18 contain any frequency F̂ and has uniform duration which means that the analyzing function has the same duration for all Tˆ and F̂ . 1 1 Amplitude 0 0 -1 -1 g(T) 0.5 -0.5 -1.5 -50 00 5050 100100 150 T Time Figure 2.2: Three instances of the analyzing function of the STFT. The instances are from left to right: g 0, 501 (T ) , g 75, 251 (T ) and g150, 252 (T ) . :LQGRZLQJLQWKH7LPHGRPDLQ Two important properties of the analysis function g (T ) are its center T0 and its radius ∆ g (T ) . They are defined by [CM90]: ∞ T0 = ∫ T g (T ) −∞ 2 dT (2-4) g (T ) 2 2 ∞ ∆2g (T ) = Where g (T ) 2 = 2 ∞ ∫−∞ g (T ) 2 2 2 ∫ (T − T0 ) g (T ) dT −∞ g (T ) 2 2 (2-5) dT is the energy of the analysis function. (2-4) And (2-5) are also well known properties in statistics, namely mean and variance [HB96]. The duration of the analysis function can be calculated with 2∆ g (T ) . The STFT gives local information of x( T ) in the time-window: T0 + Tˆ − ∆ g (T ), T0 + Tˆ + ∆ g (T ) 19 :LQGRZLQJLQWKH)UHTXHQF\GRPDLQ A relation can be established between the STFT X STFT (Tˆ , Fˆ ) , and the Fourier transform X FT (F ) of the original signal x( T ) . First, an analysis function in the frequency domain needs to be determined, which is the Fourier transform of the analysis function in the time domain GFT (F ) = FT [g (T )] . The Fourier transform of the analyzing function g (T ) is: GFT (F ) = e − j 2π ( F − Fˆ ) Tˆ W FT ( F − Fˆ ) Using (2-2), the definition of the STFT can be rewritten to: X STFT (Tˆ , Fˆ ) = ∞ ∫ x(T )g (T )dT −∞ The Parseval Identity ∞ ∞ ∫−∞ x(T )g (T )dT = 2π ∫−∞ X FT (F )GFT (F )dF 1 X STFT (Tˆ , Fˆ ) = = 1 2π 1 2π 1 = 2π is used to rewrite (2-2) to: ∞ ∫ X FT (F )G FT (F )dF −∞ ∞ j ∫ X FT (F )e −∞ ∞ 2π ( F − Fˆ )Tˆ WFT ( F − Fˆ )dF (2-6) ∫ X FT (F )e −∞ 2 = (e − j πFT ) ⋅ ˆˆ 1 2π − j 2πFˆ Tˆ W FT ( F − Fˆ )e j 2πFTˆ dF ∞ ˆ )e j 2πFTˆ dF ( ) ( X F W F − F FT FT ∫ −∞ where a relationship is given between the STFT and the Fourier transform of a signal x( T ) . The result of (2-6) and the definition (2-2) shows the relationship between windowing in the time-domain and windowing in the frequency-domain: ∞ ∫ x(T )w(T − Tˆ)e − j 2πFˆT dT −∞ = (e − j 2πFˆTˆ ) 1 ⋅ 2π ∞ ∫ X FT (F )WFT (F − Fˆ )e (2-7) j 2πF Tˆ dF −∞ With the exception of the factor ( e − j 2πFT ) one can see that ”the windowed-in-time Fourier transform of x(T ) is similar to ”the windowed-in-frequency inverse Fourier transform X FT (F ) ”. ˆˆ We can also interpret W FT (F ) being the transfer function, and g (T ) = w(T )e j 2πFT the impulse response of an infinite set of bandpass filters. X STFT (Tˆ , Fˆ ) is then an infinite set of signals, ˆ associated with the outputs of these bandpass filters. The outputs of these filters can be 20 calculated using equation (2-6), which can be interpreted as an inverse Fourier transform of the signals Fourier transform multiplied with the transfer function of each bandpass filter. Or with equation (2-7), which can be interpreted as a convolution integral, which calculates the convolution of the signal in the time-domain with all the impulse responses. Similar as done in the time-domain we can calculate the center frequency F0 and the radius ∆ GFT (F ) of the window function GFT (F ) [CC92]: ∞ F0 = ∫ F G FT (F ) −∞ ∞ 2 ∆ GFT (F ) = Where G FT (F ) 2 = ∫ 2 ∞ −∞ dF G FT (F ) 2 2 ∫ (F − F0 ) −∞ 2 2 G FT (F ) dF 2 GFT (F ) 2 2 (2-8) GFT (F ) dT is the energy of the analysis function. The width of the 2 analysis function, the bandwidth, can be calculated with 2∆ GFT (F ) . The result in (2.14) gives local spectrum information of x( T ) in the frequency-window [CC92]: F0 + Fˆ − ∆ GFT (F ) , F0 + Fˆ + ∆ GFT (F ) The choice of window function has to be taken carefully, since windowing of the signal in the time domain means filtering of the signal in the frequency domain. A window that is local in time and local in frequency is required. The choice of the window depends on the requirements on accurate amplitude measurement weighted against spectral leakage [PJ96]. 7KH7LPH)UHTXHQF\3ODQH The absolute value of the short-time Fourier transform X STFT (Tˆ , Fˆ ) can be mapped into a two-dimensional plane with a time axis and a frequency axis. This is called an amplitude time-frequency distribution. The two previous sections defined the windows in respectively time and windows in frequency. These windows generate rectangular time-frequency frames or sometimes called Heisenberg frames. They are defined by [CC92]: T0 + Tˆ − ∆ g (T ) , T0 + Tˆ + ∆ g (T ) × F0 + Fˆ − ∆ GFT (F ) , F0 + Fˆ + ∆ GFT (F ) 21 2∆ F̂ g(T) F̂2 2∆ G(F) F̂1 0 Tˆ1 Tˆ2 Tˆ Figure 2.3: Location of time-frequency frames in the Time-Frequency Plane. The related analysis functions are ˆ ˆ g ˆ ˆ ( T ) = w ( T − Tˆ1 ) e j 2 π F T and g ˆ ˆ ( T ) = w ( T − Tˆ2 ) e j 2 π F T 1 2 T1 , F1 T2 , F 2 The shape of the frames depends on the duration of the window in time and the bandwidth of its Fourier transform. Due to the scaling property of the Fourier transform, the areas of the frames are the same for any window length [CM90]: FT [x( aT ) ] = 1 F X FT a a (2-9) If the duration of the analysis function is increased, the bandwidth decreases proportionally. This means that only the shape of the window influences the area of the time-frequency frame. 7LPHDQG)UHTXHQF\8QFHUWDLQW\ A simple example showing an important property of the STFT is that for windows with infinite size in the time- and -frequency-domain [PE91]. The STFT of the function x( T ) can be calculated using the Dirac impulse as the window function: w( T ) = δ (T ) , so that its Fourier transform is W FT ( F ) = 1 . This is rather strange and it does not reflect a very practical situation but it shows what one might expect. Using (2-6): X STFT (Tˆ , Fˆ ) = (e − j 2πFˆ Tˆ 1 )⋅ 2π ∞ ∫ X FT (F ) ⋅1 ⋅ e −∞ j 2πFTˆ dF (2-10) = x(Tˆ ) If the result is mapped into the time-frequency plane we gain the time-domain representation of the original function x( T ) which is not very surprising. If a window w( T ) is used, that is infinitely small, and therefore a window W FT (F ) that is infinitely long, the time-domain representation of the function x( T ) is gained. A similar calculation, can be done by setting the window w( T ) = 1 and therefore its Fourier transform W FT (F ) = δ (F ) , using (2-7): 22 = X STFT (Tˆ , Fˆ ) ∞ ∫ x (T ) ⋅1⋅ e − j 2πFˆ T dT (2-11) −∞ = X FT ( Fˆ ) If this result is mapped into the time-frequency plane, the frequency-domain representation of the original function x( T ) is gained. If a window w( T ) is used that is infinitely long, and therefore a window W FT (F ) that is infinitely small, the normal time-domain representation of the function x( T ) is gained. The calculations (2-10) and (2-11) do not reflect a practical situation. The results however are important. They implicate that the smaller the window w(T ) , the sooner a representation is obtained which is similar to the time-domain representation. The smaller the window W FT (F ) , the sooner a frequency-domain similar representation is obtained. The STFT is thus a representation that lies between the time-domain representation and the frequency-domain representation. The following examples show that it is not possible to get an ideal time-frequency representation. A simple example signal consists of a single complex sinusoid [PE91]: x(T ) = e j 2πF x T Using (2-2) and any window w( T ) to calculate its STFT: X STFT (Tˆ , Fˆ ) = = ∞ ∫ x(T )w(T − Tˆ )e −∞ ∞ ∫e j 2πFxT − j 2πFˆT dT 2 ˆ w(T − Tˆ ) e − j πFT dT (2-12) −∞ = W FT ( Fˆ − Fx ) The idealized representation would be a Dirac function located at Fx for all times Tˆ , since x( T ) only consists of one frequency. The STFT though yields the window function with its center located at Fx . The relation between the idealized representation is clear but there is a loss of accuracy, a loss of resolution. Figure 2.4.a shows the idealized representation with infinite resolution and accuracy, which is a straight line at the oscillation frequency Fx . Figure 2.4.b shows the STFT representation of the complex sinusoid, which is the Fourier transform of the window function. 23 a) b) Figure 2.4: X STFT (Tˆ , Fˆ ) representation of the STFT of a single complex sinusoid with F x =50. a) Idealized representation, b) STFT representation using Hamming window. Another example is the calculation of the STFT of a Dirac impulse located at time Tx [PE91]: x(T ) = δ (T − Tx ) Using (2-6) and the window (2-13) w( T ) , with its Fourier transform W FT (F ) and X FT ( F ) = e − j 2πFT x to calculate the STFT yields: X STFT (Tˆ , Fˆ ) = ( e − j 2πFT ) ˆˆ 1 2π ∞ j 2πFT ∫ X FT (F )WFT ( F − Fˆ )e dF ˆ −∞ ∞ 1 − j 2πFTx ˆ )e j 2πFTˆ dF e W F F ) ( = (e − FT 2π −∫∞ ˆˆ 1 j 2 Fˆ Tˆ w(Tˆ − Tx ) e j 2πFT = (e− π ) 2π w(Tˆ − Tx ) = 2π − j 2πFˆ Tˆ (2-14) This case is more or less similar to that of the sinusoid in the example above. One might expect a Dirac impulse at T = Tˆx for all frequencies F̂ , but instead the STFT yields the time window located at T = Tˆx for all frequencies F̂ . Even with this example, a loss of resolution occurs. But even here, the relation between the idealized representation and the one that is yielded by the STFT is still clear. Figure 2.5 shows the idealized time-frequency representation of a Dirac impulse located at T = 50 . The STFT representation of the Dirac impulse shows the result of (2-14), the time window with its center located at T = 50 . 24 a) b) Figure 2.5: X STFT (Tˆ , Fˆ ) representation of the STFT of a Dirac impulse located at T =50. a) Idealized representation, b) STFT representation using the same Hamming window as in figure 2.4. This final example of two complex sinusoids and two Dirac impulses will illustrate the need for larger or smaller time window [PE91]: x(T ) = e j 2πF1T + e j 2πF2T y (T ) = δ (T1 ) + δ (T2 ) Using the results of (2-24) and (2-26) the STFTs of x(T ) and y (T ) are: X STFT (Tˆ , Fˆ ) = W FT ( Fˆ − F1 ) + WFT ( Fˆ − F2 ) YSTFT (Tˆ , Fˆ ) = 1 2π {w(Tˆ ) + w(Tˆ )} 1 2 The following three figures will show the STFT representations of x(T ) and y (T ) for three different radii ∆ g (T ) : a) b) Dirac impulse at T=35 and T=65 Sinusoid at F=45 and F=55 Window width = 50 Window width = 50 25 c) d) Dirac impulse at T=35 and T=65 Sinusoid at F=45 and F=55 Window width = 20 Window width = 20 e) f) Dirac impulse at T=35 and T=65 Sinusoid at F=45 and F=55 Window width = 14 Window width = 14 Figure 2.6: STFT representation of two Dirac impulses (a,c,e) and two sinusoids (b,d,f). It clearly shows the Fourier scaling theorem and inaccuracy that occurs when an analyzed signal would consist of both long duration frequencies and transients. It shows the need of longer windows for long duration frequencies and shorter windows for transients. 7KH+HLVHQEHUJ8QFHUWDLQW\3ULQFLSOH A signal cannot be concentrated in both time and frequency. It simply takes time for a frequency to exist. The areas of the time-frequency frames are lower bounded, which limits the choice of resolution in the time-frequency plane [CC92]. The area of a frame is calculated with (2-5) and (2-8), where is assumed that T0 = 0 and F0 = 0 : (4∆ By using 26 g (t )∆ GFT (F ) ) 2 = 16 g (T ) 2 2 ∞ 2 1 T g (T ) 2 dT ∫ G (F ) 2 −∞ FT 2 ∞ 2 F GFT (F ) 2 dF ∫ −∞ (2-15) F GFT (F ) = 2 2 FT [g ' (T )] 1 4π 2 2 (A-3) and the Parseval Identity, (2-15) can be rewritten: (4∆ g (t )∆ GFT (F ) ) 2 = 16 ⋅ 2π g (T ) 2 G FT (F ) 2 2 2 ∞ 2 ∞ T g (T ) 2 dT 1 g ' (T ) 2 dT 2 ∫ ∫ 4π −∞ −∞ (2-16) We can now use the Cauchy-Schwarz inequality, which defines the lower boundary of the product of the length of two vectors v and w by the scalar product v , w . If v and w are vectors in an infinite dimensional space they can be seen as functions. The length of v can 12 ∞ 2 then be calculated with ∫ [v(T )] dT . The scalar product v , w can be calculated with − ∞ ∫ ∞ −∞ v( T ) w( T )dT . Setting v( T ) = T g( T ) and w(T ) = g ' (T ) , the Cauchy-Schwarz inequality can be written as [CC92]: ∞ ∞ 2 ∞ 2 2 ∫ T g (T ) dT ∫ g ' (T ) dT ≥ Re ∫ Tg (T )g ' (T )dT −∞ − ∞ −∞ 2 If this is substituted in (2-16): (4∆ g (t ) ∆ G(F ) ) 2 ≥ ≥ ≥ 16 ⋅ 2π g (T ) 2 GFT (F ) 2 2 2 16 ⋅ 2π g (T ) 2 GFT (F ) 2 16 ⋅ 2π 2 2 g (T ) 2 GFT (F ) 2 1 1 ≥ 2 ⋅ 2 g (T ) 2 π 2 2 ∞ 1 ⋅ 2 Re ∫ Tg (T )g ' (T )dT 4π −∞ 2 1 1 ∞ d 2 ⋅ 2 ∫ T g (T ) dT 4π 2 −∞ dT 2 1 ( ) ⋅ 2 g T 2 16π 2 If g (T ) has unit energy the above yields that the area of any time-frequency frame is at least 1 , so that the product of the radii ∆ g (T ) and ∆ GFT (F ) is bounded by: π ∆ g (T )∆ GFT (F ) ≥ 1 4π This is known as the Heisenberg uncertainty principle. The Heisenberg uncertainty principle applies with localizing frequency in time with any time-frequency analysis. It is not possible to have arbitrarily good time resolution simultaneously with good frequency resolution. A long time window gives poor time resolution but relatively good frequency resolution. A large bandwidth window gives poor frequency resolution but relatively good time resolution. A certain uncertainty is unavoidable. 27 The variables Tˆ and F̂ are the centers of the uncertainties and time-frequency information is spread out within a range ± ∆ g (t ) and ± ∆ GFT (F ) around Tˆ and. Note that the area of a timefrequency window only depends on the shape of the window and the duration of the window. 7KH6SHFWURJUDP The spectrogram is a way to visualize the STFT. It is defined by [RO91]: X STFT (Tˆ , Fˆ ) 2 = ∞ ∫ x(T ) w(T − Tˆ )e −∞ 2 − j 2πFˆ T dT 1 = 2π ∞ ∫ X FT (F )WFT (F − Fˆ )e 2 j 2πFTˆ dF −∞ It shows how the energy of the signal is distributed over the time-frequency plane. The spectrogram is often presented as an image of which the colors or gray-scales indicate the energy. Two examples are given in figure 2.7. 7KHGLVDGY DQWDJHVRIWKH6KRUW7LPH)RXULHU7UDQVIRUP A disadvantage with the STFT is that it poorly resolves phenomena which have a duration shorter than the duration of time window. Moreover, shortening the window to increase time resolution may result in unacceptable increases in computational effort of an implementation, especially if the short-duration phenomena being investigated do not occur very often. One of the biggest disadvantages however, due the Fourier scaling property described in section 2.4.4, is that it also involves less good frequency resolution. The limitation described in 2.4.6, the Heisenberg uncertainty principle is also a disadvantage, but this regards time-frequency analysis in general. The limitation described by the Fourier scaling property makes us choose between relatively good time or frequency resolution. This implies that in the case of the STFT, we are forced to choose whether we require good time or good frequency resolution due the window that has a fixed length over the entire time-frequency plane. A signal that contains both low frequency components with long duration and high frequency transients of short duration cannot be analyzed simultaneously using the STFT. A way to overcome this limitation is to introduce scale. This technique will be introduced in chapter 3. 28 Magnitude [dB] -20 -30 -40 -50 -60 0 2000 4000 6000 8000 Frequency [Hz] SPECTROGRAM x 0 1 Time [s] 2 3 4 5 0 1 600 0 0 0 1 TeM Magnitude Figure 2.7.a: Spectrogram of a synthetic signal containing two local sine waves and two Dirac impulses. Furthermore, random noise with uniform distribution was added. The length of the signal is 1024 samples. Sampling frequency is 16,384 Hz. Used window is a 128 sample Hamming window. The spectrogram is generated using 512-point DFTs with a stride of 1 sample, overlapping is thus maximal and the spectrogram approximates the continuous STFT. The figures above and to the right are respectively frequency-domain and time-domain representations of the signal. 29 Magnitude [dB] -20 -30 -40 -50 -60 0 2000 4000 6000 8000 Frequency [Hz] SPECTROGRAM x 0 1 Time [s] 2 3 4 5 600 0Magnitude 0 0 0 11 TeM Figure 2.7.a: Spectrogram of a synthetic signal containing two local sine waves and two Dirac impulses. Furthermore, random noise with uniform distribution was added. The length of the signal is 1024 samples. Sampling frequency is 16,384 Hz. Used window is a 512 sample Hamming window. The spectrogram is generated using 512-point DFTs with a stride of 1 sample, overlapping is thus maximal and the spectrogram approximates the continuous STFT. The figures above and to the right are respectively frequency-domain and time-domain representations of the signal. 30 2WKHU8QLIRUP5HVROXWLRQ7LPH)UHTXHQF\ 5HSUHVHQWDWLRQV 7KH*DERUWUDQVIRUP The Gabor transform is a special variant of the STFT. It uses any Gaussian function as window function [CC92]. The use of a Gaussian window function has analytical advantages. It generates the smallest possible time-frequency windows, according to the Heisenberg uncertainty principle. The Gaussian window function is defined by: −T 4α 2 1 w(T ) = e 2 πα Its Fourier transform W FT (F ) is: W FT (F ) = e − 4π F α 2 2 The energy w(T ) 2 is easy calculated using the definition of the Fourier transform: 2 2 w(T ) 2 = = ∞ ∫ w(T ) 2 ∫ w(T ) 2 −∞ ∞ −∞ = 1 2 πa ∞ dT e − j 2πFT dT where F = 0 (2-17) ∫e 2 −T 2α − j 2πFT e −∞ − 12 = (8πa ) e −2απ −1 = (8πa ) 2 2 F 2 ∞ Using (2-5), the result of (2-17) and equation dT ∫T 2 − e 2 T 2α dT = −∞ 3 π (2α )2 , of which a proof is 2 given in the appendix, the radius ∆ w(T ) can be calculated: ∆ w(T ) = w(T ) 2 −1 ∞ ∫ T w(T ) 2 2 dT −∞ 1 2 3 1 π 2 (2α ) = (8πα ) ⋅ 4πα 2 = α 1 4 (2-18) If we now take a closer look at the definition of the STFT (2-7), where we use the Gaussian as a window function we see that almost the same window is used with time windowing as well as frequency windowing: 31 1 2 πα ∞ ∫ x(T )e −(T −Tˆ ) 2 1 4α e− j 2πFˆ T dT −∞ = (e − j 2πFˆTˆ )⋅ 1 2π Windowing in time takes place with w(T ) = e W FT (F ) = e − 4π 2αF 2 ∞ ∫ X FT (F )e 2 2 −4π ( F − Fˆ ) α ej 2πFTˆ dF −∞ 2 −T 4α and windowing in frequency with . Windowing in frequency is hereby similar to windowing in time, with the difference that α has been replaced by 1 16απ 2 : W FT (F ) = w(T ) T → F 1 = e α→ 2 2 − 16π αF 4 = e− 4π 2αF 2 16 απ 2 We can now calculate the area of a frame in the time-frequency plane, using this result and (2-18): ( 2∆ g (T ) )( 2∆ G ( F ) ) = ( 2 α )( 2 1 16π 2α )= 1 π (2-19) Which is the smallest possible area size, according to the Heisenberg uncertainty principle mentioned in 2.4.6. 32 &KDSWHU 0XOWLUHVROXWLRQ7LPH)UHTXHQF\$QDO\VLV ,QWURGXFLQJ6FDOH In the previous chapter, the importance of the Heisenberg uncertainty principle in timefrequency analysis was depicted. In this chapter multiresolution time-frequency analysis is introduced, which simply means that a signal is analyzed, using a set of time-frequency frames where the resolution is changed according to a scale parameter. The multiscale short-time Fourier transform, described below, generates a set of timefrequency planes with different resolutions, related to a scale parameter, and therefore generating a multiresolution analysis. Each plane has though uniform resolution. The wavelet transform and related transforms, which will be described in section 3.3, and further, generate a multiresolution time-frequency plane. General wavelet transforms generate a plane related to the translation parameter, already introduced with the STFT, and a scale parameter that will be introduced. These wavelet transforms are used in time-scale analysis. This way of analysis is very natural when analyzing structures and surfaces, which is the case in image processing and geophysics. Time-frequency analysis can be obtained by relating the scale parameter to frequency. 7KH0XOWLVFDOH6KRUW7LPH)RXULHUWUDQVIRUP To gain a presentation for time-frequency analysis that covers the relatively accurate measurement of all possible components of a signal, scale can be added to the STFT as a fourth dimension. In [PE91] a method is described which generates a series of STFT uniform resolution time-frequency planes with a different resolution for each plane. Pearson refers to this method as the Multiresolution Fourier Transform (MFT). This method will be described 33 briefly in this thesis and will be referred to as the Multiscale Short-Time Fourier Transform (M-STFT). The M-STFT is defined as: X MA −STFT (Tˆ , Fˆ ) = ∞ ˆ A ∫ x(T ) w( A(T − Tˆ ))e − j 2πFT dT (3-1) −∞ A scale variable A is introduced which is bounded by: A>0 The factor A is a normalization factor for energy conservation. The scale parameter affects the size of the analysis function, which is related to a chosen analysis window w(Tˆ ) . When the scale parameter is set to A = 1 , the undilated window is applied and the transform reduces to the STFT. If the size of the window is chosen, such that rectangular time-frequency frames determine the representation we have better frequency resolution for 0 < A < 1 , and better time resolution for A > 1 . If A decreases, the duration of the basic analysis function, and proportionally the time resolution increases. This results in better frequency resolution, according to (2-9). If A → 0 the window duration becomes infinitely large and equation (3-1) reduces to the continuous Fourier Transform. If A increases, the duration of the basic analysis window, and proportionally the time resolution decreases. This results in better time resolution. If A → ∞ the window duration becomes infinitely small and X MA − STFT (Tˆ , Fˆ ) reflects the ordinary time domain representation of the original signal. The time-frequency planes yielded by the M-STFT are often corresponding to transform levels. At level 0 with A = 1 the structure is identical to the STFT, using the basic analysis function. Higher levels correspond to scale factors lower than 1. Lower levels correspond to scale factors that are larger than 1. The scale parameter is related to the level index n by: A= 1 αn In a practical situation, n is chosen to be an integer which involves discretization of the scale parameter. The constant α is the M-STFT scale constant. Figure 3.1 shows the structure of the M-STFT. 34 ↑ Frequency Time → n < 0 A >1 n = 0 A=1 n > 0 A <1 Figure 3.1: M-STFT structure. A big disadvantage of this method is the amount of data that is being generated with a practical implementation. Both good time and good frequency resolution at the same frequency is in most cases not necessary. When analyzing music, briefly mentioned in chapter 1, we need good frequency resolution to analyze the frequency of a note and good time resolution to analyze the onset and the character of the instrument. In that case the M-STFT is a good analysis method. Figure 3.2 shows four levels of the M-STFT of the recording of an ambulance. Figure 3.2: M-STFT of a recorded ambulance. The signal has 8192 samples and 10 kHz sampling frequency. Window sizes used are, from left to right: 64, 128, 256 and 512 samples. With the wavelet transform described in the next section the scaling property remains, but only one time-frequency plane is generated. 35 7KH&RQWLQXRXV:DYHOHW7UDQVIRUP ,QWURGXFWLRQ The concept of wavelets was defined in the early eighties, a synthesis of ideas, which originated during the last thirty years in engineering, physics and pure mathematics. The word wavelet comes originally from the French language. Onde is the French word for wave. A small wave, which is local in time, is ondelette, which is the diminutive word for onde. In English, simply the suffix –let is added to the word wave. The wavelets can be placed in the same context as the analyzing function in the previous chapter. Transforms related to wavelets are divided in two main groups, continuous wavelet transforms and discrete wavelet transforms [DI92]. The words 'continuous' and 'discrete' relate to the transform parameters. The continuous case is described in the next section. The discrete case is described in chapter 6. 'HILQLWLRQ The previous chapter depicted the disadvantages of uniform resolution time-frequency analysis, It takes narrow time windows to analyze transients more precisely and narrow frequency windows to analyze long duration components more thoroughly. Hence, uniform resolution time-frequency analysis is not suitable for analyzing signals with both types of components. The method which will be described in this section, the Continuous Wavelet Transform (CWT) relative to some basic wavelet, to be defined below, provides a flexible time-frequency frame, of which the duration automatically narrows when observing high-frequency phenomena and widens when studying low-frequency environments. Before the CWT is introduced, the STFT with its analyzing function g (T ) are recalled: X STFT (Tˆ , Fˆ ) = ∞ ∫ x(T )w(T − Tˆ)e − j 2πFˆ T dT −∞ ˆ g (T ) = w(T − Tˆ ) e j 2πFT With the CWT, any basic analyzing function is used which has the important property of being local in time. This basic function has its center at T0 and has a center frequency F̂0 , already defined in chapter 2. The basic function of the wavelet transform is referred to with the Greek letter ψ and is called the mother wavelet [HC94]. The mother wavelet has zero mean, 36 ∞ ∫−∞ψ (T )dT = 0 , and is limited in both time- and frequency-domain. An example is the Morlet wavelet, shown in figure 3.3. 4 3 Magnitude 2 1 0 -1 -2 -3 -1 -0.5 0 0.5 1 Time Figure 3.3: The Morlet wavelet. The CWT uses translations of the mother wavelet, just like the STFT uses translations of its analyzing function. A scale parameter is added which involves dilation of the time-axis that is covered by the wavelet translations, note that hereby even the translation parameter is dilated. This is shown in figure 3.4. 8 6 Magnitude 4 2 0 -2 -4 -6 -1 0 1 2 3 4 5 Time Figure 3.4: 3 Instances of the Morlet mother wavelet. The wavelet in 0 is the mother wavelet, the wavelet in 2 has A=2 and B=4 and the wavelet in 4 has A=4 and B=8. The translation parameter B and the dilation parameter A (A>0), which are continuous, define the wavelet instances of the analyzing function of the CWT [RO91]: ψ A, B (T ) = T − B ψ A A 1 (3-2) For large values of A the duration of the wavelet instance is large. For lower values of A the duration of the wavelet instance decreases. Note that this is contrary to the M-STFT. The CWT is defined as [RO91]: X CWT ( A, B) = ∞ 1 A ∫ x (T )ψ ( T −B ) A dT (3-3) −∞ 37 3URSHUWLHVRIWKH&RQWLQXRXV:DYHOHW7UDQVIRUP Analogous to procedure (2-6) with the STFT, a relation between X CWT ( A, B) and X FT (F ) can be defined, where Ψ AFT, B ( F ) is the Fourier transform of the wavelet instance (3-2) [CC92]: Ψ AFT, B (F ) = A A ΨFT ( AF )e − j 2πF B ∞ The Parseval Identity ∫ x(T )ψ A,B (T )dT = −∞ X CWT ( A, B) = = = ∞ 1 A 2π −∞ A A 2π ∞ 1 2π ∫ X FT (F )ΨA,B (F )dF FT A gives: −∞ ∫ x(T )ψ ( A A T −B A )dT ∞ ∫ X FT ( F )ΨFT ( AF )e − j 2πF B A ∫ X FT ( F )ΨFT ( AF )e j 2π F B A −∞ ∞ dF (3-4) dF −∞ Important properties of the mother wavelet ψ (T ) and its Fourier Transform ΨFT (F ) are their centers Tˆ0 and F̂0 , and their radii ∆ψ (T ) and ∆ ΨFT (F ) . These properties can be calculated with (2-4) and (2-5). Analogous to the STFT, these properties define the location of the timefrequency frames. Important for these frames is the influence of the dilation parameter. The radius of a wavelet instance is proportional to the dilation parameter: ∆ψ A , B (T ) = A∆ψ (T ) (3-5) For the wavelets Fourier transform the Fourier scaling property (2-20) can be used: ∆ ΨAFT, B ( F ) = 1A ∆ ΨFT ( F ) (3-6) Which involves a decreasing bandwidth when the wavelet duration is increased. Since the center of the mother wavelet is at Tˆ0 , the center of any wavelet instance is determined by: T −B ˆ = T0 ⇔ T = B + ATˆ0 A (3-7) So that the CWT gives local information of x(T ) in the time window: B + ATˆ0 − A∆ψ (T ) , B + ATˆ0 + A∆ψ (T ) The center frequency at which the wavelet is located is determined by: Fˆ Fˆ = 0 A 38 (3-8) This means that low frequencies are associated with scales close to ∞ and therefore with long duration wavelets which have small bandwidth in the frequency domain. The higher frequencies are associated with scales close to 0, and therefore with short duration wavelets which have large bandwidth. The CWT gives local spectrum information of x(T ) in the frequency window: Fˆ0 A − A1 ∆ ΨFT (F ) , Fˆ0 A + A1 ∆ ΨFT (F ) One can think of this window as a frequency band with center frequency Fˆ = Fˆ0 A and bandwidth 2∆ Ψ FT ( F ) = A ,B 2 A ∆ ΨFT ( F ) . The ratio Fˆ0 A Fˆ0 centerfrequency = = 2 ∆ ΨFT (F ) A 2∆ ΨFT ( F ) bandwidth is independent of the dilation parameter. Since the wavelets (wavelet instances) can be considered as impulse responses for a set of bandpass filters (see chapter 2) this is called constant-Q-filtering [CC92]. The CWT gives time-frequency information in the time-frequency frame: B + ATˆ0 − A∆ψ (T ) , B + ATˆ0 + A∆ψ (T ) × Fˆ0 A − A1 ∆ ΨFT (F ) , Fˆ0 A + A1 ∆ ΨFT (F ) Figure 3.2 visualizes the properties of time-frequency frames with a wavelet transform. 2 A∆ψ (T ) Fˆ0 A 2 ∆Ψ ( F ) A FT B + AT̂0 Figure 3.5: Time-frequency window properties of the CWT. 7KH&RQWLQXRXV:DYHOHW7UDQVIRUPDQGWKH7LPH)UHTXHQF\3ODQH To map the CWT into a time-frequency plane similar to that presented in chapter 2, a relationship is required between the translation parameter A, the dilation parameter B, and the parameters Tˆ and F̂ which define the time-frequency plane. 39 The plane parameter F̂ is related to the dilation parameter with the identification defined in the previous section: Fˆ Fˆ = 0 A The time parameter Tˆ is related to both the translation parameter and the dilation parameter: Tˆ = B + ATˆ0 Figure 3.3 shows how the time-frequency frames with a wavelet transform are mapped into the time-frequency plane: 2A ∆ψ(T) 2 F̂ Fˆ0 A2 V 2∆G(F)/A VI 2 2A ∆ψ(T) 1 Fˆ0 A1 III IV 2∆G (F)/A 1 FT 2∆ψ(T) F̂0 I 0 2∆G (F) II FT Tˆ0 B2 + ATˆ0 B1 + ATˆ0 B3 + ATˆ0 Tˆ Figure 3.6: Location of time-frequency frames in the time-frequency plane. The related analysis functions are: . ψ 1I, 0 ( T ) = ψ ( T ) ,ψ 1II, B (T ) ,ψ AIII , B ( T ) ,ψ AIV , B ( T ) , ψ VA , B ( T ) and ψ VI A , B (T ) 2 1 1 1 3 2 1 2 2 3URILOHRIWKH&RQWLQXRXV:DYHOHW7UDQVIRUP The dilation parameter A (scale) can be plotted as a function of F̂ , according to relation (3-8). This function is called the profile. Figure 3.7 shows a typical profile for a wavelet transform. The importance of this profile function will be clarified in the next chapter. 40 1 SCALE 0.8 0.6 0.4 0.2 0 0 50 FREQUENCY 100 Figure 3.7: The profile function of the wavelet transform for Fˆ 0 = 1 . :DYHOHWUDGLXVDQGEDQGZLGWK The radius of any wavelet instance and its bandwidth can be plotted as functions of the frequency F̂ . Figure 3.8 and 3.9 show the nature of these relations, according to (3-5) and (3-6). 100 RADIUS 80 60 40 20 0 0 50 FREQUENCY 100 Figure 3.8: The wavelet radius as a function of frequency, Fˆ 0 = 1 and ∆ψ (T ) = 100 . 100 BANDWIDTH 80 60 40 20 0 0 50 FREQUENCY 100 Figure 3.9: The wavelet bandwidth as a function of frequency, Fˆ 0 = 1 and ∆ ΨFT ( F ) = 1 . 7KH6FDORJUDP A similar time-scale distribution, like the spectrogram with the STFT, can be defined in the wavelet case. It is called wavelet spectrogram, or scalogram. 2 X STFT ( A, B) = ∞ 1 A ∫ x (T )ψ ( 2 T −B A )dT (3-9) −∞ 41 Both the spectrogram and the scalogram produce a more or less easily interpretable visual two-dimensional representation of signals, were each pattern in the time-frequency or timescale plane contributes to the global energy of the signal. A time-scale plane can easily be converted into a time-frequency plane, using relations (3-7) and (3-8). An example of a scalogram is shown in figure 3.10. An implementation of the continuous wavelet transform and scalogram is given in section 6.5.1. Figure 3.10: Time-scale representation of 4 cosines. The time-domain representation of the signal is shown right. Clearly is to see the periodic nature of the different cosines. The picture also shows that higher frequencies are related to lower scales and that lower frequencies are related to higher scales. 42 &KDSWHU $GDSWLYH7LPH)UHTXHQF\$QDO\VLV ,QWURGXFWLRQ In order to tackle the disadvantages of the STFT and CWT, a time-frequency representation can be improved by adapting the transform to the time-frequency content of the signal. This can be done in three obvious ways: 1. Optimizing in time. This involves that components that are local in time, such as transients will be analyzed with good time resolution. Time intervals containing transients will be analyzed with short analysis functions or wavelets. For the other intervals, the transform will be optimized for the analysis of frequencies, with arbitrarily good frequency resolution. 2. Optimizing in frequency. This means that frequencies, local in time, will be analyzed with good frequency resolution. Frequency intervals containing relatively more energy will be analyzed with long analysis functions or wavelets. For the other intervals, the transform will be optimized for the analysis of transients, with arbitrarily good time resolution. 3. Optimizing in time-frequency. This involves adapting the time-frequency windows to the signal. Methods, which belong to this group, are not within the scope of this thesis. This chapter takes up two methods belonging to the first and second group, each with an implementation. Section 4.2 describes the multiresolution Fourier transform which is a method that optimizes in frequency, by first analyzing the frequency content of the signal to determine the analysis functions to be exploited 43 Section 4.3 describes the adaptive window short-time Fourier transform, which optimizes in time by calculating an optimal window for each moment in time. Implementations of these two methods are given in chapter 7. 7KH0XOWLUHVROXWLRQ)RXULHU7UDQVIRUP The Multiresolution Fourier Transform (MRFT) is a special version of the continuous wavelet transform where a qualified wavelet function is used. Recalling the integral wavelet transform (3-3): X CWT ( A, B) = ∞ 1 A ∫ x (T )ψ ( T −B A )dT −∞ The MRFT is defined as: X MRFT (Tˆ , Fˆ ) = ∞ 1 A( Fˆ ) ∫ x(T )ψ ( AT(−FTˆ ) − Tˆ0 )dT ˆ −∞ Which is basically the same as the continuous wavelet transform. The major difference is the dependence of the dilation parameter A on frequency and the substitution T − B T − Tˆ − ATˆ0 T − Tˆ ˆ = = − T0 A A A In order to yield a time-frequency representation instead of a time-scale representation. 3URILOHRIWKH0XOWLUHVROXWLRQ)RXULHU7UDQVIRUP With the wavelet transform, the relation A(Fˆ ) was hyperbolic, according to (3-8) and shown in figure 3.7. With the MRFT, the profile function is adapted to the signal being analyzed. Before transforming the signal into a time-frequency representation, previous knowledge of frequency content in the signal is used to determine the profile function. A spectrogram or Fourier transform with high frequency resolution can be used to detect stationary frequencies in the signal. Then the MRFT is used to analyze the same signal, with high frequency resolution within the areas were stationary components were found, while the other areas are analyzed with high time resolution to analyze transients. By doing this, even high frequency stationary components, and low frequency transients can be analyzed at any location in the frequency domain, which was not possible with a wavelet transform with a profile according to (3-8). The basis of the MRFT profile function is the CWT profile function. Choosing this profile, the MRFT reduces to the CWT. 44 A( Fˆ ) = Fˆ0 Fˆ (4-1) A signal consisting of transient components and stationary components around F̂1 would rather be analyzed with high frequency resolution around F̂1 and high time resolution for other frequencies. The profile (4-1) could be adapted by introducing a frequency shift of F̂1 . Figure 4.1 illustrates an example of this profile. A( Fˆ ) = Fˆ0 (4-2) Fˆ − Fˆ1 SCALE 1 0.8 0.6 0.4 0.2 0 0 50 FREQUENCY 100 Figure 4.1: The profile function of the Multiresolution Fourier Transform for F̂ 0 =1 and F̂1 =40. In general a discrete set of frequencies can determine the profile function, corresponding to the frequency bands where stationary components in the signal are located. These frequencies contribute to the profile function. The profile function can simply be determined by the sum of independent profiles as in (4-2). N N Fˆ0 n =1 Fˆ − Fˆn A( Fˆ ) = ∑ = N Fˆ0 ∑ ∏ ( Fˆ − Fˆn ) n =1 l =1,l ≠ n N Fˆ − Fˆn ∏ n 1 = Figure 4.2 shows a profile function for high frequency resolution around three center frequencies. SCALE 1 0.8 0.6 0.4 0.2 0 0 50 FREQUENCY 100 Figure 4.2: The profile function of the Multiresolution Fourier Transform for F̂ 0 =1, adapted to frequencies F̂1 =20, F̂ 2 =40 and F̂3 =80. 45 :DYHOHW'XUDWLRQDQG%DQGZLGWK The duration of any wavelet instance is: D = 2∆ψ A ,B (T ) The maximum wavelet duration is associated with the mother wavelet: DMAX = 2∆ψ (T ) . The duration of the wavelet instance used by the MRFT lies between two boundaries: DMIN < D < DMAX . The duration of the wavelet instance can be calculated with D = DMIN + ( DMAX − DMIN ) A( F ) where 0 < A < 1 . RADIUS 150 100 50 0 0 50 FREQUENCY 100 Figure 4.3: Wavelet duration as a function of frequency, associated with the profile function in figure 4.2. DMIN=10, DMAX=100. The bandwidth of any wavelet instance is B = 2 ∆ Ψ FT, ( F ) . The minimum wavelet bandwidth is A B associated with the mother wavelet: B MI N = 2 ∆ ΨFT ( F ) . The bandwidth of the wavelet instance used by the MRFT lies between two boundaries: B MIN < B < BMAX . Where BMAX is undefined and depends on the minimum wavelet duration. The bandwidth of the wavelet instance as a function of frequency can be calculated with: B = BMIN + ( BMAX − BMIN ) where 0 < A < 1 . A( F ) BANDWIDTH 30 20 10 0 0 50 FREQUENCY 100 Figure 4.4: Wavelet bandwidth associated with the profile function in figure 4.2. Bmin=2. To achieve a proper result when using such optimized analysis function families, nonoverlapping functions and discrete parameters are required. Overlapping would result in the scattering effect, overlapping the areas of good resolution which means deterioration of the time-frequency distribution. Chapter 7.2 describes the discrete parameter implementation. 46 $GDSWLYH:LQGRZ6KRUW7LPH)RXULHU7UDQVIRUP In [JD94] a method is described which adapts the time-window of a short-time Fourier transform to the signal being analyzed. First in section 4.3.1, the measure of short-time timefrequency concentration is introduced. Then a to the signal adapted parameter P is introduced which changes the window width over time in a time-domain based STFT. 6KRUW7LPH7LPH)UHTXHQF\&RQFHQWUDWLRQ The measure of short-time time-frequency concentration is defined as follows: ∞ ∞ C P (T ) = ∫∫ 4 P X STFT (Tˆ , Fˆ ) w(Tˆ − T ) dTˆdFˆ − ∞− ∞ ∞ ∞ (∫ ∫ 2 P X STFT (Tˆ , Fˆ ) w(Tˆ − T ) dTˆdFˆ ) 2 − ∞− ∞ P which describes how the energy of a signal is distributed. X STFT (Tˆ , Fˆ ) is an ordinary STFT time-frequency representation where P is the window duration. The short-time time-frequency P concentration is calculated for every time slice X STFT (τ , Fˆ ) associated with time τ, for all the time-frequency representations associated with P. 2SWLPDO:LQGRZ7LPH)UHTXHQF\5HSUHVHQWDWLRQ For every time Tˆ , the short-time time-frequency concentration has a maximum value at a certain P. This P is called the optimal time-varying parameter of the time-frequency representation and will be referred to as Popt (Tˆ ) . The time-slice associated with this optimal Popt (τ ) parameter Popt (τ ) at time τ, which is X STFT (τ , Fˆ ) , is placed in the optimal window timePopt (τ ) frequency representation X STFT (Tˆ , Fˆ ) . How this algorithm can be implemented efficiently will be described in chapter 7, section 7.3. 47 48 &KDSWHU 'LVFUHWH6KRUW7LPH)RXULHU7UDQVIRUPDQG ,PSOHPHQWDWLRQV ,QWURGXFWLRQ In this chapter, two types of the discrete short-time Fourier transform are described. They are based on windowing in time (section 2.2) and windowing in frequency (section 2.6): The first step towards a discrete transform is parameter discretization. Instead of windowing data at all times, a step is introduced, relatively to the window size. The result is a non-redundant transform where the resulting time-frequency distribution shows as much as a continuous TFD. Section 5.3 starts by introducing the discrete time and discrete frequency Fourier transform, well known as the Discrete Fourier Transform (DFT). By means of the fast DFT (FFT), the discrete STFT is constructed. Only a few steps have to be taken to achieve a discrete STFT Section 5.4 and 5.5 describe four STFT implementations. The first two implementations are based on windowing in time and the last two are based on windowing in frequency (filtering). Both methods are used to generate a non-redundant discrete STFT as well as a redundant approximation of the continuous STFT. 3DUDPHWHU'LVFUHWL]DWLRQ Towards an implementation of equation (2-2), a discretization of the translation parameter is required. This involves that windowing in time, as discussed in section 2.4.2, is not done at al times but with a certain step size between the windows. This step is called the stride. The translation parameter Tˆ will be replaced by a discrete parameter p according to: Tˆ = pS 49 Where p ∈ Z and S is the stride in time. The relation between the stride and the window length is called the overlap factor. An overlap factor of 0.5 indicates that each window covers 50% of the previous window. Although windows are not located at all times, all the time information is covered by the transform for appropriate values for the overlap factor. It needs to be mentioned here that a certain amplitude error will occur for short-time events near window crossings. 1 w(n) 0.8 0.6 0.4 0.2 0 0 50 100 n 150 200 Figure 5.1: Windowing in discrete time using a 100 point Hamming window and a 50 point stride. This results in overlapping of 50%. A similar discretization can be carried out for windowing in the frequency domain. In this case the bandfilters are not located at all possible center frequencies but with a step size between each filter. The frequency parameter F̂ will be replaced by a discrete parameter q according to: Fˆ = qL Where q ∈ Z and L is the stride in frequency. Discretization of the parameters Tˆ and F̂ results in sampling of X STFT (Tˆ , Fˆ ) . 0 W(f) dB -10 -20 -30 -40 -50 0 20 40 60 f Figure 5.2: Windowing in frequency using a Hamming (time) window. 50 'LVFUHWH6KRUW7LPH)RXULHU7UDQVIRUP 'LVFUHWH)RXULHU7UDQVIRUP A way to implement the STFT is to use the discrete Fourier transform implemented by a fast algorithm. In chapter 2 is mentioned that the Fourier transform decomposes or separates a waveform or function into sines and cosines of different frequencies, which sum to the original waveform. It identifies or distinguishes the different frequency components and their respective amplitudes. The continuous Fourier transform of x(T ) is defined as: ∞ FFT (Ω) = ∫ x(T )e − jΩT dT where T , Ω ∈ R −∞ Numerical computation of the Fourier transform, for example by a computer, requires discrete sample values of x(T ) . Any desired computation with a computer can only use a finite number of operations. A function needs to be sampled in order to be represented in a computer. Instead of having a function x(T ) at all T, we have the values of x at a finite number of points x(T1 ), x(T2 ),..., x (TN ) . These values are even rounded off to be stored in finitely many bits, which is called quantization, but in practice this is not often a significant limitation. For convenience, the sample points are usually taken at a regular interval of TS = 1 FS where FS is the sampling frequency. If we start sampling at T1 = 0 , the sequence of sampling points becomes: T = 0, TS ,2TS ,..., ( N − 1)TS = nTS where n = 0,1, 2,3,..., N − 1 and the sample values are, in order, given by x' ( 0) = x(0), x' (1) = x(TS ),..., x' ( N − 1) = x([ N − 1]TS ) ⇒ x' ( n) = x( nTS ) Where x' is the discrete representative of the continuous function x. This allows to represent continuous functions by means of discrete data functions. In the future the apostrophe will be omitted. To compute the Fourier transform with a computer, a discrete and finite analogue of the Fourier transform is required. The Fourier integral is over all x, and calculates a value for every Ω. In the discrete and finite analogue, the integral becomes the sum: X FT ( Ω) = N −1 x(n )e − jΩn ∑ n 0 (5-1) = The function e − jΩn , for fixed TS , is a periodic function of Ω with period 2π / TS , because e− jΩn = cos(Ωn) − j sin( Ωn ) has terms which are periodic with period 2π / TS . It follows that 51 the sum X FT (Ω) is periodic over 2π / TS . We may thus restrict attention to the interval 0 ≤ Ω < 2π / TS . Within this range, as many sample points in Ω-domain are taken, as there are in the T-domain, spaced equidistantly. So corresponding to the samples in the T-domain we have Ω-domain samples at positions Ω = 0, 2Nπ , 4Nπ ,..., 2 ( N −1)π N = f 2π N where f = 0,1,2,3,..., N − 1 According to the sum (5-1) the sample values in the Ω-domain are: X DFT ( f ) = X FT ( 2πf N N −1 ) = ∑ x( n)e − j 2πfn N n=0 Which is the Discrete Fourier Transform (or DFT). :LQGRZLQJLQGLVFUHWHWLPH The discrete version of the STFT is a DFT of the frames in which the original sequence is divided up. Windowing the original data sequence with the translates of the window w(n ) we gain the following set of windowed signal sections: = x (n ) w( n) = x (n ) w( n − S ) = x (n ) w( n − 2 S ) x0 ( n) x1 (n ) x2 (n ) x N −SM ( n) = x (n ) w( n − N −M S S ) = x( n) w(n − N + M ) where N is the length of the data sequence x(n) and M is the length of the window sequence w(n ) . Furthermore is assumed that the window has such a size that M = N − PS where P is an integer and reflects how many times the window fits into the data sequence, for a specific stride S. To calculate the discrete STFT of the frames mentioned earlier, the DFT is applied to each frame. 0 X DFT (f) X 1 DFT (f) 2 X DFT (f) = = = N−M S X DFT ( f ) = M −1 ∑ x0 (n)e − j 2πfn M = ∑ x (n)e = n =0 M −1 1 n =0 M −1 ∑x 2 ( n)e − j 2πfn M n =0 ∑x = M −1 n =0 52 − j 2πfn M N −M S ( n) e − j 2πfn M = M −1 ∑ x(n)w(n)e n =0 S + M −1 − j 2πfn M ∑ x(n)w(n − S )e n=S 2 S + M −1 − j 2πfn M ∑ x(n)w(n − 2S )e − j 2πfn M n= 2S N ∑ x(n)w(n − N + M )e n= N − M − j 2πfn M For each frame, the window function is translated in the n-domain with a step size S. The DFTs are combined to a general formula as a function of f and a translation factor t, where t = 0,1, 2,3,..., P − 1 : X STFT (t , f ) = tS + M −1 x( n) w(n − tS )e− j πf n M ∑ n tS 2 (5-2) = where t = 0,1, 2,3,..., N −S M − 1 and f = 0,1,2,3,..., M . Recalling that N, M and S are the lengths of respectively the sequence, the analysis window and the stride. X STFT (t , f ) is the discrete version of the continuous X STFT (Tˆ , Fˆ ) . Discrete time is related to real time according to tS = nTS = T . Discrete frequency is related to real frequency by fFS N = F . 7LPHGRPDLQEDVHGLPSOHPHQWDWLRQV Time domain based implementations exploit the Fast Fourier Transform (FFT) algorithm, which is the fast version of the DFT [PJ96]. Figure 5.3 illustrates the general structure of these implementations. x(n) Dividing in sections × × × × FFT FFT FFT FFT ←f w(n) t→ Figure 5.3: Time based domain implementation. The data sequence is divided in sections first, with our without the use of a stride factor. Subsequently the sections are multiplied with a predefined window sequence. Then the fast Fourier transform is calculated and placed in a time-frequency distribution matrix. The sections 5.4.1 and 5.4.2 describe straightforward implementations of (5-2), using the FFT. 53 5HGXQGDQWGLVFUHWH67)7 An approximation of the continuous STFT can be obtained by setting the stride S to 1 (sample). The presence of the scattering effect causes redundancy in the time-frequency distribution and it is therefore called redundant. The discrete STFT simply reduces to: X STFT (t , f ) = t + M −1 x(n ) w( n − t )e − j 2πf n M ∑ n t = This is implemented in MATLAB in the function: [tfd,f,t]=tac_stft(x,w,fftlen,fs); where x is the data sequence being analyzed, w is the window, fftlen is the length of each FFT and fs is the sampling frequency. The function is returning tfd, which is the resulting time-frequency distribution matrix, and t and f, respectively the time and frequency axes which can be used used to show the time-frequency distribution. This can be done using the function: showtfd(tfd,s,f,t,mode); where tfd is the time-frequency distribution, s is an amplitude scaling factor, t and f, respectively the time and frequency axis and finally mode, which selects between a 2D (mode=1) and 3D plot (mode=0). The well commented source code of these functions is enclosed in a separate appendix. An example is shown in figure 5.3. A 100 ms small segment of a recording of an ambulance is analyzed with the tac_stft method. 54 20 30 SPECTROGRAM 20 0 -10 Magnitude Magnitude [dB] 40 10 0 x4 -10 0 1000 2000 Frequency [Hz] 3000 4000 5000 0 Time [s] 0 0 0 0 1- - 051 1 5M 00 -100 0 100 Amplitude Figure 5.4: Spectrogram of a small part (100 ms) of a recording of an ambulance. The length of the signal is 1024 samples. Sampling frequency is 10 kHz. Used method is tac_stft. Used window is a 128 sample Hamming window. The spectrogram is generated using 512-point DFTs with a stride of 1 sample, overlapping is thus maximal and the spectrogram approximates the continuous STFT. The figures above and to the right are respectively frequency-domain and timedomain representations of the signal. 55 1RQUHGXQGDQWGLVFUHWH67)7 A redundant discrete STFT can be obtained by choosing an appropriate value for the stride S. The discrete STFT is given by: X STFT (t , f ) = tS + M −1 x( n) w(n − tS )e− j 2πf n M ∑ n tS = This is implemented in MATLAB in the function: [tfd,f,t]=tds_stft(x,w,fftlen,S,fs); where x is the data sequence being analyzed, w is the window, fftlen is the length of each FFT, S is the stride and fs is the sampling frequency. The function is returning tfd, which is the resulting time-frequency distribution, and t and f, respectively the time and frequency axes that can be used to show the time-frequency distribution. The main difference with the previous implementation is the possibility of overlapping, using a stride factor. The well commented source code for this function is enclosed in a separate appendix. Figure 5.4 illustrates an example of this method. It shows clearly how the time-frequency distribution features non-redundancy in form of the time-frequency blocks. The scattering effect of the redundant implementation showed in figure 5.3 is not present here. Advantage of the non-redundant STFT above the redundant STFT is its capability to analyze a larger sequence while the size of the time-frequency distribution does not change. This makes the method also faster than its predecessor. 56 50 40 40 20 20 Magnitude 10 -20 0 -20 -10 0 Magnitude [dB] 30 0 1000 2000 Frequency [Hz] 3000 4000 5000 4 1 0 Time [s] 0 0 im 0 1- - 051 1 5 00 -100 0 100 Amplitude Figure 5.5: Spectrogram of a part (819,2 ms) of the recording of the ambulance. The length of the signal is 8192 samples. Sampling frequency is 10 kHz. Used method is tds_stft. Used window is a 128 sample Hamming window. The spectrogram is generated using 512-point DFTs with a stride of 16 samples, overlapping is not maximal and the spectrogram has less redundancy than the spectrogram in the previous figure. The figures above and to the right are respectively frequencydomain and time-domain representations of the signal. 57 )UHTXHQF\GRPDLQEDVHGLPSOHPHQWDWLRQV The methods in this section differ from those in the previous section, in that they exploit a set of bandpass filters instead of DFTs. The fundamental idea behind these methods is equation (2-6). Figure 5.4 illustrates the general structure of these implementations. x(n) h (n) h (n) 2 h (n) 3 h (n) N ←t 1 f→ Figure 5.5: Time based domain implementation. 5HGXQGDQWGLVFUHWH67)7 A set of finite impulse response bandfilters (FIR) is implemented, covering a certain frequency range. The filters overlap and introduce therefore redundancy. A straightforward implementation in MATLAB is: [tfd,f,t]=fac_stft(x,fbin,tbin,firlen,fmin,fmax,fs); where x is the signal being analyzed, fbin is the number of frequency bins (filters), tbin is the number of time bins. firlen is the length of the bandfilters, fmin and fmax denote the desired frequency interval and fs is the sampling frequency. The function is returning tfd, which is the resulting time-frequency distribution, and t and f, respectively the time and frequency axis which can be used to show the time-frequency distribution. 58 60 50 40 40 20 10 0 Magnitude [dB] 20 Magnitude 30 0 -10 -20 -20 -30 0 200 400 600 800 Frequency [Hz] 1000 1200 1400 1600 1800 2000 Time [s] 0 0 0 0 1- - 05 15 0 -100 0 100 Amplitude Figure 5.7: Spectrogram of a part (819,2 ms) of the recording of the ambulance. The length of the signal is 8192 samples. Sampling frequency is 10 kHz. Used method is fac_stft. The spectrogram is generated using a set of 512 bandfilters each with a filterlength of 512. The analyzed frequencyband is 0 – 2000 Hz. The figures above and to the right are respectively frequencydomain and time-domain representations of the signal. 59 1RQUHGXQGDQWGLVFUHWH67)7 To achieve a non-redundant STFT, a QMF (Quadrature Mirror Filter) bank tree is implemented. The application of QMF banks in time-frequency analysis and more on QMF banks itself will be described in chapter 6. The following function in MATLAB, implements a multilevel QMF bank tree: [tfd,f,t]=fac_stft(x,level,N,fs); where x is the signal being analyzed, level is the number of frequency band divisions (depth of the tree), N is the filterlength of the filters and fs is the sampling frequency. The function is returning tfd, which is the resulting time-frequency distribution, and t and f, respectively the time and frequency axis which can be used to show the time-frequency distribution. 60 40 20 0 0 -20 Magnitude -20 20 Magnitude [dB] 40 0 1000 2000 Frequency [Hz] 3000 4000 5000 Time [s] 0 0 0 0 1- - 051 1 5 00 -100 0 100 Amplitude Figure 5.8: Spectrogram of the whole recording of the ambulance (1,6384 s). The length of the signal is 16384 samples. Sampling frequency is 10 kHz. Used method is fds_stft. The spectrogram is generated using a full QMF bank tree of 6 levels. This results in 64 frequency bins. The figures above and to the right are respectively frequency-domain and time-domain representations of the signal. 61 62 &KDSWHU :DYHOHW7UDQVIRUPVDQG,PSOHPHQWDWLRQV ,QWURGXFWLRQ As a sequel to chapter 3, the discrete wavelet transform will be described in this chapter. Two steps towards a full discrete transform, similarly to those in chapter 5, will be taken. At first, discretization of the translations and dilations will be carried out. Then a relation between continuous wavelets and digital filters in a filterbank will be given. This theory, known as Multiresolution Analysis (MRA), will make it easy and, above all, fast to perform a wavelet transform in discrete time. Section 6.2 describes the discretization of the translation and dilation parameters, Section 6.3 describes the MRA and section 6.4 the fast wavelet transform (FWT). Finally, implementations of the continuous wavelet transform and the fast wavelet transform are described in section 6.5. 3DUDPHWHU'LVFUHWL]DWLRQ'LVFUHWH:DYHOHW7UDQVIRUP Calculating all possible wavelet coefficients, on continuous time and scale axes, is a fair amount of work and it generates much data. Towards a practical implementation, discretization of the dilation and translation parameter is introduced. This involves the choice of only a subset of possible scales and position at which calculations are made. It has been proved that scales and positions based on powers of two, so called dyadic scales and positions [CC92], are just as accurate and much more efficient. The continuous wavelet transform that only calculates wavelet coefficients with dyadic wavelets is called the Discrete Wavelet Transform (DWT), not to be mixed up with a discrete time wavelet transform, which is the next step to an implementation. The dyadic scale is defined as [RO91]: a = 2 − j where j ∈ Z 63 Where j is the level and 1/a is the resolution. Dyadic translation is defined as [RO91]: b = k 2 − j where j , k ∈ Z The wavelet family that is generated with these dyadic dilations and translations are defined, using any mother wavelet and the definition : ψ j , k (T ) = 1 ψ ( T a−b ) a = 2 j 2ψ (2 j T − k ) Where ψ 0 ,0 = ψ , which is the mother wavelet. Substituting this in (3-2), this results in the definition of the Discrete Wavelet Transform: DWT [x(T )] = d ( j, k ) = 2 j ∞ 2 ∫ x(T )ψ (2 j T − k )dT −∞ Figure 6.1 shows how the STFT and the DWT filter the signal, using a set of bandpass filters. It shows clearly how the STFT filters the signal with filters with constant bandwidth, because the duration of the time window and therefore the frequency window that is constant for every frequency band. 2Fˆ0 F̂0 F̂0 2Fˆ0 4Fˆ0 3Fˆ0 8Fˆ0 4Fˆ0 5Fˆ0 Frequency→ 16Fˆ0 Figure 6.1:Filterbanks used with respectively STFT and DWT. The DWT filters the signal with bandpass filters, which have a wavelet instance as impulse response, with a constant relative bandwidth which means that the center-frequency to bandwidth ratio is independent of the scale parameter, see chapter 3.3.3. 64 0XOWLUHVROXWLRQ$QDO\VLV 6XEVSDFHV6FDOLQJIXQFWLRQVDQG:DYHOHWIXQFWLRQV Multiresolution Analysis [VB91][UM95][CC92] is the general theoretical framework which connects wavelets in continuous time to digital filters of a QMF bank. { }j∈Z 1. It start with the definition of an increasing sequence of closed subspaces V j which approximates L2 ( R) , which is the space of all square integrable functions. A function 2 x(T ) is said to be in L ( R) when ∞ ∫−∞ x 2 (T )dT is finite. L2 ( R) is also known as the Hilbert space. 2. A scaling function φ (T ) is introduced such that it forms an orthonormal basis for the reference space V0 , which means that ∞ ∫−∞ φ (T )φ (T − k )dT = δ (k ) for all k ∈ Z . Some literature refer to the scaling function φ (T ) as the father wavelet. 3. V j ⊂ V j +1 for all j ∈ Z , which means that the spaces V j are nested. This feature is called containment. 4. The space L2 ( R) is a closure of the union of all V j . In other words V j is dense in j∈Z 2 L ( R) . This feature is called completeness. 5. The intersection of all V j is empty: V j = ∅ . j∈Z 6. Now consider the orthogonal complement W j of V j to V j +1 , i.e. V j +1 = V j ∪ W j and V j ∩ W j = ∅ . This is called the orthogonal decomposition of V j +1 . It simply means that each space V j +1 is divided up in an average space V j and a detail space W j . Notice that 2 W j = V j = L ( R) . j∈Z j∈Z ∅ ... Vj Vj+1 Wj Wj+1 ... L2(R) Figure 6.2:Decomposition of the Hilbert space and its subspaces into averages and details. 7. A wavelet function ψ (T ) is introduced such that it forms an orthonormal basis for the reference space W0 , which means that ∞ ∫−∞ψ (T )ψ (T − k )dT = δ (k ) for all k ∈ Z . The function ψ (T ) is well known as the mother wavelet. 65 8. x(T ) ∈ V j ⇔ x(2T ) ∈ V j +1 where j ∈ Z which means that the spaces V j and V j +1 are similar. This is called the scaling property. If the space V j is spanned by the functions 2 φ j ,k (T ) = 2 j φ ( 2 j T − k ) , for any j , k ∈ Z , then the space V j +1 is generated by the functions φ j +1,k (T ) = 2 ⋅ 2 j 2 φ j, k (2 ⋅ 2 j T − k ) , for some j. Because V0 ⊂ V1 according to (3), any function in V0 , described by translations of φ (T ) , can 2φ ( 2T ) , the basis of V1 . In general, 2φ (2T ) : also be described by translations of the basic functions the basis φ (T ) can be described as translations of φ (T ) = 2 ∑ g ( k )φ (2T − k ) ∀k This is referred to as the two-scale relation for the scaling function, where the discrete sequence g (k ) is called the two-scale sequence of φ (T ) . In a practical situation, the attention to g (k ) is restricted to finite sequences which means that finitely many coefficients are non-zero. Scaling function related to such two-scale sequences said to have compact support. The coefficients g (k ) are the coefficients of the low pass filter in the QMF bank (see 6.4) and can be calculated with: ∞ g (k ) = 2 ∫ φ (T )φ ( 2T − k )dT −∞ Similarly, since W0 ⊂ V1 according to (6), any function in W0 , described by translations of ψ 0 (T ) , can also be described by translations of the basic functions φ1 (T ) = 2ψ 0 ( 2T ) , using the basis φ1 (T ) from V1 . In general, the basis ψ j (T ) can be described as translations of 2φ (2T ) : ψ (T ) = 2 ∑ h (k )φ (2T − k ) (6-1) ∀k This is referred to as the two-scale relation for the wavelet function, where the discrete sequence h( k ) is called the two-scale sequence of ψ (T ) . In a practical situation, the attention to h( k ) is restricted to finite sequences which means that finitely many coefficients are nonzero. Wavelet functions related to such two-scale sequences are said to have compact support. The coefficients h( k ) are the coefficients of the high pass filter in the QMF bank and can be calculated with: ∞ h( k ) = 2 ∫ ψ (T )φ ( 2T − k )dT −∞ such that h( L − 1 − n) = ( −1) n g ( n) , where n = 0,1, 2,3,..., L , which means that g has as many coefficients as h and that they form a set of orthogonal filters used in the QMF bank. 66 :DYHOHWFRPSRVLWLRQDQGGHFRPSRVLWLRQ A function x0 (T ) ∈ V0 can be described by φ (T ) only: x0 = ∑ c(0, k )φ (T − k ) , where the k∈Z coefficients c indicate how x is described in terms of translations of φ (T ) . As showed in the 2φ (2T ) , which is previous section, a function in V0 can also be described by translations of the basis for V1 : x0 (T ) = 2 ∑ c(1, k )φ ( 2T − k ) (6-2) k∈Z Similarly we can describe a function y 0 (T ) ∈ W0 by ψ (T ) only: y 0 (T ) = ∑ d (0, k )ψ (T − k ) , k ∈Z where the coefficients d indicate how y is described in terms of translations of ψ (T ) . As showed in the previous section, a function in W0 can also be described by translations of 2φ (2T ) , which is the basis for V1 : y 0 (T ) = 2 ∑ d (1, k )φ ( 2T − k ) (6-3) k∈Z Let x0 (T ) ∈ V0 and y 0 (T ) ∈ W0 be the wavelet decomposition of a function x1 (T ) ∈ V1 . The function x1 can then be composed according to: x1 (T ) = x0 (T ) + y0 (T ) = 2 ∑ [c(1, k ) + d (1, k )]φ ( 2T − k ) k∈Z In general, a function x j (T ) ∈ V j can be composed by: x j (T ) = x j −1 (T ) + y j −1 (T ) = 2 ∑ [c( j , k ) + d ( j , k )]φ j ( 2T − k ) k∈Z The fact that W j = V j = L2 ( R) can be used to compose a function x(T ) ∈ L2 ( R ) j∈Z j∈Z according to: x(T ) = y k (T ) = ∑ ∑ d ( j, k ) 2 j k ψ (2 j T − k ) ∑ k Z j Zk Z ∈ ∈ ∈ This is the wavelet composition of a function x(T ) ∈ L2 ( R ) . The wavelet decomposition of the same function is then defined as: d ( j, k ) = 2 j 2 ∞ ∫ x (T )ψ (2 j − k ) dT −∞ Which is known as the Discrete Wavelet Transform (DWT). Its discrete time implementation Fast Wavelet Transform (FWT) is described in the next section. 67 )DVW:DYHOHW7UDQVIRUP 4XDGUDWXUH0LUURU)LOWHU%DQN To perform a discrete time wavelet transform on discrete time signals, the subband coding scheme is used. The subband coding scheme exploits two quadrature mirror filters and down sampling by two. Figure 6.2 shows the analysis and synthesis of a discrete time signal, which can be compared with a 1 level discrete wavelet transform and inverse transform. h(n) ↓2 ↑2 y0(n) h'(n) x1(n) g(n) ↓2 ↑2 x0(n) Analysis g'(n) x1'(n ) Synthesis Figure 6.3:QMF Filter bank used with subband coding. Filter h(n) is a high pass filter while filter g(n) is a low pass filter. They each filter half of the spectrum of signal x(n). These filters are said to be orthogonal if they filter unique information of the signal. In the 2-band filterbank shown in figure 6.2 the low pass filter and the high pass filter are related by [RO91]: h( L − 1 − n) = (−1) g ( n) n where L is the length of the filters. Downsampling and upsampling factors in respectively the analysis tree and the synthesis tree are equal to the number of frequency bands. By doing this the filterbank is said to be critically sampled [MS98]. Since down- and upsample devices are linear time varying components, the QMF bank is also a time varying system. It is however possible to choose the analysis and synthesis filters such that the aliasing effects due to the time varying behavior is eliminated, resulting in a linear time-invariant (LTI) system. A possible solution is choosing the synthesis filters such that: H ' ( z ) = G( − z) G' ( z ) = − H ( − z) Which results in a frequency response T (z ) for the whole QMF bank such that: Y ( z ) = T ( z ) X ( z) 68 If T ( z) = d such that Y ( z) = d X ( z ) where d is a constant, the QMF bank is said to be magnitude reserving. If arg [Y ( z )] = arg[X ( z )] + αΩ + β i.e. if T (z ) has linear phase, the QMF bank is said to be phase reserving. If the QMF bank is magnitude reserving as well as phase reserving, it is said to be a perfect reconstruction QMF bank. In this case T (z ) is only causing a certain relative time-shift and a multiplication with a constant: Y ( z ) = dz − n0 Z −1 X ( z ) ⇒ y( n) = dx( n − n0 ) This thesis focuses on the analysis part of the QMF-bank with a choice of filters that meet the requirements of perfect reconstruction. The possibility and the quality of synthesis, or perfect reconstruction, is however important for the analysis to be representative. 'LVFUHWH:DYHOHW7UDQVIRUPLPSOHPHQWHGE\D40)WUHH The discrete wavelet transform can be implemented by cascade coupling of the analysis filter bank where y2(n) is the input of the next stage. Figure 6.3 shows how a QMF bank tree can implement the DWT. ↓2 h(n) y2(n) h(n) x3(n) ↓2 g(n) ↓2 y1(n) x2(n) g(n) ↓2 h(n) ↓2 g(n) ↓2 y0(n) x1(n) x0(n) Figure 6.4:QMF Filter bank tree implementing a three level DWT. To calculate an output of the QMF tree immediately, the following formulas can be used [SG96]: J − j −1 X j ( z ) = X J ( z) ∏ G( z 2 ) k =0 k Y j ( z) = X J ( z ) H ( z ) J − j− 2 ∏ k G( z 2 ) k =0 Where X j (z ) is the z-transform of x j (n) and j ∈ Z . The original signal has z-transform X J (z) . Interpolation is denoted by z i , where i is the interpolation factor. 69 ,PSOHPHQWDWLRQV &RQWLQXRXV:DYHOHW7UDQVIRUP An approximation of the continuous wavelet transform can be achieved by simply calculating a wavelet at certain scales and then by convoluting the discrete time signal with these set of wavelets, yielding a set of signals which constitute a time-scale representation. The scalogram is implemented in MATLAB in the function: [tsd,s,t]=cwt(x,bs,es,ss,fs); where x is the signal being analyzed, bs is the first scale value, es is the last scale value, ss is the step scale value and fs is the signals sampling frequency. The function is returning tsd, which is the resulting time-scale distribution, t and s, respectively the time and scale axis used to show the time-scale distribution. The result can be can be shown using the function: showtsd(tsd,c,s,t,mode); where tfd is the time-frequency distribution being shown, c is an amplitude scaling factor, t and s, respectively the time and scale axis and finally mode which selects between a 2D (mode=1) and 3D plot (mode=0). The commented source code for these functions are enclosed in a separate appendix. An example is shown in figure 3.10. 70 )DVW:DYHOHW7UDQVIRUP Figure 6.5 shows the results of a four level DWT yielded by a QMF bank tree. The original signal contains two Dirac impulses and two sine waves local in time. Furthermore, some noise was added. 1 Amplitude 0.5 0 -0.5 0 0.02 0.04 Time [s] 0.06 0.08 0.1 0 0.02 0.04 Time [s] 0.06 0.08 0.1 x4 ( n) 1 0.8 Amplitude 0.6 0.4 0.2 0 -0.2 -0.4 y 3 (n ) 2 Amplitude 1 0 -1 -2 0 0.02 0.04 Time [s] 0.06 0.08 0.1 y 2 ( n) 4 Amplitude 2 0 -2 -4 0 0.02 0.04 Time [s] 0.06 0.08 0.1 y1 ( n) 0.6 0.4 Amplitude 0.2 0 -0.2 -0.4 -0.6 -0.8 0 0.02 0.04 Time [s] 0.06 0.08 0.1 y 0 (n ) 0 0.02 0.04 Time [s] 0.06 0.08 0.1 x0 ( n) 1 Amplitude 0.5 0 -0.5 Figure 6.5:Results of a three level DWT.The original signal is x 4 (n) and the number of decomposition levels is 4. This way of presenting the results of a discrete wavelet transform is very straightforward. But still it is not very representative when it comes to a joint time-frequency representation. In the next chapter the discrete wavelet technique will be used to generate optimal time-frequency distributions. 71 72 &KDSWHU $GDSWLYH7UDQVIRUPVDQG,PSOHPHQWDWLRQV ,QWURGXFWLRQ It is desired to maintain the benefits of the discrete wavelet transform but to cope with its disadvantages, which mainly is poor time resolution in the lower frequency band and the poor frequency resolution in the higher frequency band. Two methods will be constructed, based on the theory described in the previous chapters. They differ from their predecessors in that they adapt their functionality to the data sequence, which is analyzed. By doing this, the effect of the limitations of the previous methods is minimized. The first section first enhances the MRA and a corresponding FWT algorithm will be derived. Subsequently, it will be adapted to the data sequence before it is applied. The fundamental idea behind this method is the DWT described in chapter 6. The second section describes the simplified time-domain based discrete STFT which exploits an adaptive window. The fundamental idea behind this method is described in section 4.3. Both methods are implemented and examples are included. :DYHOHW3DFNHWV The adaptive method described in this chapter is build upon the theory of wavelet packets. In [CC92] additions to the MRA are described to improve the ordinary discrete wavelet transform. ([SDQVLRQRIWKH05$ First recall the two-scale relation φ (T ) = 2 ∑ g ( k )φ (2T − k ) and the relation ∀k n 1 h( L − 1 − n) = (−1) g ( n) , describing the scaling functions and wavelets of the ordinary MRA. With the new MRA, a family {µ n }, n ∈ Z + of wavelets, simply called wavelet packets is a 1 The wavelets are defined by φ (T ) and h(n ) , see (6-1). 73 basis for the subspace U nj regarding to the ordinary dyadic dilations and translations: 2 j 2 µ n ( 2 j − k ) . The first two spaces U nj are similar to the ordinary spaces of the DWT: U 0j = V j , j ∈ Z 1 U j = W j, j ∈ Z Where V j is the ordinary MRA of L2 ( R) , generated by µ 0 = φ (T ) , and W j is the sequence of orthogonal complementary (wavelet) subspaces generated by µ1 = ψ (T ) . The bases of the first two spaces U nj , with their two scale relations are: µ0 (T ) = φ (T ) = 2 ∑ g ( k ) µ0 ( 2T − k ) ∀k ( ) ( ) 2 µ ψ = = T ∑ h(k )µ0 (2T − k ) 1T ∀k The orthogonal decomposition of subspaces in the ordinary MRA: V j +1 = V j ∪ W j can now be written as: U j +1 = U j ∪ U j 0 0 1 In general any space U nj+1 , where j ∈ Z and n ∈ Z + , can be decomposed into subspaces: n n n+ U j +1 = U j ∪ U j 2 2 1 Which simply means that not only the spaces V j of the ordinary MRA are decomposed but also the spaces W j . The change to U is therefore obvious. Similarly to figure 6.4, the decomposition of U nj can be clarified graphically This is done in figure 7.1. 0 Uj 0 U j +1 1 ∅ ... Uj ... L2(R) 2 Uj 1 U j +1 3 Uj Figure 7.1:Decomposition of the Hilbert space using wavelet packets. The thick lines reflect the ordinary MRA wavelet decomposition. 74 :DYHOHW3DFNHWVFRPSRVLWLRQDQGGHFRPSRVLWLRQ The function x00 (T ) ∈ U 00 can be described by µ 0 = φ (T ) only: x00 = ∑ c 0 (0, k )µ 0 (T − k ) . It k ∈Z can also be described in terms of translations of 2 µ 0 (2T ) , which is the basis for U 10 . 0 x0 (T ) = 2 ∑ c0 (1, k )µ 0 ( 2T − k ) (7-1) k∈Z The x0 = 1 function x0 (T ) ∈ U 0 1 1 can be described by µ1 = ψ (T ) as follows ∑ c1 (0, k )µ1 (T − k ) , but also in terms of translations of 2 µ 0 (2T ) which is the basis for 1 x0 (T ) = 2 ∑ c1 (1, k )µ 0 ( 2T − k ) (7-2) k∈Z 0 U1 . k∈Z Notice that c (1, k ) is replaced by c 0 (1, k ) and d (1, k ) is replaced by c1 (1, k ) . Compositions (7-1) and (7-2) are the same as (6-2) and (6-3) in the ordinary wavelet case. The function x10 (T ) ∈ U10 can be composed of x00 (T ) ∈ U 00 and x10 (T ) ∈ U 01 according to: 0 0 1 x1 (T ) = x 0 (T ) + x0 (T ) = 2 ∑ [c0 (1, k ) + c1 (1, k )]µ 0 ( 2T − k ) (7-3) k∈Z The wavelet packets composition in general, for any x nj (T ) ∈ U nj , is: 2n 2n 1 n x j (T ) = x j −1 (T ) + x j −1+ (T ) = 2 ∑ [c 2 n ( j , k ) + c 2 n+1 ( j, k )]µ 2 n ( 2T − k ) (7-4) k∈Z The wavelet composition of a function x(T ) ∈ L2 ( R ) using the wavelets µ n and the coefficients c n ( j, k ) can take place in an infinite number of possibilities. This generalization leaves the choice of wavelet packet family to the employer. Optimal bases can be chosen to suit the data that needs to be decomposed, treated and composed to the original data. As earlier mentioned, the composition (or synthesis) part is not in the emphasis of this thesis. However, the possibility to regain the data with a minimum of loss adds certain trustworthiness to the time-frequency representation. The next section describes how a QMF filter bank tree implements the expanded MRA. 75 ):7EDVHGXSRQWKHH[SDQGHG05$ To implement a transform with Wavelet Packets, the QMF bank in section 6.4.1 can be used and extended, according to the expanded MRA: h(n) h(n) ↓2 ↓2 x13 (n) x12 (n) g(n) ↓2 h(n) ↓2 x07 (n) g(n) ↓2 x06 ( n) h(n) ↓2 x05 (n) g(n) ↓2 x04 ( n) h(n) ↓2 x03 ( n) g(n) ↓2 x02 ( n) h(n) ↓2 x10 ( n) g(n) ↓2 x00 ( n) x12 (n) x30 ( n) h(n) g(n) ↓2 ↓2 x11 (n) x20 (n) g(n) ↓2 x10 ( n) Figure 7.2: QMF Filter bank tree implementing a three level fast wavelet packets transform, J=3. Since the expanded MRA allows any dyadic tree structure, it is very general. It is possible to describe a fast STFT, which was already done in section 5.5.2 by using the full wavelet packets tree, but also ordinary wavelet analysis (DWT) can be performed using wavelet packets. The goal is however to obtain an adaptive transform, which means that certain leaves (end vertices), and their branches are cut away from the full wavelet packet tree. Frequency regions with stationary sinewaves will be covered by the filters in the highest level, to gain high frequency resolution. The other regions will be covered by filters at levels as low as possible, to gain better time resolution. This can be done by simply predicting which leaves of the tree will have larger energy than a certain threshold value, and then by pruning, cutting away the leaves which have lower energy than the threshold value. The surplus of branches is cut away with respect to the remaining leaves. Other detection mechanisms and requirements than those exploited here, are thinkable. 76 (QHUJ\3UHGLFWLRQDQG7UHH3UXQLQJ Before the tree can be pruned into a desired form, the energy in its leaves has to be predicted. The leaves of the tree are the output signals of the full QMF-tree. In a discrete time case this can be easily done by calculating a DFT (Discrete Fourier Transform) which has as many points as there are leaves on the tree. The bins of an energy spectrum calculated from the DFT will give the energy of each leaf (output signal). This energy value can be compared to a predefined threshold value. If the energy value of the leaf is higher than the threshold value, the leaf will be kept. Otherwise the leaf will be cut away. When for each leaf is determined if it will be kept or cut away, the pruning can be started by first cutting away the appropriate leaves. Now looking at the former vertex of each leaf that has been cut, either a loose vertex (new leaf) or a vertex that holds a remaining leaf will be reached. Also the loose vertices will be cut away. For this vertex is not significant for the remaining leaves in the highest level. For obvious reasons, the vertices which are significant for the remaining leaves will not be cut away. New leaves will come up at those locations where loose vertices are connected to vertices, which are significant to the remaining leaves at the highest level. This is shown in figure 7.3. Figure 7.3: Two wavelet packet trees. The tree to the left is the full wavelet packets tree and results in a discrete STFT representation. The tree to the right is a pruned version. The gray leaves have been cut away. The light green leaves are new leaves that came up after the pruning. The leaves of the resulting pruned tree construct the adapted time-frequency distribution of the data sequence. &DOFXODWLRQRI)LOWHU&RHIILFLHQWV Once the filter coefficients of the QMF bank filters are chosen, the impulse response for each path from the root to all the leaves will be calculated. This can be done by first interpolating one of the low- or high-pass filters, g (k ) or h(k ) and then by recursively performing the operations: convolution with g (k ) or h(k ) , and again interpolation. Important here is in which order to take g (k ) and h(k ) throughout the recursion. It is for example very easy to see that three times g (k ) and once h(k ) results in a 1 0 filter, which yields x0 ( n) when it has x3 ( n) as input. One might expect that the order between the root and any leaf, as given in figure 7.2, gives the proper result, as in the example 77 above. This is however not the case. In the next section, an algorithm to calculate the proper filter from g (k ) and h(k ) is presented. ,PSOHPHQWDWLRQ The implementation of the adaptive wavelet packets analysis performs the following steps: 1. Energy detection, determining the outlook of the wavelet packets tree. 2. Calculating the necessary filters from g (k ) and h(k ) in a predefined order. 3. Performing the analysis and construct a time-frequency distribution. The energy detection is simply done by calculating a fast Fourier transform of the data sequence and reducing its amount of bins by averaging. The amount of bins has to be equal to the amount of leaves in the full wavelet packet tree. It is chosen before analysis and determines the highest frequency resolution of the resulting time-frequency distribution. Subsequently, the tree is pruned into a desired form, as described in 7.2.4. Once all the vertices (leaves) are known, their associated path filters can be calculated in the way described in 7.2.5. To do this efficiently, the vertices, including the root and the leaves will be given a number. The root will be given number 1. The internal vertices and the leaves xab (n) will be given the number 2 J − a + b . The vertices in the three will thus be numbered 1,2,3,... beginning with the root vertex (level=0), processing each level (level = J - j) of the three, beginning with the lowest low-pass filter output x 0j ( n) . The lowest low-pass filter outputs have the number 2 J − j = 2 level . Figure 7.4 shows how the vertices are numbered: level 0 1 level 1 level 2 4 2 3 5 6 7 Figure 7.4: Left: numbering of the vertices. 78 After the numbering, the vertices are reordered which is simply done by the following algorithm shown in figure 7.5. 1 a b=a+2level(a) 4 2 3 7 5 b a 6 b b=3×2level(a)-a-1 Figure 7.5: Calculating the reordered tree. The formulas to the right show how the new value of the vertices is gained and how they need to be calculated from previous vertices. The filter order for a specific path-filter is now determined by looking up the associated vertex in the reordered tree and finding the number of the same vertex in the original tree. The binary value of this number, where the first 1 is omitted, is the order in which g (k ) and h(k ) are applied in the algorithm that calculates the path-filter. A 1 means h(k ) and a 0 means g (k ) . A simple example will show how a path-filter is calculated, knowing its vertex in the QMF tree. Let us calculate the path-filter for signal x05 (n ) in a tree of three levels. Figure 7.6 shows the path through the QMF bank tree. h(n) h(n) ↓2 ↓2 x13 (n) x12 (n) g(n) ↓2 x12 (n) x30 ( n) 0 h(n) ↓2 x07 (n) g(n) ↓2 x06 ( n) h(n) ↓2 x05 (n) g(n) ↓2 x04 ( n) 5 Figure 7.6: Path from x3 (n) to x0 (n ) . The vertex number associated with x05 (n ) is computed by 2 J − a + b = 2 3 − 0 + 5 = 13 . Figure 7.7 shows its location in the full tree. Subsequently, this number (13) will be looked up in the reordered tree (figure 7.8). The number of the same vertex in the original tree (figure 7.7) will be used to determine the order of the filters g (k ) and h(k ) in the path-filter computation algorithm. 79 level 0 1 level 1 level 2 level 3 8 9 2 3 4 5 6 7 10 11 12 13 14 15 Figure 7.7: The original tree. Path from vertex 1 to vertex 13. level 0 1 level 1 level 2 level 3 8 15 2 3 4 7 5 6 11 12 9 14 10 13 Figure 7.8: Location of vertex 13 in the reordered three. As shown in figure 7.7 and 7.8, vertex 15 in the original tree is associated with vertex 13 in the reordered tree. This means that the path-filter for vertex 13 can be calculated by taking the binary value of 15 and omitting the first 1. The binary value for 15 is: 1111. The order of filters in the path-filter computation algorithm is then: h(k ) , h(k ) , h(k ) . The path-filter computation algorithm will perform the following steps: 1. Initialization f (k ) = h( k ) . 2. Interpolation of f (k ) , 3. Convolution f (k ) = f (k ) ∗ h (k ) . 4. Once more steps 2 and 3. Figure 7.9 proves that this indeed will result in the path-filter for vertex 13. F 2↑ π F 2π π 2π π 2π ∗ h(n) 2↑ π 2π F ∗ h(n) π 2π Figure 7.9: Visualization of the path-filter computation algorithm. It shows the path-filter computation for vertex 13. 80 The adaptive wavelet packets transform is implemented in MATLAB in the function: [tfd,f,t]=awpt(x,level,N,thr,fs); where x is the signal being analyzed, level is the number of levels in the QMF filterbank tree, N is the filterlength of the QMF filters, thr is the threshold in the energy detection and fs is the signals sampling frequency. The function is returning tfd, which is the resulting timefrequency distribution, t and f, respectively the time and frequency axis used to show the time-scale distribution. The commented source code for these functions are enclosed in a separate appendix. An example is shown in figure 7.10. Figure 7.10: Adaptive Wavelet Packets Transform of a signal containing three sinewaves in the whole time interval and a Dirac impulse local in time. The number of levels is 9, which results in 2 9 tmes higher frequency resolution than the time domain representation has, which is equal to half the sampling frequency. The QMF filters have 32 coefficients.The threshold value is set to 0.5. 81 $GDSWLYH:LQGRZ6KRUW7LPH)RXULHU7UDQVIRUP 2SWLPDODGDSWLYHZLQGRZ The optimal parameter Popt (Tˆ ) , or Popt (n) in a discrete time STFT, at each time would be selected by computing the short-time concentration C P (T ) , or C P (n ) in the discrete time case, as a function of the parameter and by choosing P which is associated with its maximum value. However, the determination of the concentration for a large number of parameters at each time could be quite time consuming. In [JD94] it is proposed only to calculate the concentration for a set of values Pi where i = 1,2,3,..., I . Where the values for P includes its maximum and minimum acceptable values. The resulting C Pi (n ) is a sampled version of C P (n ) . An estimate of Popt (n) can be obtained by interpolating between the samples C Pi (n ) to find the maximum value of C P (n ) . Since the concentration is slowly varying with P, C P (n ) can be sampled very coarsely. Experiments have shown that sampling once or twice per octave combined with quadratic or cubic polynomial interpolation yields excellent results. Once the optimal parameter value is computed at time n0 , the time slice X PSTFT (t , f ) can opt ( n 0 ) be computed based on that value. 7RZDUGVDQHIILFLHQWLPSOHPHQWDWLRQ The major expense of the algorithm is the calculation of the short-time concentration. The information in X PSTFT (t , f ) necessary to compute C P (n ) are the L4 and L2 norms of each time-slice: ∞ ∞ 4 c 4, P (Tˆ ) = ∫ X PSTFT (Tˆ , Fˆ ) dFˆ 2 c 2, P (Tˆ ) = ∫ X PSTFT (Tˆ , Fˆ ) dFˆ ∞ ∞ The short-time concentration can be computed as ∞ C P (T ) = 4 ∫ c 4,P (Tˆ ) w(Tˆ − T ) dTˆ −∞ ∞ 2 ( ∫ c 2, P (Tˆ ) w(Tˆ − T ) dTˆ ) = 2 C 4 ,P (T ) (C 2, P (T )) 2 (7-5) −∞ If the window function has compact support, which it will have in practice, the integrals in (7-5) are over finite intervals, and only the portions of c 2, P (Tˆ ) and c 4, P (Tˆ ) around Tˆ need to be stored. 82 The adaptive window short-time Fourier transform is implemented in MATLAB in the function: [tfd,f,t]=aw_stft(x,fftlen,p,fs); where x is the signal being analyzed, fftlen is the length of the FFT-slices, p is a vector containing the window lengths for which the short time time-frequency concetration is calculated and fs is the signals sampling frequency. The function is returning tfd, which is the resulting time-frequency distribution, t and f, respectively the time and frequency axis used to show the time-scale distribution. The commented source code for these functions are enclosed in a separate appendix. An example is shown in figure 7.11. Figure 7.11: Adaptive Window Short-Time Fourier Transform of a signal containing three local sinewaves and a two Dirac impulses local in time. The smalles window has 32 samples and the longest window has 256 samples. 83 84 &KDSWHU &RQFOXVLRQV ,QWURGXFWLRQ In this last chapter, this thesis will be concluded by a comparison of results. In chapter 2, basic time-frequency analysis is introduced, with its limitations. In chapter 3 and 4 the theory is presented which deals with these limitations. Then in chapter 5, the discrete case and implementations of the method in chapter 2 are described. These are made, mostly in order to illustrate its limitations. In chapter 6 and 7, the discrete cases and implementations of the theoretical methods in chapter 3 and 4 are described. In section 8.2 the methods in chapter 6 and 7 (discrete wavelet transform DWT, adaptive wavelet packets transform AWPT and adaptive window short-time Fourier transform AW-STFT) will be compared to the methods in chapter 5. It involves comparison of computational costs (speed) and quality of the resulting time-frequency distribution. At last, section 8.3 will depict expansions and improvements on this work. &RPSDULVRQRIUHVXOWV In chapter 2.4.8 it was already mentioned that the STFT has the disadvantage that it cannot show a time-frequency distribution with good time and good frequency resolution. Good time resolution has to be weighted against good frequency resolution. This is clearly shown in figure 8.1.a and figure 8.1b. A signal with two sinewaves in the whole time interval and a Dirac impulse at 0.0156 s. The signal has 1024 points and sampling frequency 16384 Hz. In figure 8.1.a and figure 8.1.b the signal is analyzed with QMF bank tree yielding the STFT representation (see chapter 5.5.2). The choice of method is justifiable because the results need to be comparable to the AWPT which functionality is based on the same theory. 85 In figure 8.1.a, the QMF bank has 3 levels, which results in a frequency resolution of 8192 / 8 = 1024 Hz. The time resolution is 8 / 16384 = 0.488 ms. These easy calculations are based on the facts that the time representation has the best time resolution, which is 1 / 16384 = 0.061 ms and that it has the worst frequency resolution, 16384 Hz. The three level QMF bank tree increases the frequency resolution by a factor 2³ = 8 and decreases the time resolution by a factor 8, compared to the resolutions of the original time sequence. In figure 8.1.b the number of levels is 7. The frequency resolution is here 8192 / 128 = 64 Hz, which is 16 times higher than used with figure 8.1.a. The time resolution is 128 / 16384 = 7.813 ms, which is 16 time lower than used with figure 8.1.b. Neither one of the two figures show clearly that the signal contains two sine waves and a Dirac impulse. In figure 8.1.a, the sine waves are scattered in frequency and in figure 8.1.b the Dirac impulse is scattered in time. Figure 8.1: a) Short window STFT. Figure 8.1: b) Long window STFT. Figure 8.1: c) Adaptive Wavelet Packets Transform AWPT. Figure 8.1.c shows the result of an adaptive wavelet packets transform (see section 7.2). The QMF bank tree applied here has 7 levels, just as the tree used with figure 8.1.b. This tree is however pruned in an optimal shape, which results in optimal frequency resolution for 86 stationary sine waves in the signal. Figure 8.1.c shows clearly that the signal contains two sine waves and a Dirac impulse. The sine waves are analyzed with a frequency resolution of 64 Hz, as in figure 8.1.b. The Dirac impulse is analyzed with different time resolutions along the frequency axis. The worst time resolution is 7.813 ms, as in figure 8.1.b. The best time resolution is in the frequency band 4096 – 8192 Hz and is 2 / 16384 = 0.122 ms which is even 4 times better than figure 8.1.a. The time needed to compute the TFDs in figure 8.1.a and 8.1.b was respectively 0.66 s1 and 46.42 s. The big difference here is caused by the number of levels in the tree. Since the AWPT has as much levels, it does not have the same computational complexity since it does not apply all the filters at the highest level. For the two tones in figure 8.1.c, the calculation of the TFD took only 4,9 s. Figure 8.2: a) Short window STFT. Figure 8.2: b) Long window STFT. Figure 8.2: c) Adaptive Window Short-Time Fourier Transform AW-STFT. In figure 8.2.a and 8.2.b, the same signal is analyzed (slightly shorter though, from 0-0.04 s, 700 data points), but now with an FFT based STFT algorithm (see section 5.4.1). The timewindows used are respectively 64 and 256 point Hamming windows. In figure 8.2.a, the time 1 Calculations were done in MATLAB on a Pentium 100 with Win95, 32 MB ram. 87 resolution is 64 / 16384 = 3.906 ms and the frequency resolution is 8192 / 64 = 128 Hz. In figure 8.2.b, the time resolution is 256 / 16384 = 15.625 ms and the frequency resolution is 8192 / 256 = 32 Hz. Figure 8.2.c shows the result of an adaptive window short-time Fourier transform (see section 7.3). The window length is adaptive along the time axis between 64 and 256 points. Figure 8.1.c shows clearly that the signal contains two sine waves and a Dirac impulse. The sine waves are analyzed with a frequency resolution of 8192 / 256 = 32 Hz, as in figure 8.2.b. The Dirac impulse is analyzed with a frequency resolution of 64 / 16384 = 3.906 ms. The time needed to compute the TFDs in figure 8.2.a and 8.2.b was respectively 1,31 s and 2,36 s. The difference here is caused only by the different window length since both methods used the same length for all the FFTs . For figure 8.1.c, the calculation of the TFD took 168,79 s, which is a much higher value. The extensive number of time-frequency concentration calculations causes this. The examples here also reflect the application of these methods. The STFT methods all yield uniform resolution TFDs, which means that they are not specifically optimized for the timefrequency analysis of signals with specific contents. They are however useful to get a fast interpretation of the content of the signal, if no prior knowledge about the contents is available. The adaptive methods AWPT and AW-STFT optimize the time-frequency analysis. The first method is typically suitable for the analysis of signals containing long duration sine waves with constant frequency for which optimal frequency resolution is desired. The optimization then gives better time resolution for frequency bands not containing any sine waves. The second method is suitable for the analysis of signals where transients are prioritized. Time intervals containing any stationary frequencies are then analyzed with good frequency resolution. The analysis of non-stationary time and frequency phenomena, for example sinewaves with varying frequency need to be analyzed with methods which optimize in both time and frequency. Since these methods are beyond the scope of the thesis they are not described here. In chapter 8.3, certain references for further reading concerning these methods are appended. )XUWKHUUHDGLQJ Since the next step on time-frequency analysis would be optimizing in both time and frequency, some further reading in this area is presented. Methods that will be described here belong to the class of energy distributions. These distributions are divided into two groups: the Cohen's class and the affine class [AF97]. The Cohen's class covers those TFDs that are 88 covariant by translations in time and frequency [CL89], like the STFT. The affine class covers those TFDs that are covariant by translation in time and dilation, like the CWT. In [AF97] examples are given of the reassignment method, which improves time-frequency concentration of energy distributions of both classes. In [BR93] the time-frequency window function or simply called kernel is optimized so that it is well matched to the signals content. In [JD95] this kernel is adapted over time to maximize the performance. 89 90 5HIHUHQFHV [AR93] Asselt, R. van, Pijlgroms, R. B. J., Wiskunde voor het hoger onderwijs, analyse en numerieke wiskunde, deel 2, Educative Partners Nederland BV, Culemborg, The Netherlands, 1993, ISBN 90-11-016904. [AR91] Asselt, R. van, Pijlgroms, R. B. J., Wiskunde voor het hoger onderwijs, analyse en numerieke wiskunde, deel 3, Educative Partners Nederland BV, Culemborg, The Netherlands, 1991, ISBN 90-11-019423. [AF97] Auger, F., Flandrin, P., Gonçalvès, P., Lemoine, O., Time-Frequency Toolbox, For Use with MATLAB, Tutorial, Centre National de la Recherche Scientifique, Paris, France, July 1997. [BR93] Baraniuk, R. G., Jones, D. L., Signal-Dependent Time-Frequency Analysis Using a Radially Gaussian Kernel, Signal Processing, vol. 32, no. 3, pp. 263-284, June 1993. [CM90] Cartwright, M., Fourier Methods for mathematicians, scientists and engineers, Ellis Horwood Limited, London, England, 1990, ISBN 0-13-327016-5.l. [CC92] Chui, C. K., An Introduction to Wavelets, Wavelet Analysis and its Applications Volume 1, Academic Press Inc., San Diego, USA, 1992, ISBN 0-12-174584-8. [CA96] Cohen, A., Kovaþeviü, J., Wavelets: The Mathematical Background, proceedings of the IEEE, April 1996. [CL89] Cohen, L., Time-Frequency Distributions – A Review, proceedings of the IEEE, 77(7):941-980, 1989. 91 [DI92] Daubechies, I., Ten Lectures on Wavelets, Society for Industrial and Applied Mathematics, Philadelphia, 1992, ISBN 0-89871-274-2. [HC94] Heil, C. E., Walnut, D. F., Continuous and Discrete Wavelet Transforms, Society for Industrial and Applied Mathematics, SIAM Review vol.31 no.4 pp. 628-666, 1994. [HB96] Hubbard, B. B., The World According to Wavelets, The Story of a Mathematical Technique in the Making, A K Peters Ltd., Wellesley, Massachusetts, 1996, ISBN 1-56881-047-4. [JD94] Jones, D. L., Baraniuk, R. G., A simple scheme for adapting time-frequency representations, Department of Electrical and Computer Engineering, Rice University, Houston, IEEE Transactions on Signal processing, Vol. 42, No. 12, Dec. 1994. [JD95] Jones, D. L., Baraniuk, R. G., An Adaptive Optima-Kernel Time-Frequency Representation, IEEE Transactions on Signal Processing, vol. 43, no. 11, pp. 2361-2371, October 1995. [LA94] Lyngsjö, A., Winberg, M., Detektion av transienta undervattenssignaler med wavelettransform, Institutionen för Teletransmissionteori, Lunds Tekniska Högskola, Lund, Sweden, September 1994. [MY93] Meyer, Y., Wavelets, Algorithms & Applications, Society for Industrial and Applied Mathematics, Philadelphia, 1993, ISBN 0-89871-309-9. [MM96] Misti, M., Misti, Y., Oppenheim, G., Poggi, J. M., Wavelet Toolbox, For Use with MATLAB, The Mathworks Inc., Natick, Massachusetts, 1996. [MS98] Mitra, S. K., Digital Signal Processing, A Computer-Based Approach, Department of Electrical and Computer Engineering, University of California, Santa Barbara, USA, 1998, ISBN 0-07-042953-7. 92 [PE91] Pearson, E. R. S., The Multiresolution Fourier Transform and its application to Polyphonic Audio Analysis, University of Warwick, Department of Computer Science, Warwick, 1991, Research Thesis RT282. [PJ96] Proakis, J. G., Manolakis, D. G., Digital Signal processing: principles, algorithms, and applications, Prentice-Hall Inc., Upper Saddle River, New Jersy, USA, 1996. [RO91] Rioul, O., Vetterli, M., Wavelets and Signal processing, IEEE Signal Processing Magazine, October 1991. [SG96] Strang, G., Nguyen, T., Wavelets and Filter banks, Wellesley-Cambridge Press, Wellesley, 1996, ISBN 0-9614088-2-0. [UM95] Ueda, M., Lodha, S., Wavelets: An Elementary Introduction and Examples, Baskin Center for Computer Engineering & Information Sciences, University of California, Santa Cruz, 1995. [VB91] Vidakoviü, B., Müller, P., Wavelets for Kids, A Tutorial Introduction, Duke University, Institute of Statistics and Decision Sciences, Durham, 1991. 93 94 ,QGH[ A accuracy.................................................................23 adaptive time-frequency analysis ...........................13 adaptive wavelet packets transform.......................82 adaptive window short-time Fourier transform.43,84 affine class .............................................................88 algorithm................................................................11 aliasing effect.........................................................68 amplitude error ......................................................50 analysis filter .........................................................68 analyzing function.............................................16, 20 angular frequency...................................................16 average space.........................................................65 AWPT....................................................................85 AW-STFT..............................................................85 B bandpass filter............................................20, 40, 58 bandwidth ..............................................................21 branche...................................................................76 C Cauchy-Schwarz inequality....................................27 center .....................................................................19 Cohen's class..........................................................88 compact support.....................................................66 completeness..........................................................65 conclusions ............................................................85 constant-Q-filtering................................................40 containment ............................................................65 continuous wavelet transforms ...............................37 convolution ............................................................20 critically sampled ..................................................68 CWT ......................................................................38 D datasequence ..........................................................11 decomposition........................................................11 detail space ............................................................65 DFT........................................................................49 digital filters ..........................................................65 dilation...................................................................40 Dirac impulse........................................................ 24 discrete Fourier transform..................................... 51 discrete short-time Fourier transform.................... 49 discrete wavelet transform.............................. 37, 63 downsampling....................................................... 68 DWT ..................................................................... 63 dyadic scales......................................................... 63 dyadic translation.................................................. 64 dyadic wavelets .................................................... 63 E energy distributions ............................................... 88 F fast Fourier transform............................................ 53 fast wavelet transform........................................... 63 father wavelet........................................................ 65 FFT ....................................................................... 49 filterbank............................................................... 15 finite impulse response.......................................... 58 FIR ........................................................................ 58 Fourier .................................................................. 12 Fourier coefficients ............................................... 16 Fourier integral ..................................................... 12 Fourier scaling property........................................ 41 Fourier series ........................................................ 16 Fourier spectrum................................................... 12 Fourier theory........................................................ 12 Fourier transform ............................................ 12, 15 frequency-window ................................................ 21 FWT...................................................................... 63 G Gabor transform.................................................... 31 Gaussian function.................................................. 31 H Heisenberg frames................................................. 21 Heisenberg uncertainty principle..................... 15, 27 Hilbert space......................................................... 65 95 I impulse response ................................................... 20 instances ................................................................ 18 intersection............................................................ 65 inverse transform................................................... 11 K kernel..................................................................... 89 L leaf ........................................................................ 76 leakage .................................................................. 21 linear phase ........................................................... 69 linear time-invariant.............................................. 68 LTI......................................................................... 68 M magnitude reserving............................................... 69 mean...................................................................... 19 MFT ...................................................................... 34 mother wavelet................................................ 37, 64 MRFT.................................................................... 44 M-STFT ................................................................ 34 MRA...................................................................... 63 multiresolution analysis................................... 63, 65 multiresolution Fourier transform.......................... 43 multiresolution time-frequency analysis ................ 33 multiscale short-time Fourier transform ................ 34 N normalization......................................................... 34 O optimal adaptive window...................................... 83 optimal time-varying parameter............................. 48 orthogonal.............................................................. 68 orthogonal complement.......................................... 65 orthogonal decomposition ..................................... 65 orthonormal basis .................................................. 65 overlap factor ........................................................ 50 P 96 parameter discretization ........................................49 Parseval Identity..............................................27, 39 phase reserving......................................................69 profile....................................................................42 pruning...................................................................76 Q quantization............................................................51 R radius.....................................................................19 reassignment method..............................................89 reference space......................................................65 resolution...............................................................23 S scale parameter......................................................34 scaling function......................................................65 scaling property...............................................22, 66 scalogram ........................................................44, 70 scattering effect......................................................47 short-time Fourier transform..................................15 short-time time-frequency concentration................48 sinusoid .................................................................23 similar ...................................................................66 spectrogram.....................................................15, 27 stationary...............................................................17 STFT .....................................................................17 stride......................................................................49 subband coding......................................................68 synthesis filter........................................................68 T theorem of Euler-Fourier .......................................16 time-frequency distribution..............................17, 21 time-frequency distribution matrix.........................53 time-frequency frames ...........................................21 time-frequency localization ...................................17 time-frequency plane .......................................15, 18 time-scale analysis ................................................33 transform parameters .............................................37 translation..............................................................19 translation parameter .............................................38 two-scale relation..................................................66 two-scale sequence................................................66 U uniform resolution time-frequency analysis............15 upsampling.............................................................68 V variance .................................................................19 vertex.....................................................................76 vertices ..................................................................76 W wavelet coefficients ...............................................63 wavelet composition..............................................67 wavelet decomposition ......................................... 67 wavelet family....................................................... 64 wavelet function.................................................... 65 wavelet packet tree ............................................... 76 wavelet packets..................................................... 73 wavelet transform.................................................. 33 wavelets ................................................................ 37 window ................................................................. 18 windowed Fourier transform................................. 17 Z z-transform............................................................ 69 97 98 $SSHQGL[ 99 100 $SSHQGL[$ 6\PERO/LVW The table below describes the symbols used in this thesis. Symbol Description T, t Variable representing respectively continuous and discrete time F,f Variable representing respectively continuous and discrete frequency [Hz] Ω,ω Variable representing respectively continuous and discrete angular frequency [rad/s], where Ω = 2π F and ω = 2π f . x( T ) Function x of continuous variable T. X ( A, B ,...) Function X of variables A,B,.... which is a transform of function x( T ) . x( t ) Function x of discrete variable t. X (a , b,...) Function X of discrete variables a,b,.... which is a discrete transform of function x( t ) . FT, STFT, M-STFT, CWT, ... Transform operator, corresponds to used abbreviations, e.g. the Fourier Transform: X (Ω) =FT [ x( T ) ] v, M Vector v and matrix M vt , M t Transponate of a vector v and matrix M a Complex conjugate of complex variable a 101 102 $SSHQGL[% $EEUHYLDWLRQV AWPT Adaptive Wavelet Packets Transform AW-STFT Adaptive Window Short-Time Fourier Transform CWT Continuous Wavelet Transform DFT Discrete Fourier Transform DWT Discrete Wavelet Transform FFT Fast Fourier Transform FIR Finite Impulse Response FT Fourier Transform FWT Fast Wavelet Transform LTI Linear Time-Invariant M-STFT Multiscale Short-Time Fourier TransformL MRFT Multiresolution Fourier Transform QMF Quadrature Mirror Filter STFT Short-Time Fourier Transform TFD Time-Frequency Distribution 103 104 $SSHQGL[& 0DWKHPDWLFDO3URRI Theorem: Re{ xf ( x ) f ' ( x)} = 12 x dxd f ( x) 2 (A.1) Proof: Re{ xf ( x ) f ' ( x)} = x Re{ f ( x) f ' ( x )} − x Im{ f ( x) f ' ( x)} = x Re{ f ( x) f ' ( x )} + x Im{ f ( x) f ' ( x)} = 12 x ⋅ 2 Re{ f ( x)} Re{ f ' ( x )} + 12 x ⋅ 2 Im{ f ( x )} Im{ f ' ( x )} 2 2 d d Re{ f ( x )} + 12 x Im{ f ( x )} = 12 x dx dx d 2 2 1 Re { f ( x )} + Im { f ( x)} =2x dx 2 d Re2 { f ( x )} + Im2 { f ( x )} = 12 x dx 2 d f ( x) = 12 x dx ( ( ) ( ) ) ( (A.2) ) Theorem: F g( F ) = 2 2 1 d g( T ) 4π 2 dT 2 (A.3) Proof: F g (F ) 2 2 1 d FT =F g (T ) j 2πF dT 2 2 F d FT = g (T ) 2 2 4π F dT 2 2 (A.4) 105 Theorem: ∞ 2 T 2 − 2α ∫T e = −∞ 3 π (2α )2 2 (A.5) Proof: ∞ ∫T e −∞ 2 T 2 − 2α = ∞ ∫T −∞ 2 − aT 2 [ e e 2 − jΩ T dT where Ω = 0, a = ] = FT T 2 e− aT where Ω = 0, a = =− [ ] 1 2α 1 2α 2 2 1 d − aT where Ω = 0, a = 2 FT e 2α dΩ Ω 2 1 π d 2 − 4a ( ) where Ω = 0, a = =− 2 e 2α a dΩ 2 Ω − 1 π d (Ωe 4 a ) where Ω = 0, a = = 2 4a dΩ 2α 2 Ω − 1 π 4a ( )(1 − 12 aΩ 2 ) where Ω = 0, a = =− e 3 4a 2α 2 π = (2α )3 2 106 (A.6)