Windowed Fourier Transforms

Chapter 2 Windowed Fourier Transforms Summary-. Fourier series are ideal for analyzing periodic signals, since the har­ monic modes used in the expan...
Author: Brooke Cox
3 downloads 1 Views 4MB Size
Chapter 2

Windowed Fourier Transforms Summary-. Fourier series are ideal for analyzing periodic signals, since the har­ monic modes used in the expansions are themselves periodic. By contrast, the Fourier integral transform is a far less natural tool because it uses periodic functions to expand nonperiodic signals. Two possible substitutes are the win­ dowed Fourier transform (WFT) and the wavelet transform. In this chapter we motivate and define the WFT and show how it can be used to give information about signals simultaneously in the time domain and the frequency domain. We then derive the counterpart of the inverse Fourier transform, which allows us to reconstruct a signal from its WFT. Finally, we find a necessary and suf­ ficient condition that an otherwise arbitrary function of time and frequency must satisfy in order to be the WFT of a time signal with respect to a given window and introduce a method of processing signals simultaneously in time and frequency. Prerequisites: Chapter 1. 2.1 M o t i v a t i o n a n d D e f i n i t i o n of t h e W F T Suppose we want to analyze a piece of music for its frequency content. T h e piece, as perceived by an eardrum, may be accurately modeled by a function f(t) representing t h e air pressure on the eardrum as a function of time. If the "music" consists of a single, steady note with fundamental frequency CJI (in cycles per unit time), then f(i) is periodic with period P = 1/UJI and the natural description of its frequency contents is the Fourier series, since the Fourier coefficients cn give the amplitudes of the various harmonic frequencies un = nuj\ occurring in / (Section 1.4). If the music is a series of such notes or a melody, then it is not periodic in general and we cannot use Fourier series directly. One approach in this case is to compute the Fourier integral transform f(u>) of / ( £ ) . However, this method is flawed from a practical point of view: To compute f(uj) we must integrate f(t) over all time, hence f(u) contains the total amplitude for the frequency u> in the entire piece rather t h a n the distribution of harmonics in each individual note! Thus, if the piece went on for some length of time, we would need to wait until it was over before computing / , and then the result would be completely uninformative from a musical point of view. (The same is true, of course, if f(t) represents a speech signal or, in the multidimensional case, an image or a video signal.) Another approach is t o chop / u p into approximately single notes and analyze each note separately. This analysis has the obvious drawback of being

G. Kaiser, A Friendly Guide to Wavelets, Modern Birkhäuser Classics, DOI 10.1007/978-0-8176-8111-1_2, © Gerald Kaiser 2011

44

2. Windowed Fourier Transforms

45

somewhat arbitrary, since it is impossible to state exactly when a given note ends and the next one begins. Different ways of chopping up the signal may result in widely different analyses. Furthermore, this type of analysis must be tailored to the particular signal at hand (to decide how to partition the signal into notes, for example), so it is not "automatic." To devise a more natural approach, we borrow some inspiration from our experience of hearing. Our ears can hear continuous changes in tone as well as abrupt ones, and they do so without an arbitrary partition of the signal into "notes." We will construct a very simple model for hearing that, while physiologically quite inaccurate (see Roederer [1975], Backus [1977]), will serve mainly as a device for motivating the definition of the windowed Fourier transform. Since the ear analyzes the frequency distribution of a given signal / in real time, it must give information about / simultaneously in the frequency domain and the time domain. Thus we model the output of the ear by a function f(io,t) depending on both the frequency u and the time t. For any fixed value of t, /(a;, t) represents the frequency distribution "heard" at time t, and this distri­ bution varies with t. Since the ear cannot analyze what has not yet occurred, only the values f(u) for u < t can be used in computing f(uj,t). It is also rea­ sonable to assume that the ear has a finite "memory." This means that there is a time interval T > 0 such that only the values f(u) for u > t — T can influence the output at time t. Thus f(uj,t) can only depend on f(u) for t — T < u < t. Finally, we expect that values f(u) near the endpoints u^t — T and u « t have less influence on f(uj,t) than values in the middle of the interval. These state­ ments can be formulated mathematically as follows: Let g(u) be a function that vanishes outside the interval — T < u < 0, i.e., such that suppg C [—T, 0]. g{u) will be a weight function, or window, which will be used to "localize" signals in time. We allow g to be complex-valued, although in many applications it may be real. For every t G R , define ft(u)=g(u-t)f(u),

