Appendix a Transforms and Sampling
Total Page:16
File Type:pdf, Size:1020Kb
Appendix A Transforms and Sampling A.1 Introduction Along the book, the pertinent theory elements have been invoked when directly linked with the topic being studied. It seems also convenient to have an appendix with a summary of the essential theory, which could be consulted as reference at any moment. It is clear that the main focus should be put on the Fourier transform, and on sampling. Other transforms are also of interest. Indeed, this appendix could become quite long if all formal mathematics was considered, together with extensions, applications, etc. There are books, which will cited in this appendix, that treat in detail these aspects. Our aim here is more to summarize main points, and to provide reference materials. Tables of common transform pairs are provided by [29]. A.2 The Fourier Transform The origins of the Fourier transform can be dated at 1807. It was included in the Fourier’s book on heat propagation. We would recommend to see [28] in order to grasp the history of harmonic analysis, up to recent times. A recent book on the Fourier transform principles and applications is [11]. Besides it, there are many other books that include detailed expositions of the Fourier trans- form. © Springer Science+Business Media Singapore 2017 533 J.M. Giron-Sierra, Digital Signal Processing with Matlab Examples, Volume 1, Signals and Communication Technology, DOI 10.1007/978-981-10-2534-1 534 Appendix A: Transforms and Sampling A.2.1 Definitions A.2.1.1 Fourier Series Fourier series have the form: ∞ ∞ y(t) = a0 + an cos (n · w0 t) + bn sin(n · w0 t) (A.1) n=1 n=1 This series may not converge. It is possible to be sure of convergence by com- plying with the Dirichlet conditions. These conditions are sufficient conditions for a periodic, real-valued function f (t) to be equal to its Fourier series at each point where f () is continuous. The conditions are: • f (x) be absolutely integrable (L1) over a period • f (x) must have a finite number of extrema in any given bounded interval • f (x) must have a finite number of finite discontinuities in any given bounded interval • f (x) must be bounded A brief lecture note from [35] or [18] would give you more details of the Fourier series convergence issues. Supposing that f (t) can be represented with a Fourier series, and that f (t) = f (t + 2π), the coefficients of the corresponding expression can be computed as follows: 1 π a0 = f (t) dt (A.2) π −π 1 π an = f (t) cos(nt) dt (A.3) π −π 1 π bn = f (t) sin(nt) dt (A.4) π −π It is convenient to remark that there are square integrable functions (L2) that are not integrable (L1), [16]. Given a periodic signal f (t),if: • f (−t) = f (t), then it is an even signal • f (−t) =−f (t), then it is an odd signal The product of two signals z(t) = x(t) · y(t) has the following result: Appendix A: Transforms and Sampling 535 x(t) y(t) z(t) even even even even odd odd odd even odd odd odd even In the case of an even signal f (t): π π f (t) dt = 2 · f (t) dt (A.5) −π 0 and in the case of an odd signal f (t): π f (t) dt = 0(A.6) −π Suppose f (t) is even, then: 1 π 2 π an = f (t) cos(nt) dt = f (t) cos(nt) dt (A.7) π −π π 0 since both f (t) and cos( ) are even functions. On the other hand: 1 π bn = f (t) sin(nt) dt = 0(A.8) π −π since sin( ) is an odd function and the product with f (t) will render also an odd function. In the case of an odd signal f (t), there is a reverse situation: the an coefficients are zero, while bn coefficients can be non-zero. There are other equivalent expressions for the Fourier series, using only sines or only cosines (in both cases the harmonic terms have amplitude and phase), or using complex exponentials. A.2.1.2 Fourier Integral Given an aperiodic function f (t), it can be supposed to be periodic with period = infinity. As the period tends to infinity, the summations of the Fourier series tend to integrals. The Fourier transform of a function f (t) is the following: ∞ F(ω) = f (t) e− jω t dt (A.9) −∞ 536 Appendix A: Transforms and Sampling The inverse Fourier transform is: ∞ 1 f (t) = F(ω) e jω t dω (A.10) 2 π −∞ Dirichlet conditions also apply in this context. Part of the literature prefers to use Hz instead of radians/s for the frequency. In this case, the transforms are: ∞ F(ν) = f (t) e− j2πνt dt (A.11) −∞ and, ∞ f (t) = F(ν) e j2πνt dω (A.12) −∞ where we used ν for the frequency in Hz. There are the following relationships: f (t) F(ν) real F(−ν) =|F(ν)|∗ imaginary F(−ν) =−|F(ν)|∗ even F(−ν) = F(ν) odd F(−ν) =−F(ν) In addition: f (t) F(ν) real and even F(ν) real and even real and odd F(ν) imaginary and odd imaginary and even F(ν) imaginary and even imaginary and odd F(ν) real and odd Two functions are orthogonal if and only if their Fourier transforms are orthogonal. A.2.1.3 Discrete Fourier Transform (DFT) The Discrete Fourier Transform (DFT) of a discrete signal f (n) with finite duration of N samples, is given by: Appendix A: Transforms and Sampling 537 N−1 F(ω) = f (n) e− jω n (A.13) n = 0 Usually, one considers a discretized frequency, so the DFT becomes: N−1 N−1 − jωk n − j2π nk/N F(ωk ) = Fk = f (n) e = f (n) e ; k = 0, 1,...,N − 1 n = 0 n = 0 (A.14) The DFT can be expressed in matrix form: ⎛ ⎞ ⎛ ⎞ ⎛ ⎞ 0 0 0 .. 0 F0 WN WN WN WN f (0) ⎜ ⎟ ⎜ 0 1 2 ... N−1 ⎟ ⎜ ⎟ ⎜ F1 ⎟ ⎜ WN WN WN WN ⎟ ⎜ f (1) ⎟ ⎜ ⎟ ⎜ 0 2 4 2 (N−1) ⎟ ⎜ ⎟ ⎜ F2 ⎟ ⎜ W W W ... W ⎟ ⎜ f (2) ⎟ ⎜ ⎟ = ⎜ N N N N ⎟ ⎜ ⎟ ⎜ . ⎟ ⎜ . ..... ⎟ ⎜ . ⎟ ⎝ . ⎠ ⎝ .... ⎠ ⎝ . ⎠ − ( − ) ( − )( − ) F − 0 N 1 N 1 2 ... N 1 N 1 f (N − 1) N 1 WN WN WN WN (A.15) where: − j 2π WN = e N (A.16) Then, in compact form, the DFT is: Y¯ = W y¯ (A.17) The matrix W is symmetric, that is, WT = W. Also, the matrix W has the first row and the first column all ones. The matrix W can be pre-computed and stored or put into firmware. The inverse DFT can be written as: 1 y¯ = W∗ Y¯ (A.18) N where W* is the complex conjugate of W, obtained by conjugating every element of W. No matrix inversion is required. A.2.2 Examples Let us obtain some interesting results concerning a selection of signals frequently found in practical applications. 538 Appendix A: Transforms and Sampling A.2.2.1 Square Wave Consider the square wave depicted in Fig. A.1. It is an odd signal with period 2π. The sine coefficients of its Fourier series can be computed as follows: 2 π 2 − cos nt π 2 2 0 2 0 2 bn = f (t) sin(nt) dt = = , , , , ,... π 0 π n 0 π 1 2 3 4 5 (A.19) A.2.2.2 Single Pulse Let us study the single pulse depicted in Fig. A.2. Suppose that T = 1. The Fourier transform of this signal is: / 1/2 e− j ω t 1 2 e jω/2 − e− jω/2 sin(ω/2) e− jω t dt = = = = sinc(ω) − / −1/2 j ω −1/2 jω ω 2 (A.20) A.2.2.3 Single Triangle Consider now the single triangle depicted in Fig. A.3. The signal is: Fig. A.1 Square wave Fig. A.2 Single pulse Appendix A: Transforms and Sampling 539 Fig. A.3 Single triangle 1 −|t|, |t| < 1 f (t) = (A.21) 0 , |t|≥1 The Fourier transform of this signal is: ∞ f (t) e− jω t dt = 2 · 1 (1 − t) cos(ω t) dt = 2 sin(ω) − 2 1 td(sin(ω t)) −∞ 0 ω ω 0 = 2 sin(ω) − (t sin(ω))|1 − 1 sin(ω t) dt = 2 cos(ω t)|1 = ω 0 0 ω2 0 = 2 ( − ( )) = 2 2 2( / ) = 2( ) ω2 1 cos ω ω sin ω 2 sinc ω (A.22) Since the triangle can be built as the convolution of two rectangular signals, the result above can be also obtained as follows: F{triangle(t)}=F{rect(t) ∗ rect(t)}= sinc(ω) · sin c(ω) = sinc2(ω) (A.23) This approach is convenient for the treatment of splines, which can be obtained by convolutions of rectangles. A.2.3 Properties Both the direct and the inverse Fourier transforms are linear operators, so the trans- form of a sum of functions is equal to the sum of transforms of these functions. Next table shows a first set of properties, playing with time and frequency. A second table show results related to differentiation, convolution, and conjugation. Property Signal Fourier transform − jω t time shifting f (t − to) e o F(ω) jω t frequency shifting e o f (t) F(ω − ωo) scaling f (t/α) |α|·F(αω) − jω t time shift and scaling f ((t − to)/α) |α|·e o F(αω) jω t frequency shift and scaling |α| e o f (α t) F((ω − ωo)/α) time reversal f (−t) F(−ω) 540 Appendix A: Transforms and Sampling Operation Signal Fourier transform d ( ) · ( ) t-Differentiation dt f t j ω F ω · ( ) d ( ) ω-Differentiation t f t dω F ω t-Convolution x(t) ∗ y(t) X (ω) Y (ω) ω-Convolution x(t) y(t) X (ω) ∗ Y (ω) Conjugation f (t) F(−ω) A.2.4 Theorems The following theorem was proposed, in a primitive version, by Parseval in 1799 for periodic functions.