![Lecture 7 - the Discrete Fourier Transform](https://data.docslib.org/img/3a60ab92a6e30910dab9bd827208bcff-1.webp)
Lecture 7 - The Discrete Fourier Transform 7.1 The DFT The Discrete Fourier Transform (DFT) is the equivalent of the continuous Fourier Transform for signals known only at instants separated by sample times ¡ (i.e. a finite sequence of data). Let ¢¤£¦¥¨§ be the continuous signal which is the source of the data. Let samples be denoted ¢ © ¢¤© ¢¤© ¢¤© ¢ © . The Fourier Transform of the original signal, ¢¤£¦¥¨§ , would be (*) +/102,3 £"!$#%§'& ¢¤£,¥¨§.- ¥ ) + ¢¤©45 We could regard each sample ¢¤© as an impulse having area . Then, since the integrand exists only at the sample points: (98;: +=<>;? +/A02B3 £6!$#%§7& ¢¤£¦¥¨§¨- ¥ @ 8;: +/¨EGF +/10H?IF F +/10J¨?IF +/A0 +=<>;? & ¢¤©C D- ¢¤© D- ¢¤© D- ¢¤£ H§¨- : +=< L +/10J¨? ¢¤© D- ie. £"!$#%§K& JNMOE We could in principle evaluate this for any # , but with only data points to start with, only final outputs will be significant. You may remember that the continuous Fourier transform could be evaluated QP @ over a finite interval (usually the fundamental period ¡ ) rather than from to 82 P F if the waveform was periodic. Similarly, since there are only a finite number § of input data points, the DFT treats the data as if it were periodic (i.e. ¢¤£ to S H§ ¢¤£ R§ ¢¤£ H§ ¢¤£ is the same as to .) Hence the sequence shown below in Fig. 7.1(a) is considered to be one period of the periodic sequence in plot (b). (a) 1 0.8 0.6 0.4 0.2 0 0 1 2 3 4 5 6 7 8 9 10 11 (b) 1 0.8 0.6 0.4 0.2 0 0 5 10 15 20 25 30 Figure 7.1: (a) Sequence of &TU samples. (b) implicit periodicity in DFT. Since the operation treats the data as if it were periodic, we evaluate the < : DFT equation for the fundamental frequency (one cycle per sequence, ? Hz, VXW : ? rad/sec.) and its harmonics (not forgetting the d.c. component (or average) at #Y&Z ). \ \ \ H\ ^ £ U§ i.e. set #Y&Z [ ¡ ¡S] ¡]`_ ¡S] or, in general : +=< L S +/$bdc J egf © & ¢¤© D- £ &Z ih H§ _ _ JaMOE 83 ¢¤© © is the Discrete Fourier Transform of the sequence . _ We may write this equation in matrix form as: m j n k jk n mn mn jk k k n n n k k V : ©C ¢¤©C +=< k n n n k k p p prq Tp k n n n k k V V : © ¢¤© + kl n n n kl k p pts pru Tp n kl : © ¢¤© + & pvq p prw Tp q . u . o . o . o S . V : : : ¢¤© © +=< + + q p p p p V : &Zxy[z{£ !\}| § p &Zp &~ where p and etc. DFT – example Let the continuous signal be @ F F ¢¤£¦¥¨§K& ¤ $U£H\¥ § O\¥ dc 1Hz 2Hz 10 8 6 4 2 0 −2 −4 0 1 2 3 4 5 6 7 8 9 10 Figure 7.2: Example signal for DFT. q ¢ ¥&r ¥& Let us sample ¢¤£¦¥¨§ at 4 times per second (ie. = 4Hz) from to . The values of the discrete samples are given by: s W @ F F J V $5£ § $\{ ¥¤&r¡& ¢¤© &t by putting s 84 ¢¤© & ¢¤© &t ¢¤© &Z £ &ZR§ i.e. ¢ © &t , , , , L L q q +/c J J f f b ¢¤© d- & ¢¤© A£ !§ & Therefore © _ E JNMOE jk mn jk mn jk mn jk mn l l l l k n k n k n k n ©C ¢¤©C $ © ! ! ¢¤© !R & & o o o o © ¢¤© H © ! ! ¢¤© !R The magnitude of the DFT coefficients is shown below in Fig. 7.3. 20 15 10 |F[n]| 5 0 0 1 2 3 f (Hz) Figure 7.3: DFT of four point sequence. Inverse Discrete Fourier Transform The inverse transform of : +=< L J +/bdc egf © & ¢¤© d- _ JaMOE 85 is : +=< L J / bdc ef ¢ ©4 & © D-U _ MOE f < i.e. the inverse matrix is : times the complex conjugate of the original (symmet- ric) matrix. ¢ ©4 Note that the © coefficients are complex. We can assume that the values are real (this is the_ simplest case; there are situations (e.g. radar) in which two o inputs, at each , are treated as a complex pair, since they are the outputs from o and demodulators). © In the process of taking the inverse transform the terms © and (re- : _ _ V member that the spectrum is symmetrical about ) combine to produce fre- quency components, only one of which is considered to be valid (the one at the VXW : V lower of the two frequencies, ? Hz where ; the higher frequency : _*] _ component is at an “aliasing frequency” ( V )). _¡ ¢ © © From the inverse transform formula, the contribution to ¢¤© of and _ is: _ 8;: / / + >"J¥ J¤F bdc bdc f egf e ¢ © & © D- © D- £ f (7.2) _ _ : +=< L S 8: +/bdc + >¦J f e © & ¢¤© D- For all ¢¤© real _ JaMOE VXW 8: +/bdc + >¦J +/ J /$bdc¨§ J /$bdc J e f e egf - & - - &Z- But 1 for all S ª© © £ § i.e. & (i.e. the complex conjugate) _ _ 86 ¢ © Substituting into the Equation for f above gives, VXW © bdc bdc +/ J¤F JH¥ / J / egf egf £ §.- ¢ ©4 & - &T © d- £ f since _ _ ­¦® \ \ ¥ ¥ ¥ ¢ © & © ¨¯6° © £ £«¬£ ie. f _ _ _ _ \ F²$³¨´ ¥ ¢ © & §¨¡ £ © d§ © £ T± ± £ or f _ _ _ ¡ VXW V f © ± ± : : i.e. a sampled sinewave at ? Hz, of magnitude _ &µ For the special case of , © &S¶·¢ ©4 (i.e. sum of all samples) and the < _ E ©C ¢ ©4 ¢ © ¤& © & ¢¤© ¤& contribution of to is : average of d.c. compo- nent. Interpretation of example V < E ©C &r$ ©C & &r 1. implies a d.c. value of : (as expected) s ª© !R¸& © 2. © {& implies a fundamental component of peak amplitude V V ¹ ²³¨´ o ©¦ & ª&r © & ± ± : with phase given by ] s Y \ \ o o ¡ §¤&tK U£ § i.e. ¤ £ (as expected) ¡ S : V £ & 3. © &ºH – no other component here) and this implies a _ component _ V W / J / J bdc e¼» V © D- & ©4H d- & \{ ¢ © & (as expected) since ¨¯D°\{i&t for all 87 6 5 4 3 3/sqrt(2) |F[n]| 2 sqrt(2) 1 0 0 1 2 3 f (Hz) Figure 7.4: DFT of four point signal. Thus, the conventional way of displaying a spectrum is not as shown in Fig. 7.3 but as shown in Fig. 7.4 (obviously, the information content is the same): &½U R In typical applications, is much greater than ; for example, for , © U R ^ ^$ has U components, but are the complex conjugates of , V V <¦À <A<¦À EÀ _   V V V V V ¾¿ ¾¿ à ¾¿ <BE <BE leaving <BE as the d.c. component, to as complete a.c. com- V s s{Á Á sGÁ Á < À <  V V ¾¿ à ponents and <BE as the cosine-only component at the highest distinguishable s : V & § frequency £ . _ À À b f f ¾¿ ¾¿ : Most computer programmes evaluate : (or for the power spectral den- Á Á Á sity) which gives the correct “shape” Á for the spectrum, except for the values at : V &Z and . _ 7.2 Discrete Fourier Transform Errors To what degree does the DFT approximate the Fourier transform of the function underlying the data? Clearly the DFT is only an approximation since it provides only for a finite set of frequencies. But how correct are these discrete values themselves? There are two main types of DFT errors: aliasing and “leakage”: 88 7.2.1 Aliasing This is another manifestation of the phenomenon which we have now encountered several times. If the initial samples are not sufficiently closely spaced to represent high-frequency components present in the underlying function, then the DFT val- ues will be corrupted by aliasing. As before, the solution is either to increase the sampling rate (if possible) or to pre-filter the signal in order to minimise its high- frequency spectral content. 7.2.2 Leakage Recall that the continuous Fourier transform of a periodic waveform requires the P P integration to be performed over the interval - to F or over an integer number of cycles of the waveform. If we attempt to complete the DFT over a non-integer number of cycles of the input signal, then we might expect the transform to be corrupted in some way. This is indeed the case, as will now be shown. Consider the case of an input signal which is a sinusoid with a fractional num- : V & ber of cycles in the data samples. The DFT for this case (for &Ä to ) _ is shown below in 7.5. _ 8 6 4 |F[n]| 2 0 0 2 4 6 8 freq Figure 7.5: Leakage. We might have expected the DFT to give an output at just the quantised frequen- 89 cies either side of the true frequency. This certainly does happen but we also find non-zero outputs at all other frequencies. This smearing effect, which is known as leakage, arises because we are effectively calculating the Fourier series for the waveform in Fig. 7.6, which has major discontinuities, hence other frequency components. 1 0.5 0 −0.5 −1 0 5 10 15 20 25 30 35 40 45 50 Figure 7.6: Leakage. The repeating waveform has discontinuities. Most sequences of real data are much more complicated than the sinusoidal se- quences that we have so far considered and so it will not be possible to avoid in- troducing discontinuities when using a finite number of points from the sequence in order to calculate the DFT. The solution is to use one of the window functions which we encountered in the design of FIR filters (e.g. the Hamming or Hanning windows).
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages15 Page
-
File Size-