(2.1)

where g(u — t) = g(u — t). Then supp/t C [t — T, t], and we think of ft as a localized version of / that depends only on the values f(u) for t — T < u < t. If g is continuous, then the values ft(u) with u « t — T and u^t are small. This means that the above localization is smooth rather than abrupt, a quality that will be seen to be important. We now define the windowed Fourier transform (WFT) of / as the Fourier transform of ft: oo

,«, =

/

du J — oo

du e - 2 " " " ft(u)

"°°

e-^iuug(u-t)f(u).

(2-2)

A Friendly Guide to Wavelets

46

As promised, f(u>, t) depends on f(u) only for t - T < u < t and (if g is continuous) gives little weight to the values of / near the endpoints. Note: (a) T h e condition s u p p # C [—T,0] was imposed mainly to give a physical motivation for the W F T . In order for the W F T t o make sense, as well as for the reconstruction formula (Section 2.3) t o be valid, it will only be necessary to assume t h a t g(u) is square-integrable, i.e. g G L 2 ( R ) . (b) In the extreme case when g(u) = 1 (so g £ L 2 ( R ) ) , the W F T reduces t o the ordinary Fourier transform. In the following we merely assume t h a t g € L 2 ( R ) .

3500

F i g u r e 2 . 1 . Top: The chirp signal f(u) = sin(-7ru2). Bottom: The spectral energy density |/(u;)| 2 of / . If we define guM=

e27rt"ug(u-t),

(2.3)

2

then H&^tH = \\g\\] hence gu,t also belongs t o L ( R ) , and the W F T can b e expressed as the inner product of / with g^t >

f{u,t)

= {gu,t,f)

=9Zttf>

(2.4)

which makes sense if both functions are in L 2 ( R ) . (See Sections 1.2 and 1.3 for the definition and explanation of the "star notation" g*f.) I t is useful to think

2. Windowed Fourier Transforms

47

of gu^ as a "musical note" t h a t oscillates at the frequency u inside the envelope defined by \g(u — t)\ as a function of u. E x a m p l e 2 . 1 : W F T of a C h i r p Signal. A chirp (in radar terminology) is a signal with a reasonably well defined but steadily rising frequency, such as f(u) In fact, the instantaneous of its phase:

= sin(7rw 2 ).

(2.5)

frequency u;i ns t(w) of / may be defined as the derivative 2iru;-mst(u) = du(iru2)

= 2iru .

(2.6)

Ordinary Fourier analysis hides the fact t h a t a chirp has a well-defined instanta­ neous frequency by integrating over all of time (or, practically, over a long time period), thus arriving at a very broad frequency spectrum. Figure 2.1 shows f(u) for 0 < u < 10 and its Fourier (spectral) energy density | / ( C J ) | 2 in t h a t range. The spectrum is indeed seen to be very spread out. We now analyze / using the window function , . f 1 + cos(-7ra) g(u) = < I0

—1 < u < 1 . otherwise,

(2.7)

which is pictured in Figure 2.2. (We have centered g(u) around u = 0, so it is not causal; but g(u + 1) is causal with r = 2.)

-1.5

-1

-0.5

0

0.5

F i g u r e 2.2. The window function g(u). Figure 2.3 shows the localized version fs(u) of f(u) and its energy density 2 | / S ( C J ) | 2 = | / ( ^ , 3)| . As expected, the localized signal has a well-defined (though not exact!) frequency Wi ns t(3) = 3. It is, therefore, reasonably well localized b o t h

A Friendly Guide to Wavelets

48

8000 6000 h 4000 h 2000

Figure 2.3. Top: The localized version f^u) of the chirp signal in Fig­ ure 2.1 using the window g(u) in Figure 2.2. Bottom: The spectral energy density of fo showing good localization around the instantaneous frequency ^inst(3) = 3.

in time and in frequency. Figure 2.4 repeats this analysis at t = 7. Now the energy is localized near a>inst(7) = 7. Figures 2.5 and 2.6 illustrate frequency resolution. In the top of Figure 2.5 we plot the function h(u) = Re [g2Au)

+ #4, 6 (»]

= g(u — 4) cos(4-7rw) + g(u — 6) cos(87rn),

(2.8)

which represents the real part of the sum of two "notes": One centered at t = 4 with frequency u = 2 and the other centered at t = 6 with frequency LJ — 4. T h e b o t t o m part of the figure shows the spectral energy density of h. T h e two peaks are essentially copies of |