SIO B, Rudnick! XVIII.Wavelets The goal o a wavelet transorm is a description o a time series that is both requency and time selective. The wavelet transorm can be contrasted with the well-known and very useul Fourier transorm whose basis unctions are sinusoids. Sinusoidal basis unctions are extremely selective in requency, having line spectra, but are not selective at all in time as they are nonzero at ±. The wavelets in a wavelet transorm are unctions that are simultaneously compact in requency and time. Wavelet transorms are thereore useul to analyze time series in which the requency content changes with time. We start with a deinition o the Fourier transorm! ĝ o a time series!! ĝ( ) = g( t)e iπ t dt () where is requency in cycles per unit time. Note that the units o! ĝ are units o g times unit time. The inverse Fourier transorm is! g( t) = ĝ( )e iπ t d () The Fourier transorm is an exact representation o the time series g in requency space. By looking at the statistics o! ĝ, we can look at typical properties o g as a unction o requency, as the spectrum describes variance vs.. On the other hand, a single Fourier transorm may not be especially useul i the goal is to examine the intermittency o! g t. Although a sequence o Fourier transorms may address this problem, we will discuss the advantages o wavelets below. Consider a unction! ψ t such that g( t)! C ψ = d < (3) The unction ψ is called a wavelet, and the inequality above is called the admissibility condition. The admissibility condition assures that the wavelet is compact in requency, and has zero mean! ( ) = ψ ( t)dt = (4) Sinusoids are thus candidate wavelets. The mother wavelet! ψ t is usually chosen so it is also compact in time. A amily o wavelets! t is derived rom the mother wavelet as ψ s,t! ψ s,t ( t) = s ψ t t (5) s
SIO B, Rudnick!.5 ψ.5 5 5 Time (period) 3 ˆψ 4 3 3 4 Frequency (/period) Figure. The Morlet wavelet or s =, t =, and k = (top), real (blue) and imaginary (green) parts. The absolute value o the Fourier transorm o the Morlet wavelet (bottom). Here, s contracts and dilates, and t changes the central time. The actor wavelets have identical energy In this notation, the mother wavelet! ψ t is chosen so that all! ψ s,t t = ψ t (6). An example is the Morlet wavelet (Figures -), urther discussed below. The mother wavelet is oten chosen so that its energy is equal to one, although this is not a requirement (and is not the case in Figures -). Wavelet transorm dt =ψ, ( t) dt s A wavelet transorm is deined to be, where * signiies a complex conjugate,!g ( s,t ) = g( t)ψ s,t ( t)dt! (7) = g( t) s t t ψ s dt
SIO B, Rudnick!3.5 ψ.5 5 5 Time (period) 4 3 ˆψ 4 3 3 4 Frequency (/period) Figure. The Morlet wavelet or s =, t = 3, and k = (top), real (blue) and imaginary (green) parts. The absolute value o the Fourier transorm o the Morlet wavelet (bottom). So, the wavelet transorm is simply a convolution with a bunch o specially chosen unctions. Because it is a convolution, it is most eiciently calculated in requency space. The Fourier transorm o a wavelet is! s,t ( ) = s ψ t t (8) s e iπ t dt Making the substitution! u = t t yields s! ˆ ( ) = s e iπ t ψ ( u)e iπ su du (9) ψ s,t The integral is the Fourier transorm o ψ as a unction o requency s! ˆ ( ) = s ( s)e iπ t () ψ s,t An example is the Fourier transorm o the Morlet wavelet (Figures -). By Parseval s theorem, the integral o the product o two unctions o time is equal to the integral o the product o the unctions Fourier transorms, so (7) implies
SIO B, Rudnick!4!!g ( s,t ) = ĝ( ) s,t ( )d () Substituting () into () gives an expression or the wavelet transorm as an integral over requency!!g ( s,t ) = s ĝ( ) ( s)e iπ t d () The most eicient way to calculate the wavelet transorm or a given scale s is to ind! ĝ and ĝ( ) ˆ!, orm the product! ψ s, and perorm the inverse Fourier transorm. The Fourier transorm o the time series g is calculated with an FFT. Since the mother wavelet is a prescribed unction, its Fourier transorm is usually known analytically. This procedure can be done or an arbitrary number o scales s. I reconstruction or the signal rom wavelet coeicients is a goal (rarely the case in oceanographic applications), then attention must be paid to resolution in s. Inverse wavelet transorm A wavelet transorm takes a one-dimensional time series into a two-dimensional space (s,t). There are an ininite number o ways to do the inverse wavelet transorm to return rom the two-dimensional space to the unction o time. One inverse wavelet transorm is! g( t) = C ψ!g ( s,t )ψ s,t ( t) s dt ds (3) where Cψ is given by (3). This is proved by substituting or inverse Fourier transorm o!. Consider the integral, and replacing ψ with the! = g ( t )ψ s,t ( t )d t (4) ψ t s,t s dt ds Use () and rearrange to get! I = g ( t ) s ( s) ( hs)e iπ t iπ ht iπ h e e ( )t dt d dhd (5) t ds Since the delta unction is we get I =!g ( s,t )ψ s,t t = g t ˆ s dt ds ψ s,t ( )e iπ t d s,t = e iπ t dt!g s,t ( h)e iπ ht dh s d t dt ds! δ (6)
SIO B, Rudnick!5! I = g ( t ) s iπ t ( s) ( s)ds e ( t ) d (7) d t Make the substitution! u = s in the irst integral in parentheses, and recognize that the second integral in parentheses is the delta unction to get Using (3) and the validity o (3) is proved. where Another inverse wavelet transorm is ˆ ψ u! I = du g ( t )δ ( t t )d t (8) u! I = C ψ g t (9)! g t!g s,t ds ()! C δ = d () The goal in oceanographic data analysis is not oten reconstruction, but in any case, this is the inverse wavelet transorm I use. Wavelet energy density A measure o the energy o g(t) may be written as! g t = C ψ!g s,t ()!g s,t The proo o () closely ollows the proo o (3). It is reasonable to consider! to be C ψ s the energy density in the s-t plane. This energy density is the analogous to the spectrum gotten rom Fourier analysis. The plot o this quantity is sometimes called the scalogram (Figure 3). Morlet wavelet dt = C δ The Morlet wavelet (Figures -) seems to be the one most oten used in time series. We will see later that it is optimum in a desirable sense. The Morlet wavelet consists o a Gaussian multiplying a complex exponential unction! ψ t (3) Here k is a parameter that controls how many wiggles inside the Gaussian envelope. The Fourier transorm o the Morlet wavelet is s 3 = e iπ kt e t s dsdt
SIO B, Rudnick!6 = π e π! ( k ) (4) Note that the Morlet wavelet does not satisy the admissibility condition (3). But with a typical choice o the parameter k =,!, approaching numerical precision. As the Fourier = 6.7 9 transorm o the Morlet wavelet is what is needed to calculate the wavelet transorm as in (), one can set!. The resulting wavelet is not quite (3), but it is very close. = Central times and requencies, and spreads The central requency o a wavelet is deined as! s = B ψ ˆ (5) where the s subscript is intended to make clear that the central requency depends on s, and d! B ψ = s,t = ψ s,t t (6) In general, the central requency at arbitrary s can be related to the central requency at s = ψ s,t d dt For the Morlet wavelet,! B ψ = π, and!! s = s (7) s = k s (8) So, in general, The squared spread in requency o a wavelet is deined as and or the Morlet wavelet! σ,s = B ψ s ψ s,t (9)! = σ, (3)! = 8π s (3) The central time o a wavelet is rather trivial, but in any case it is! t = B ψ t ψ s,t t (3) In general, the mother wavelet can always be constructed so that the central time! t = t. The Morlet is sensibly constructed this way. ˆ The squared spread in time o a wavelet is deined as σ,s σ,s s dt d
SIO B, Rudnick!7 In general, and or the Morlet wavelet ψ s,t ( t) dt! σ t = B (33),s ψ t t! σ t = s σ (34),s t,! σ t (35),s The quality actor Q o a wavelet is the ratio o its central requency to its spread. Q may be amiliar as a handy quantity in describing a damped harmonic oscillator, such as a bell. A bell with a high Q rings or a long time ater being struck, beore being damped out. The Q o a wavelet is independent o scale s! Q = = (36) σ,s Thus one o the chie advantages o wavelets is that the Q o all wavelets in a amily are identical. The Q o a Morlet wavelet is! Q = π k (37) An interpretation o Q or the Morlet wavelet is the radians in the sinusoid rom center o the Gaussian envelope to where the envelope is down to e -. So constant Q means the same number o wiggles in the wavelets (as in Figures -). Uncertainty principle There is a limit on how well a wavelet can resolve in requency and in time. This wavelet uncertainty principle is quite analogous to the Heisenberg uncertainty principle o quantum mechanics. With the spread in requency and time o a wavelet deined by (9) and (33), the uncertainty principle states! σ σ t 4π (38) In order to prove the uncertainty principle, we need Schwarz s inequality! g,g (39) where g and h are vectors in a Hilbert space. For nonzero g, the equality in (39) holds i and only i h = or g = αh. = s In our case, g and h are complex unctions, and the inner product is By Parseval s theorem the spread in requency (9) may be written s σ, ( h,h) ( g,h)!( g,h) = g ( t)h( t)dt (4)
SIO B, Rudnick!8 where the subscripts s, t are dropped, and the ψ!! σ = 4π B ψ ψ t (4) application o Schwarz s inequality, using (33) and (4), yields is the time derivative o the wavelet. An! σ t σ 4π B ψ ψ ( ψ! iπ ψ )dt (4) Writing ψ as! ψ ( t) = A( t)e iϕ ( t) (43) where A and φ are both real,! ψ! is! ψ! = ( A! + i!ϕ A)e iϕ (44) and the integral on the rhs o (4) becomes! I = t t dt (45) The irst term in (45), the real part o the integral, may be integrated by parts! Re I A dt = ψ dt = B ψ (46) where we have assumed! lim A =, a sae assumption or a wavelet. The absolute value squared t o the integral is required in (4), so Inserting (47) back into (4), we have proved I = Re I + Im I! (47) = B ψ + (!ϕ π )( t t 4 ) A dt! σ t σ 4π (48) which completes the proo o the uncertainty principle (38). It is easy to prove that the equality in (48) applies or the Morlet wavelet, using the spreads (3) and (35). In the sense o having the smallest possible product o spreads in requency and time, the Morlet wavelet is thus optimal. Example! t t iπ ψ ( t) dt A A! + i (!ϕ π ) A = A simple example o the application o wavelets considers a time series whose irst hal consists o a sin wave o requency, and whose second hal a sin o requency.5 (Figure 3). The wavelet transorm is calculated using a Morlet wavelet with k =, or scales s =, +n/4,...,n in units o the time step (here.). The parameter n is called the number o voices per octave. The scalogram is plotted as a unction o time and requency, where the relation between requency and time is given by (8). As requency is the inverse o scale s, the energy () in terms o requency becomes
SIO B, Rudnick!9 dt! g t = kc ψ (49)!g,t d dt!g,t The energy density! is plotted in Figure 3. Note the spread in requency o the peaks in kc ψ the scalogram depend on the central requency o the peaks, consistent with the constancy o Q o the Morlet wavelet..5 g Frequency (/period).5 5 5 Time (period) Scalogram o g.5.5.8.6.4 5 5 Time (period) Figure 3. A time series (top) and its scalogram (bottom). The time series has a period o or the irst hal o the record, and a period o or the second hal. The scalogram quantiies this behavior. A Morlet wavelet with k = is used. lower requency peak is sharper and narrower, consistent with constant Q...4.8..6.4.6