FOURIER TRANSFORMS AND SERIES A brief introduction, serving as a supplement to my lectures by Tak Igusa Department of Civil Engineering Johns Hopkins University 1 1.1 Definitions Preliminaries Here are some mathematical relations that are useful in studying Fourier transforms and series. Convolution, (g ∗ h) (t). This is the integral (g ∗ h) (t) = Z ∞ −∞ g (s) h (t − s) ds = Z ∞ −∞ g (t − s) h (s) ds The two forms of the integral are equivalent, as can be shown by a simple change of variables. It can be seen that convolution is commutative: g ∗ h = h ∗ g. Rectangular function, rect (t). This function has a rectangular shape, with unit height for values of t between ±1/2: rect (t) = ( if |t| < 1/2 otherwise 1 0 The width of this function can be easily altered by scaling the argument. So the function rect (t/t0 ) has unit height for values of t between ±t0 /2. 1 -1/2 0 1/2 t Plot of the rect (t) function. Dirac delta function, δ (t). This can be approximated as a sharp, upward spike with unit area centered at t = 0. If we replace the argument by t = s−τ , then the spike will occur when s = τ . One way to visualize the Dirac delta function is to consider a rectangular function with height 1/t0 for values of t between ±t0 /2. According to the preceding paragraph, this function is given by rect (t/t0 ) /t0 . If we let t0 become small, then the function approaches a very narrow and high spike. The area, however, remains at unity. Hence, the function rect (t/t0 ) /t0 becomes a good approximation to the Dirac delta function when t0 becomes small. The Dirac delta function is useful in simplifying integrals, as in Z ∞ δ (s) g (s) ds = g (0) and −∞ Z ∞ −∞ 1 δ (s) g (t − s) ds = g (t) This can be visualized using the rectangular function concept: Z ∞ −∞ µ Z ∞ ¶ 1 s 1 Z t0 /2 rect g (s) ds = g (s) ds t0 t0 −t0 /2 −∞ t0 t0 t0 = average of g (s) for − < s < 2 2 ≈ g (0) for small t0 δ (s) g (s) ds ≈ It can be shown in several ways that δ (t/t0 ) = t0 δ (t). We can place a time shift in the Dirac delta function by using the form δ (s − t0 ). In this case, the spike occurs when s − t0 = 0 which is equivalent to s = t0 . If we substitute the shifted Dirac delta function into the above integral we get Z ∞ −∞ δ (s − t0 ) g (t − s) ds = g (t − t0 ) It is noted that we can rewrite the above relations using the convolution notation: δ ∗ g = g and δ (t − t0 ) ∗ g (t) = g (t − t0 ) which is convenient in the analysis of sampled data. Sign (signum) function, sgn (t). This is a function that gives the sign of t: ⎧ ⎪ ⎨ +1 sgn (t) = ⎪ 0 ⎩ −1 if t > 0 if t = 0 if t < 0 It is a step function with a discontinuity at the origin, as shown below. 1 0 t -1 Plot of the sgn (t) function. If the sign function is differentiated, then the result is twice the Dirac delta function: d sgn (t) = 2δ (t) dt The easiest way to show this is to integrate this equation. The sign function is used to model data with step discontinuities. Even, odd functions. These are functions with the following symmetry relations: g (t) = g (−t) h (t) = −h (−t) even function odd function Any function can be expressed as a sum of an even and odd function as follows: g (t) = geven (t) + godd (t) g (t) + g (−t) g (t) − g (−t) geven (t) = , godd (t) = 2 2 2 This can be verified by substitution. Argument sign reversal, g̃. It is sometimes convenient to reverse the sign of the argument: g̃ (t) = g (−t) particularly in statistics. Periodic functions. A function g (t) is periodic with period T if the following relation always holds: g (t + T ) = g (t) If a function if periodic, then it is only necessary to define the function over an interval of width T , because the function repeats itself in the regions outside of this interval. It is usually convenient to center this interval at the origin, so g (t) is defined for |t| < T /2. Convolutions of periodic functions. If g (t) is periodic with period T , then the convolution of g with other function h is also periodic with period T : (g ∗ h) (t + T ) = 1.2 Z ∞ −∞ g (t + T − s) h (s) ds = Z ∞ −∞ g (t − s) h (s) ds = (g ∗ h) (t) Filtering An important example of convolution is in filtering. Filtering is a large subject area, and only a few concepts are shown here. A filter h (t) is used to decompose a signal g (t) into two components as follows gfiltered = h ∗ g gresidual = g − gfiltered filtered component residual component One example is where the filtered component is some kind of smoothed average and the residual component is noise. The area of many filters is 1. The reason is that if a constant function g (t) = g0 is filtered, it is often desireable that the filtered component also be equal to the same constant, g0 . The unit area condition can be seen in the following: (h ∗ g0 ) (t) = Z ∞ −∞ h (s) g0 ds = g0 Z ∞ −∞ h (s) ds = g0 only if Z ∞ h (s) ds = 1 −∞ Some examples of filters are given in the following. Dirac delta function. This is the trivial filter, as shown below. (δ ∗ g) (t) = Z ∞ −∞ δ (s) g (t − s) ds = g (t) Here, the filtered function is identical to the original function. Box filter. The filter has a rectangular shape, given by the same function µ ¶ t 1 rect t0 t0 used to illustrate the Dirac delta function concept. If we substitute this function into the convolution we get a result that is very similar to that given earlier: µ ¶ µ ¶ Z ∞ 1 Z t0 /2 1 t 1 s rect ∗g = rect g (t − s) ds = g (t − s) ds t0 t0 t0 t0 −t0 /2 −∞ t0 t0 t0 = average of g (s) for t − < s < t + 2 2 3 This mathematical result is identical to stating that the box filter produces a running average: the filtered result gfiltered (t) is the average of the orginal function g (s) for values of s in an interval of width t0 centered at t. Gaussian filter. The filter is a bell-shaped curve that is identical to the Gaussian (or Normal) pdf: à ! µ ¶ t 1 t2 √ Gauss where Gauss (t) = exp − σ 2 2πσ The parameter σ is the standard deviation of the pdf. This filter has many desireable characteristics which the box filter does not have. 1.3 Windows A function g (t) is windowed if it is multiplied by a window function w (t) to get the windowed result gwindow (t) = g (t) w (t) There are several important examples used by experimentalists. Box window. Here the window is a rectangular function µ t rect t0 ¶ µ ( The windowed result is t gwindow (t) = g (t) rect t0 ¶ = g (t) 0 if |t| < t0 /2 otherwise In many cases, experimental data can be viewed as box-windowed data, because the actual signal g (t) is present for all values of t, but the experimentalist only collects data for a time duration t0 . Gaussian window. Here the window is the Gaussian function, scaled so that the standard deviation is σ: µ ¶ t Gauss σ While the Gaussian window is smoother than the box window, it distorts the signal by reducing the amplitudes at large positive and negative times. Cosine taper window. This window is widely used in Fourier analysis, and is a compromise between the box and Gaussian filters wcos µ t t0 ¶ ⎧ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ =⎪ ⎪ ⎪ ⎪ ⎪ ⎩ 1 ∙ ½ µ ¶¾¸ t 1 1 1 − cos 10π − 2 t0 2 0 ¯ ¯ ¯ ¯ ¯ t ¯¯ 2 if < t0 ¯ ¯ 5¯ 2 ¯t¯ 1 if < ¯¯ ¯¯ < 5 t0 2 otherwise It is flat for |t/t0 | < 2/5 and reduce to zero as |t/t0 | approaches 1/2. Hence, it does not distort the signal for 80% of the total duration t0 and it gradually approaches 0 amplitudes at the endpoints at t = ±t0 /2. Below, the box, Gaussian and cosine taper windows are shown 4 1.2 1 0.8 0.6 0.4 0.2 -0.6 -0.4 0 -0.2 0.2 t 0.4 0.6 -0.2 Plots of the box, Gaussian and cosine taper windows. Sampling window. When experimental data g (t) is stored in a computer, it is not stored at an infinite number of values of |t| < t0 /2 but it is sampled at a finite number of discrete points at some constant time interval ∆t. To mathematically represent this, we can use a sampling window wsample (t; ∆t) = ∞ X k=−∞ δ (t − k∆t) Dirac comb It is noted that the Dirac comb is periodic with period ∆t. The windowed function is gsample (t) = ∞ X k=−∞ g (k∆t) δ (t − k∆t) which will also be periodic with period ∆t. In the computer we only store the coefficients g (k∆t). Also, as explained earlier, experimental data is windowed by the box function, so this means that there will only be a finite number of coefficients, where |k∆t| < t0 /2. 1.4 Covariance In statistics, the notion of covariance is of fundamental importance. It is useful to express the covariance in terms of the convolution and the argument sign reversal. To simplify the notation, we assume that the mean values have been subtracted from the functions g (t) and h (t) and that they are already windowed by the box function so that they are zero for |t| > T /2. There are some approximations needed in the convolution result, but the accuracy of these approximations improve as the time interval T increases. cgh (τ ) = g (t − τ ) h (t) covariance is the average of g and h with a time lag τ 1 Z T /2 g (t − τ ) h (t) dt approximation for finite time interval T ≈ T −T /2 1Z∞ ≈ g̃ (τ − t) h (t) dt argument sign reversal and box windowing T −∞ 1 = (g̃ ∗ h) (t) averaged convolution of g̃ and h T The autocovariance is the coviance of a function g with itself, and the above becomes cgg (τ ) ≈ 1 (g̃ ∗ g) (t) autocovariance of g T 5 In many practical problems, it is possible to collect data functions gi (t) and hi (t) where the index i corresponds to separate experiments or different time periods for the same experiment. For the latter case, we may have i = 1 for the time period from 0 to T , i = 2 for the time period T to 2T and so on. We shift the time parameter so that t = 0 correponds to the beginning of each time period. To compute the covariance, we use the average over i: cgh (τ ) = m m 1 X 1 X gi (t − τ ) hi (t) ≈ (g̃i ∗ hi ) (t) average over i m i=1 mT i=1 with a similar result for the autocovariance cgg . 6 2 Fourier transforms 2.1 Definitions We examine the Fourier transform of g, which is given by a function G (ω) of frequency ω and satisfies the following: R ∞ G (f ) =R −∞ g (t) exp (−2πif t) dt Fourier transform (FT) of g (t) ∞ inverse Fourier transform (IFT) of G (f ) g (t) = −∞ G (f ) exp (2πif t) df It is customary to use lower- and upper-case letters to designate the original function and the FT, as shown above. The two functions, g (t) and G (f ) is called a Fourier transform pair. If we examine functions g (t) in time, then we are looking in the time domain, and if we look at the corresponding FT, G (f ), then we are looking in the frequency domain or spectral domain. Sometimes it is useful to look at circular frequency ω = 2πf . If t is space, then g (t) is in the spatial domain and G (f ) is in the wave number domain, where ω is the wave number. (The usual notation is x for the spatial variable and k for the wave number, but herein we will simply use t, f and occasionally ω.) The units of t and f are reciprocals. So if the unit of t is seconds, the unit of f is Hertz and the unit of ω is radians/second. If the unit of t is mm, the unit of f is mm−1 . The two integrals are very similar; the only real difference is the sign of the exponent. In fact, we have the following convenient relation, known as the duality relation for Fourier transforms: If G (f ) is the FT of g (t) , then g (−f ) is the FT of G (t) If g is an even function, then this simplifies to: If G (f ) is the FT of g (t) , and if g is even, then g (f ) is the FT of G (t) We next consider some important examples. 2.2 Examples Dirac delta function. The simplest examples involve the Dirac delta function. The Fourier transform of δ (t) is unity: D (f ) = Z ∞ δ (t) exp (−2πif t) dt = exp (−2πif 0) = 1 −∞ From duality, we have the following: 1 is the FT of δ (t) , so δ (f ) is the FT of 1 Rectangular function, rect (t). By substitution, we have R (f ) = Z 1/2 exp (−2πif t) dt = −1/2 sin πf = sinc f πf We also have the dual relation sinc f is the FT of rect t, so rect f is the FT of sinc t The sinc function appears frequently in Fourier analysis, and is shown in the figure below. The hyperbolas given by the denominator of the sinc function, ±1/πf , envelope the sinc function as shown by the dashed lines in the same figure. 7 1 0.8 0.6 0.4 0.2 -15 -10 -5 5 -0.2 f 10 15 -0.4 -0.6 -0.8 -1 Plot of the sinc f function with the enveloping hyperbolas ±1/πf . Each negative and positive peak is called a lobe. The main lobe, centered at f = 0, has width 2 while all of the remaining side lobes have width 1. While this function appears to be very irregular, it has certain useful properties. For instance, we have: R∞ −∞ sinc f df = 1 sinc 0 = 1 sinc k =Ã0 ! 1 f sinc −→ δ (f ) f0 f0 unit integral peak of the main lobe at 0 for all integers k 6= 0 as f0 −→ 0 Sign function. In this case the FT is 1/iπf , which goes to infinity at zero. The sign function is odd, and it is explained later that the FT of an odd function is always pure imaginary. Gaussian function. Again, by substitution, we can determine that the FT of the Gaussian function Gauss (t) is √ 2π Gauss (2πf ) Since the two functions have the same form, the dual relation gives no new information. 2.3 Properties There are many useful relations in Fourier transforms which can be verified by substitution. If G (f ) and H (f ) are the Fourier transform of g (t) and h (t) then function ag + bh g̃ g (t − t0 ) exp (2πif t) g (t) µ ¶ 0 t g t0 G (t) dn g dtn gh g∗h Fourier transform aG + bH G∗ exp (−2πif t0 ) G (f ) G (f − f0 ) comment linearity argument sign reversal time shift frequency shift g (−f ) duality |t0 | G (t0 f ) n time/frequency scaling (2πif ) G time derivative G∗H GH time window, frequency convolution time convolution, frequency window where G∗ is the complex conjugate of G. Many of these relations have clear visual effects. For instance, in the time/frequency scaling relation, as t0 becomes small, the time function 8 becomes compressed in time, while the frequency function becomes expanded in frequency and reduced in amplitude. It can be seen that the scale t0 in the frequency domain is the reciprocal of the scaling 1/t0 in the time domain; hence we have a reciprocal time/frequency scaling relation. Also, when the time function is differentiated, the frequency function is amplified at large frequencies. There are also some useful properties: function Fourier transform comment ∗ g is real G (−f ) = G (f ) real in time g is real, even G is pure real, even even in both time and frequency g is real, odd G is pure imaginary, odd odd in both time and frequency geven Re G even part of a real function g Im G odd part of a real function g godd Most data is real, and the first row of the above shows that the FT of such data at negative frequencies −f is just the complex conjugate of the FT at positive frequencies f . Hence, it is only necessary to examine the FT at positive frequencies. The other rows show that the even and odd parts of the data correspond to the real and imaginary parts of the FT. An important integration relation is known as Parseval’s Theorem: Z ∞ g (t) h∗ (t) dt = −∞ Z ∞ −∞ |g (t)|2 dt = Z ∞ −∞ Z ∞ −∞ G (f ) H ∗ (f ) df Parseval’s Theorem |G (f )|2 df The second relation is a special case of the first, obtained by setting h = g and using the relation (G∗ ) (G) = |G|2 . Here are some Fourier transforms of some important functions, some of which were already discussed earlier function µ ¶ t rect t0 sgn (t) µ ¶ t sinc tµ0 ¶ t Gauss à σ! |t| exp − t0 1 δ (t) exp (2πif0 t) Fourier transform comments |t0 | sinc (f t0 ) 1 iπf |t0 | rect (f t0 ) √ 2πσ Gauss (2πσf ) rectangle 2t0 1 + (2πf t0 )2 δ (f ) 1 δ (f − f0 ) à ! 1 P∞ k P∞ δ f− k=−∞ δ (t − kt0 ) t0 k=−∞ t0 sign sinc Gaussian exponential decay, t0 > 0 constant Dirac complex exponential Dirac comb The reciprocal time/frequency scaling relations are most clear in the Gaussian and Dirac comb functions. For the Gaussian function, the standard deviations in the time and frequency domains are σ (in time) and 1/2πσ (in frequency), so that as the standard deviation decreases 9 in time, it increases in a reciprocal fashion in frequency. Similarly, for the Dirac comb, the intervals between the periodic Dirac delta functions in the time and frequency domains are t0 (in time) and 1/t0 (in frequency). As for the rectangle and sinc functions, the reciprocal time/frequency scaling effects are important particularly in data analysis. If the width of the rectangle in the time domain is t0 , then the width of the main lobe of the sinc function in the frequency domain is 2/t0 . Similarly, if the width of the main lobe of the sinc function in the time domain is 2t0 , then the width of the rectangle in the frequency domain is 1/t0 . The FT of the sign function gives an idea of how quickly the FT amplitude decreases with respect to the frequency when the function has a step discontinuity: the amplitude is proportional to 1/ |f | for large |f |. In general, we can make the following observation: If dn g (t) is the lowest discontinuous derivative, dtn then |G (f )| is approximately proportional to 1 for large |f | |f |n+1 For instance, the exponential decay function in the preceding table is continuous, but the first derivative is not. Therefore, setting n = 1 we see that the FT should decrease at a rate proportional to 1/f 2 . This is true because, for large |f |, the FT is approximately 2t0 / (2πf t0 )2 = 1/2πt0 f 2 . 2.4 Convolutions Convolutions occur in many forms in Fourier transform analysis. Here we give some information about the most important convolutions. Filtering. We recall that filtering is a type of convolution. The effect of filtering in the frequency domain is, according to the above properties, simple multiplication. We consider the two basic examples. For the box filter, the parameter is t0 , the duration of the running average. The filtered function in the time domain, gfiltered , was given earlier as a convolution of g and hbox , and the result in the frequency domain is the product Gfiltered (f ) = G (f ) sinc (f t0 ) box filter The effect here is to attenuate (reduce in magnitude) the frequency function G (f ) as the frequency f increases. The frequency function values G (f ) at high frequencies are sometimes called the high frequency components of g. It is noted that attenuation is more rapid when t0 is large. This makes physical sense because large t0 is equivalent to a longer duration average. For the Gaussian filter, the parameter is the standard deviation σ, which has a similar effect as the duration parameter t0 of the box filter. The result is Gfiltered (f ) = G (f ) Gauss (2πσf ) Gaussian filter which shows that the Gaussian filter has a bell-shaped filter in the frequency domain. As the standard deviation σ increases, then it can be seen that the bell shaped becomes more narrow with a more rapid attenuation rate. Statistical covariance. As noted earlier, this is another type of convolution. As in section 1.4, we assume that the mean values have been subtracted from the functions g (t) and h (t) and that they are already windowed by the box function so that they are zero for |t| > T /2. 10 Using the preceding relations, we can find the covariance between functions g and h in the frequency domain. The FT of the autocovariance is called the power spectral density function (psd) and the FT of the covariance is the cross power spectral density function (cross psd): 1 g̃ ∗ h covariance (time domain) T 1 1 G̃H = G∗ H cross psd (frequency domain) ≈ T T cgh ≈ Cgh For the autocovariance, where g = h, we have Cgg ≈ 1 |G|2 T psd (frequency domain) If we use the average over i in the time domain, as explained earlier, then we also have an average over i in the frequency domain Cgh m m 1 X 1 X ∗ ≈ Gi Hi and Cgg ≈ |Gi |2 mT i=1 mT i=1 The term power spectral density comes from a physical interpretation of the above using Parseval’s Theorem. If we simply integrate the psd we have Z ∞ 1Z∞ 1Z∞ 2 Cgg (f ) df = |G (f )| df = |g (t)|2 dt = mean square of g T −∞ T −∞ −∞ where we recall that g (t) is windowed by the box function so that it is zero for |t| > T /2. For many practical applications, the mean square of the data is related to the power, and the above shows that the power is given by the integral of Cgg (f ). Hence, Cgg (f ) is a density in the frequency (spectral) domain. High values of Cgg (f ) for a certain range of frequencies f indicate that significant portions of the power (or mean square) of the data are due to contributions from this frequency range. Covariance of filtered data. We can combine the preceding results by first filtering the data and then finding the covariance of the filtered results. For large time intervals t0 we have Cg(filtered),h(filtered) ≈ G∗filtered Hfiltered ( Cgh sinc2 (f³tfilter ) ´ √ = Cgh Gauss 2 2πσf box filter with duration tfilter Gaussian filter with parameter σ This shows that a filter in the time domain (which is a time convolution) results in a squared window effect in the frequency domain. For the box and Gaussian filters, the effect is to attenuate the high frequency components of the cross psd. Dirac comb. As shown above, the FT of a Dirac comb is another Dirac comb. We can proceed with sampling in both the time and frequency domains. For the sampled function gsample in the time domain, the Dirac comb is a window applied to the original function g. Therefore, the FT of the sampled function is the convolution of a Dirac comb to the FT of g. Specifically, for a time function sampled at time intervals ∆t we have: 11 gst (t) = ∞ X k=−∞ g (k∆t) δ (t − k∆t) à ∞ 1 X k Gst (f ) = G (f ) ∗ δ f − ∆t k=−∞ ∆t ! à ∞ 1 X k = G f− ∆t k=−∞ ∆t ! where the subscript st designates sampling in the time domain. The last expression is obtained by recalling the convolution result for shifted Dirac delta functions. It can be seen that Gst is obtained by taking the original function G, scaling it by 1/∆t, shifting it by multiples of 1/∆t and adding the shifted functions. It is clearly periodic with period 1/∆t. In the same manner, if the frequency function G (f ) is sampled at frequency intervals 1/T , then the corresponding time-domain result is periodic with period T : à ∞ X k Gsf (f ) = G T k=−∞ gsf (t) = T ∞ X k=−∞ ! à k δ f− T ! g (t − kT ) where the subscript sf designates sampling in the frequency domain. In practical applications, we do not plot the spikes of the above Dirac delta function, but only plot the coefficients. 2.5 Fourier transform of data The mathematical properties of Fourier transforms must be re-examined in the analysis of experimental or computational data. First, data is not collected for all time (or space) in the infinite domain −∞ < t < ∞. Instead, the finite data set is typically collected at equally spaced intervals t = ∆t, 2∆t, . . . , n∆t. Second, the Fourier transform is also typically collected at equally spaced frequencies. It the following, it is explained how these practical limitations will alter the Fourier transform relations and lead to the Fourier series and discrete Fourier transform results. We do this one step at a time. Finite time data. We assume that the actual data g (t) exists for all time t, but we can only collect data over a finite time duration T . We can always shift the time axis so that the data is collected over the time interval centered at the origin, |t| < T /2. The data we collect, therefore, is simply the data windowed by the box window wbox (t; T ) with duration T . The Fourier transform pair at this stage is gwt Gwt µ ¶ t = g rect windowed data over duration T T = T G ∗ sinc (f T ) where we use the subscript wt as an abbreviation of windowing in the time domain. Sampled frequency function. Next we sample in the frequency domain at intervals 1/T 0 where it is not necessary for T to be equal to T 0 . As explained earlier, sampling is performed by multiplication with the Dirac comb: Gwt,sf (f ) = ∞ X Gwt k=−∞ 12 à ! à k k δ f− 0 0 T T ! where the subscript wt,sf is used to denote windowing in the time domain and the subsequent sampling in the frequency domain. The corresponding function in the time domain is periodic with period T 0 : gwt,sf = T ∞ X 0 k=−∞ 0 gwt (t − kT 0 ) In general, the period T is larger than the original duration of the data T , and this will be assumed henceforth. The reason why T 0 > T is important is that the windowed function gwt will not overlap with itself in the above infinite sum. Hence, for |t| < T 0 /2 the time domain function is given only by a single term of the preceding infinite sum T0 2 ⎧ T ⎪ ⎪ ⎨ T 0 g (t) for |t| < 2 = ⎪ T0 T ⎪ ⎩ 0 for < |t| < 2 2 0 It can be seen that, beside the multiplicative constant T , the function gwt,sf is identical to the original function g for time inside the original time window |t| < T /2 and is zero outside of this window and within the larger window |t| < T 0 /2. The zero function values outside of the original window is called zero padding. If we choose T 0 = T , then it can be shown that the effect of the sinc function from using a finite time window disappears in the frequency domain. The reason is that sinc (f T ) is zero when the argument f T is a non-zero integer. With frequency sampling at 1/T we have f = k/T and sinc (f T ) = sinc (k) = 0 for all k 6= 0. This is easier to visualize graphically. Sampled time data. If the data is sampled at intervals ∆t in the time domain using the Dirac comb, then the time function becomes gwt,sf (t) = gwt,sf,st (t) = T 0 gwt (t) for |t| < ∞ X k=−∞ gwt,sf (k∆t) δ (t − k∆t) For the interval |t| < T 0 /2 we use the preceding result for gwt,sf to simplify this to a finite sum ⎧ T P ⎪ ⎪ ⎨ T0 N for |t| < k=−N g (k∆t) δ (t − k∆t) 2 gwt,sf,st (t) = ⎪ T0 T ⎪ ⎩ 0 for < |t| < 2 2 where N∆t = T /2. The FT is periodic with period 1/∆t and is denoted as Gwt,sf,st à ∞ 1 X k = Gwt,sf f − ∆t k=−∞ ∆t ! periodic, period 1 ∆t This means that it is not necessary to perform windowing in the frequency domain: If we know Gwt,sf,st for the frequency range −1/2∆t < f < 1/2∆t then we know Gwt,sf,st for all frequencies. It is noted that in the above infinite sum, the function Gwt,sf (f ) is shifted by multiples of 1/∆t and added together. In this process, it is possible that the original function overlaps with itself. This is called aliasing. The three preceding steps of analysis can and should be visualized by graphical means. The Fourier transform process is more transparent using actual plots of functions in the time and frequency domains. 13 3 3.1 Fourier series Expansions A reasonably well-behaved function g (t) defined over the interval |t| < T /2 can be represented by an infinite series, known as the Fourier series (FS) expansion: ∞ X g (t) = k=−∞ 1 Z T /2 ck = G (fk ) = ck exp (iωk t) where ωk = T −T /2 Z T /2 −T /2 ∞ X g (t) exp (−iω k t) dt g (t) exp (−2πifk t) dt = T ck where fk = à k Gsf (f ) = G T k=−∞ gsf (t) = Z 2πk is the kth frequency and T ! à k δ f− T ! , gsf = T ∞ X k=−∞ Gsf (f ) exp (2πif t) df = ∞ X k ωk = T 2π g (t − kT ) G (k∆f ) exp (iω k t) where ∆f = k=−∞ 1 T It is sometimes more convenient to express g using a real-valued function by using Euler’s formula exp (iω k t) = sin ωk t + i cos ω k t: ∞ a0 X + (ak cos ω k t + bk sin ω k t) where 2 k=1 1 Z T /2 = g (t) cos ω k tdt T −T /2 1 Z T /2 = g (t) sin ωk tdt T −T /2 g (t) = ak bk The Fourier coefficients of g are ak , bk and ck and they are related by ak = ck + c−k and bk = i (ck − c−k ) ak − ibk ak + ibk ck = and c−k = 2 2 If the function g (t) is real, then ak and bk are real, and ck = c∗−k where the superscript ∗ is the complex conjugate. 3.2 Orthogonality A key reason why the above expansion is possible is orthogonality: Z T /2 Z T /2 −T /2 −T /2 Z T /2 −T /2 sin ω k t cos ω j tdt = 0 for all k, j sin ωk t sin ω j tdt = Z T /2 −T /2 cos ωk t cos ω j tdt = 0 for all k 6= j exp (iωk t) exp (iω j t) dt = 0 for all k 6= j 14 3.3 Fourier series and Fourier transform If we examine the formula for Gwt (f ) using the definition of the FT, it is given by Gwt (f ) = Z ∞ −∞ gwt (t) exp (−2πif t) dt = Z T /2 g (t) exp (−2πif t) dt −T /2 Evaluating it at the frequency samples fk = k/T we find that the results are proportional to the Fourier coefficients: Gwt (fk ) = T ck This immediately implies that, for any given function g, the Fourier series coefficients ck are simply the Fourier transform of the box-windowed function gwt (non-zero only in |t| < T /2) evaluated at frequency increment ∆f = 1/T . The periodic function gwt,sf (t) is given by the inverse FT of Gwt,sf (f ). By substituting into the formula for the inverse FT and using the integration property of the shifted Dirac delta functions we have gwt,sf (t) = Z ∞ −∞ Gwt,sf (f ) exp (2πif t) df = ∞ X k=−∞ Gwt (fk ) exp (2πifk t) = T ∞ X k=−∞ Finally we note that for |t| < T /2 we have g (t) = gwt (t) = ∞ X gwt,sf (t) T = ck exp (2πifk t) for |t| < T 2 k=−∞ This is the original Fourier series expansion. 15 ck exp (2πifk t) 3.4 Discrete Fourier transform The DFT and inverse DFT relate the data sampled at discrete times, gj = g (j∆t), with the DFT coefficients αk : DFT coefficient = αk = N−1 X j=0 1 data = gj = N à 2πijk gj exp − N ! for k = − à N/2 X 2πijk αk exp N k=−N/2+1 ! N N N + 1, − + 2, . . . , 2 2 2 for j = 0, . . . , N − 1 where we assume that N is even1 . It is noted that α−k = α∗k where the asterisk denotes the complex conjugate. Approximate comparison with the Fourier series If we compare the expression for the DFT coefficient and the expressions for the Fourier series we can see some similarities in the expressions. The most intuitive way to make the comparison is to assume the following: 1. The periodic time function g with period T is smoothly varying with respect to the time increment ∆t = T /N. 2. The corresponding Fourier series coefficients are significantly non-zero only when |k| < N/2. Under the first condition, the Fourier series coefficients can be approximated by using a Riemann sum in place of the integral: à −1 X 1ZT 1 NX 1 N−1 2πijk = g (t) exp (−iωk t) dt ≈ g (j∆t) exp (−iω k j∆t) ∆t = g (j∆t) exp − T 0 T j=0 N j=0 N αk = N ck Under the second condition, the Fourier series relations gives ∞ X N/2 X à 2πk T j ck exp (iω k j∆t) ≈ ck exp i gj = g (j∆t) = T N k=−∞ k=−N/2+1 ! 1 = N N/2 X à 2πijk αk exp N k=−N/2+1 which is the DFT result. 1 It is noted that the standard numerical procedure for computing the above is the Fast Fourier Transform (FFT). It is not necessary to know how the FFT works because this is just an algorithm that has already been programmed by others. For instance, in MATLAB, you type in fft(y) to find the DFT coefficients αk using the FFT algorithm. What is important is that you understand the properties of the DFT, which is a mathematical concept. 16 ! ! Exact comparison with the Fourier series We begin with the windowed time domain function g and correponding FT G where we drop the wt subscript. Then, we sample in the frequency domain to get à ∞ 1 X k0 Gwt,sf,st (f ) = Gwt,sf f − ∆t k0 =−∞ ∆t à ! ! à ∞ ∞ X 1 X Nk 0 + k k = Gwt δ f− ∆t k0 =−∞ k=−∞ N∆t N ∆t à à ∞ ∞ X k 1 X = Gwt ∆t k0 =−∞ k=−∞ T ! à ! ! à k k0 − δ f− ∆t T where we use T = N∆t ∞ N−1 ∞ X X Nk0 + Nk00 + k 1 X Nk00 + k Gwt δ f− = ∆t k0 =−∞ k00 =−∞ k=0 N∆t N∆t à ! à N−1 ∞ X 1 X k Nk00 + k = Gwt δ f− ∆t k00 =−∞ k=0 N∆t N∆t = Z ∞ ∞ X −∞ k=−∞ ! for 0 < f < gwt,sf (k∆t) δ (t − k∆t) exp (−2πif t) dt = 17 ! ∞ X k=−∞ ! 1 ∆t gwt,sf (k∆t) exp (−2πif k∆t)