Discrete Fourier transform Alejandro Ribeiro Dept. of Electrical and Systems Engineering University of Pennsylvania aribeiro@seas.upenn.edu http://www.seas.upenn.edu/users/~aribeiro/ January 2, 216 Signal and Information Processing Discrete Fourier transform 1
Discrete complex exponentials Discrete complex exponentials Discrete Fourier transform (DFT), definitions and examples Units of the DFT DFT inverse Properties of the DFT Signal and Information Processing Discrete Fourier transform 2
Discrete Complex exponentials Discrete complex exponential of discrete frequency k and duration e k (n) = 1 e j2πkn/ = 1 exp(j2πkn/) The complex exponential is explicitly given by e j2πkn/ = cos(2πkn/) + j sin(2πkn/) Real part is a discrete cosine and imaginary part a discrete sine 1.5.5 ( Re e j2πkn/ ), with k = 2 and = 32 1 2 4 6 8 1 12 14 16 18 2 22 24 26 28 3 1.5.5 ( Im e j2πkn/ ), with k = 2 and = 32 1 2 4 6 8 1 12 14 16 18 2 22 24 26 28 3 Signal and Information Processing Discrete Fourier transform 3
Equivalent frequencies Theorem If k l = the signals e k (n) and e l (n) coincide for all n, i.e., e k (n) = ej2πkn/ = ej2πln/ = e l (n) Exponentials with frequencies k and l are equivalent if k l = Signal and Information Processing Discrete Fourier transform 4
Orthogonality Theorem Complex exponentials with nonequivalent frequencies are orthogonal. I.e. e k, e l = when k l <. E.g., when k =,... 1, or k = /2 + 1,..., /2. Signals of canonical sets are unrelated. Different rates of change Also note that the energy is e k 2 = e k, e k = 1 Exponentials with frequencies k =, 1,..., 1 are orthonormal e k, e l = δ(l k) They are an orthonormal basis of signal space with samples Signal and Information Processing Discrete Fourier transform 5
Conjugate frequencies Theorem Opposite frequencies k and k yield conjugate signals: e k = e k (n) Proof. Just use the definitions to write the chain of equalities e k (n) = ej2π( k)n/ = e j2πkn/ = [ ] e j2πkn/ = ek(n) Opposite frequencies Same real part. Opposite imaginary part The cosine is the same, the sine changes sign Signal and Information Processing Discrete Fourier transform 6
Physical meaning Of the canonical frequencies, only /2 + 1 are distinct., 1,..., /2 1 /2 1,..., /2 + 1 1,..., /2 + 1 Frequencies and /2 have no counterpart. Others have conjugates Canonical set /2 + 1,..., 1,, 1,..., /2 easier to interpret Reasonable Can t have more than /2 oscillations in samples With sampling frequency f s and signal duration T = T s = /f s Discrete frequency k frequency f = k T = k = k T s f s Frequencies from to /2 f s /2 have physical meaning egative frequencies are conjugates of the positive frequencies Signal and Information Processing Discrete Fourier transform 7
Discrete Fourier transform Discrete complex exponentials Discrete Fourier transform (DFT), definitions and examples Units of the DFT DFT inverse Properties of the DFT Signal and Information Processing Discrete Fourier transform 8
Definition of discrete Fourier transform (DFT) Signal x of duration with elements x(n) for n =,..., 1 X is the discrete Fourier transform (DFT) of x if for all k Z X (k) := 1 x(n)e j2πkn/ = 1 x(n) exp( j2πkn/) n= We write X = F(x). All values of X depend on all values of x n= The argument k of the DFT is referred to as frequency DFT is complex even if signal is real X (k) = X R (k) + jx I (k) It is customary to focus on magnitude X (k) = [ ] 1/2 [ ] 1/2 XR(k) 2 + XI 2 (k) = X (k)x (k) Signal and Information Processing Discrete Fourier transform 9
DFT elements as inner products Discrete complex exponential (freq. k) e k (n) = 1 e j2πkn/ Can rewrite DFT as X (k) = x(n)e k (n) = x(n)ek(n) n= n= And from the definition of inner product X (k) = x, e k DFT element X (k) inner product of x(n) with e k (n) Projection of x(n) onto complex exponential of frequency k How much of the signal x is an oscillation of frequency k Signal and Information Processing Discrete Fourier transform 1
DFT of a square pulse (derivation) The unit energy square pulse is the signal M (n) that takes values M (n) = 1 M if n < M M (n) 1/ M M (n) = if M n M 1 1 t Since only the first M 1 elements of M (n) are not null, the DFT is X (k) = 1 n= M (n)e j2πkn/ = 1 M 1 n= 1 M e j2πkn/ X (k) = sum of first M components of exponential of frequency k Can reduce to simpler expression but who cares? It s just a sum Signal and Information Processing Discrete Fourier transform 11
DFT of a square pulse (illustration) Square pulse of length M = 2 and overall signal duration = 32 X (k) = 1 1 n= 1 e j2πkn/ = 1 ( 1 + e j2πk/) 2 2 E.g., X (k) = 2 2 at k =, ±,... and X (k) = at k =, ±3/2,....25.2.15.1.5 Modulus X (k) of the DFT of square pulse, duration = 32, pulse length M = 2 32 28 24 2 16 12 8 4 4 8 12 16 2 24 28 32 36 4 44 48 52 56 6 64 Frequency index k = 32, 31,..., 64 = [ 32, 64] This DFT is periodic with period true in general Signal and Information Processing Discrete Fourier transform 12
Periodicity of the DFT Consider frequencies k and k +. The DFT at k + is X (k + ) := 1 n= x(n)e j2π(k+)n/ Complex exponentials of freqs. k and k + are equivalent. Then X (k + ) := 1 n= x(n)e j2πkn/ = X (k) DFT values apart are equivalent DFT has period Suffices to look at consecutive frequencies canonical sets Computation k [, 1] Interpretation k [ /2, /2] (actually, + 1 freqs.) Related by chop and shift [ /2, 1] [/2, 1] Signal and Information Processing Discrete Fourier transform 13
Canonical set k [, 1] DFT of the square pulse highlighting frequencies k [, 1].25.2.15.1.5 Modulus X (k) of the DFT of square pulse, duration = 32, pulse length M = 2 32 28 24 2 16 12 8 4 4 8 12 16 2 24 28 32 36 4 44 48 52 56 6 64 Frequency index k = 32, 31,..., 64 = [ 32, 64] Frequencies larger than /2 have no clear physical meaning Signal and Information Processing Discrete Fourier transform 14
Canonical set k [ /2, /2] DFT of the square pulse highlighting frequencies k [ /2, /2] egative freq. k has the same interpretation as positive freq. k One redundant element X ( /2) = X (/2). Just convenient.25.2.15.1.5 Modulus X (k) of the DFT of square pulse, duration = 32, pulse length M = 2 32 28 24 2 16 12 8 4 4 8 12 16 2 24 28 32 36 4 44 48 52 56 6 64 Frequency index k = 32, 31,..., 64 = [ 32, 64] Obtain frequencies k [ /2, 1] from frequencies [/2, 1] Signal and Information Processing Discrete Fourier transform 15
Pulses of different length The DFT X gives information on how fast the signal x changes.1 DFT modulus of square pulse, duration = 256, pulse length M = 2.8.6.4.2 128 96 64 32 32 64 96 128 Frequency index k = 128, 127,..., 128 = [ 128, 128] DFT modulus of square pulse, duration = 256, pulse length M = 4.14.12.1.8.6.4.2 128 96 64 32 32 64 96 128 For length M = 2 have weight at high frequencies Length M = 4 concentrates weight at lower frequencies Pulse of length M = 2 changes more than a pulse of length M = 4 Frequency index k = 128, 127,..., 128 = [ 128, 128] Signal and Information Processing Discrete Fourier transform 16
More DFTs of pulses of different length The lengthier the pulse the less it changes DFT concentrates at zero freq. DFT modulus of square pulse, duration = 256, pulse length M = 4.14.12.1.8.6.4.2 128 96 64 32 32 64 96 128 Frequency index k = 128, 127,..., 128 = [ 128, 128].18.15.12.9.6.3 DFT modules of square pulse, duration = 256, pulse length M = 8 128 96 64 32 32 64 96 128 Frequency index k = 128, 127,..., 128 = [ 128, 128] DFT modulus of square pulse, duration = 256, pulse length M = 16.28.24.2.16.12.8.4 128 96 64 32 32 64 96 128 Frequency index k = 128, 127,..., 128 = [ 128, 128] DFT modulus of square pulse, duration = 256, pulse length M = 32.35.3.25.2.15.1.5 128 96 64 32 32 64 96 128 Frequency index k = 128, 127,..., 128 = [ 128, 128] Signal and Information Processing Discrete Fourier transform 17
DFT of a delta function The delta function is δ() = 1 and δ(n) =, else. Then, the DFT is X (k) = 1 δ(n)e j2πkn/ = 1 δ()e j2πk/ = 1 n= Delta function x(n) = δ(n) DFT of delta function X (k) = 1/ 1 1/.5 2 4 6 8 1 12 14 Time index n =, 1,..., 15 = [, 15] DFT 2 4 6 8 1 12 14 Frequency index k =, 1,..., 15 = [, 15] Only the values k [, 15] shown. DFT defined for all k but periodic Observe that the energy is conserved X 2 = δ 2 = 1 Signal and Information Processing Discrete Fourier transform 18
DFT of a shifted delta function For shifted delta δ(n n ) = 1 and δ(n n ) = otherwise. Thus X (k) = 1 δ(n n )e j2πkn/ = 1 δ(n n )e j2πkn / n= Of course δ(n n ) = δ() = 1, implying that X (k) = 1 e j2πkn / = e n (k) Complex exponential of frequency n (below, = 16 and n = 1) Shifted delta function x(n) = δ(n n ) DFT X (k) = 1 e j2πkn / = e n (k) 1.5 2 4 6 8 1 12 14 Time index n =, 1,..., 15 = [, 15] DFT 1/ -1/ 4 2 2 4 6 8 1 12 14 16 Frequency index k =, 1,..., 15 = [, 15] Signal and Information Processing Discrete Fourier transform 19
DFT of a complex exponential Complex exponential of freq. k x(n) = 1 e j2πk n/ = e k (n) Use inner product form of DFT definition X (k) = e k, e k Orthonormality of complex exponentials e k, e k = δ(k k ) Complex exponential x(n) = 1 e j2πk n/ = e k (n) DFT is shifted delta function X (k) = δ(k k ) 1/ -1/ 4 2 2 4 6 8 1 12 14 16 Time index n =, 1,..., 15 = [, 15] DFT 1.5 2 4 6 8 1 12 14 Frequency index n =, 1,..., 15 = [, 15] DFT of exponential e k(n) is shifted delta X (k) = δ(k k ) Signal and Information Processing Discrete Fourier transform 2
DFT of a constant Constant function x(n) = 1/ (it has unit energy) and k = Complex exponential with frequency k = x(n) = e Use inner product form of DFT definition X (k) = e, e k Complex exponential orthonormality e, e k = δ(k ) = δ(k) Constant function x(n) = 1/ DFT of constant is delta function X (k) = δ(k) 1/ 2 4 6 8 1 12 14 Time index n =, 1,..., 15 = [, 15] DFT 1.5 2 4 6 8 1 12 14 Frequency index k =, 1,..., 15 = [, 15] DFT of constant x(n) = 1/ is delta function X (k) = δ(k) Signal and Information Processing Discrete Fourier transform 21
Observations DFT of a signal captures its rate of change Signals that change faster have more DFT weight at high frequencies DFT conserves energy (all have unit energy in our examples) Energy of DFT X = F(x) is the same as energy of the signal x Indeed, an important property we will show Duality of signal - transform pairs (signals and DFTs come in pairs) DFT of delta is a constant. DFT of constant is a delta DFT of exponential is shifted delta. DFT of shifted delta is exponential Indeed, a fact that follows from the form of the inverse DFT Signal and Information Processing Discrete Fourier transform 22
Units of the DFT Discrete complex exponentials Discrete Fourier transform (DFT), definitions and examples Units of the DFT DFT inverse Properties of the DFT Signal and Information Processing Discrete Fourier transform 23
Units Sampling time T s, sampling frequency f s, signal duration T = T s Discrete frequency k k oscillations in time T s = Period T s /k Discrete frequency k equivalent to real frequency f k = k T s = k f s In particular, k = /2 equivalent to f /2 = /2f s = f s 2 Set of frequencies k [ /2, /2] equivalent to real frequencies... That lie between f s /2 and f s /2 Are spaced by f s / (difference between frequencies f k and f k+1 ) Interval width given by sampling frequency. Resolution given by Signal and Information Processing Discrete Fourier transform 24
Units in DFT of a discrete complex exponential Complex exponential of frequency f = k f s / Discrete frequency k and DFT X (k) = δ(k k ) But frequency k corresponds to frequency f X (f ) = δ(f f ) 1-2 -2-1 1 2 k 2 k 1 - fs 2-2fs - fs fs 2fs f = k fs fs 2 k True only when frequency f = (k /)f s is a multiple of f s / Signal and Information Processing Discrete Fourier transform 25
Units in DFT of a square pulse Square pulse of length T = 4s observed during a total of T = 32s. Sampled every T s = 125ms Sample frequency f s = 8Hz Total number of samples = T /T s = 256 Maximum frequency k = /2 = 128 f k = f /2 = f s /2 = 4Hz Fequency resolution f s / = 8Hz/256 =.3125Hz Discrete index, duration = 256, pulse length M = 32.35.3.25.2.15.1.5 128 96 64 32 32 64 96 128 Discrete frequency k [ 128, 128] Sampling frequency fs = 8Hz, duration T = 32s, length T = 4s.35.3.25.2.15.1.5-4Hz -3Hz -2Hz -1Hz 1Hz 2Hz 3Hz 4Hz Frequencies are, ±fs /, ±2fs /,..., ±fs /2 Signal and Information Processing Discrete Fourier transform 26
Units in DFT of a square pulse Interval between freqs. f s / = 8Hz/256 = 1/32 =.3125Hz 32 equally spaced frees for each 1Hz interval = 8 every.125 Hz. Sampling frequency fs = 8Hz, duration T = 32s, length T = 4s.35.3.25.2.15.1.5 -.75Hz -.625Hz -.5Hz -.375Hz -.25Hz -.125.125Hz.25Hz.375Hz.5Hz.625Hz.75Hz Frequencies, ±.3125Hz, ±.625Hz,..., ±.75Hz Zeros of DFT are at frequencies.25hz,.5 Hz,.75 Hz,... Thus, zeros are at frequencies are 1/T, 2/T, 3/T,... Most (a lot) of the DFT energy is between freqs. 1/T and 1/T Signal and Information Processing Discrete Fourier transform 27
DFT inverse Discrete complex exponentials Discrete Fourier transform (DFT), definitions and examples Units of the DFT DFT inverse Properties of the DFT Signal and Information Processing Discrete Fourier transform 28
Definition of DFT inverse Given a Fourier transform X, the inverse (i)dft x = F 1 (X ) is x(n) := 1 X (k)e j2πkn/ = 1 X (k) exp(j2πkn/) k= k= Same as DFT but for sign in the exponent (also, sum over k, not n) Any summation over consecutive frequencies works as well. E.g., x(n) = 1 /2 k= /2+1 X (k)e j2πkn/ Because for a DFT X we know that it must be X (k + ) = X (k) Signal and Information Processing Discrete Fourier transform 29
idft is, indeed, the inverse of the DFT Theorem The inverse DFT of the DFT of x is the signal x F 1 [F(x)] = x Every signal x can be written as a sum of complex exponentials x(n) = 1 X (k)e j2πkn/ = 1 /2 k= k= /2+1 X (k)e j2πkn/ Coefficient multiplying e j2πkn/ is X (k) = kth element of DFT of x X (k) := 1 n= x(n)e j2πkn/ Signal and Information Processing Discrete Fourier transform 3
Proof of DFT inverse formula Proof. Let X = F(x) be the DFT of x. Let x = F 1 (X ) be the idft of X. We want to show that x x From the definition of the idft of X x(ñ) = 1 X (k)e j2πkñ/ k= From the definition of the DFT of x X (k) := 1 n= x(n)e j2πkn/ Substituting expression for X (k) into expression for x(ñ) yields x(ñ) = 1 [ 1 ] x(n)e j2πkn/ e j2πkñ/ k= n= Signal and Information Processing Discrete Fourier transform 31
Proof of DFT inverse formula Proof. Exchange summation order to sum first over k and then over n x(ñ) = n= [ x(n) k= Pulled x(n) out because it doesn t depend on k ] 1 e j2πkñ/ 1 e j2πkn/ Innermost sum is the inner product between eñ and e n. Orthonormality: k= 1 e j2πkñ/ 1 e j2πkn/ = δ(ñ n) Reducing to x(ñ) = x(n)δ(ñ n) = x(ñ) n= Last equation is true because only term n = ñ is not null in the sum Signal and Information Processing Discrete Fourier transform 32
Inverse DFT as inner product Discrete complex exponential (freq. n) e n (k) = 1 e j2πkn/ Rewrite idft as x(n) = X (k)e n (k) = X (k)e n(k) k= k= And from the definition of inner product x(n) = X, e n idft element X (k) inner product of X (k) with e n (k) Different from DFT, this is not the most useful interpretation Signal and Information Processing Discrete Fourier transform 33
Inverse DFT as successive approximations Signal as sum of exponentials x(n) = 1 /2 k= /2+1 X (k)e j2πkn/ Expand the sum inside out from k = to k = ±1, to k = ±2,... x(n) = X () e j2πn/ constant + X (1) e j2π1n/ + X ( 1) e j2π1n/ single oscillation + X (2) e j2π2n/ + X ( 2) e j2π2n/ double oscillation..... ( ) + X 2 1 e j2π( 2 1)n/ + X ( 2 )e + 1 j2π( ( ) 2 2 1)n/ 1 oscillation ( ) + X e j2π( 2 )n/ 2 2 oscillation Start with slow variations and progress on to add faster variations Signal and Information Processing Discrete Fourier transform 34
Reconstruction of square pulse Consider square pulse of duration = 256 and length M = 128 Reconstruct with frequency k = only (DC component).1.9.8.7.6.5.4.3.2.1 Pulse reconstruction with k= frequencies ( = 256, M = 128) -.1 32 64 96 128 16 192 224 Discrete time index n [, 255] Bound to be not very good Just the average signal value Signal and Information Processing Discrete Fourier transform 35
Reconstruction of square pulse Consider square pulse of duration = 256 and length M = 128 Reconstruct with frequencies k =, k = ±1, and k = ±2.1.9.8.7.6.5.4.3.2.1 Pulse reconstruction with k=2 frequencies ( = 256, M = 128) -.1 32 64 96 128 16 192 224 Discrete time index n [, 255] ot too bad, sort of looks like a pulse only 3 frequencies Signal and Information Processing Discrete Fourier transform 36
Reconstruction of square pulse Consider square pulse of duration = 256 and length M = 128 Reconstruct with frequencies up to k = 4.1.9.8.7.6.5.4.3.2.1 Pulse reconstruction with k=4 frequencies ( = 256, M = 128) -.1 32 64 96 128 16 192 224 Discrete time index n [, 255] Starts to look like a good approximation Signal and Information Processing Discrete Fourier transform 37
Reconstruction of square pulse Consider square pulse of duration = 256 and length M = 128 Reconstruct with frequencies up to k = 8.1.9.8.7.6.5.4.3.2.1 Pulse reconstruction with k=8 frequencies ( = 256, M = 128) -.1 32 64 96 128 16 192 224 Discrete time index n [, 255] Good approximation of the = 256 values with 9 DFT coefficients Signal and Information Processing Discrete Fourier transform 38
Reconstruction of square pulse Consider square pulse of duration = 256 and length M = 128 Reconstruct with frequencies up to k = 16.1.9.8.7.6.5.4.3.2.1 Pulse reconstruction with k=16 frequencies ( = 256, M = 128) -.1 32 64 96 128 16 192 224 Discrete time index n [, 255] Compression Store k + 1 = 17 DFT values instead of = 128 samples Signal and Information Processing Discrete Fourier transform 39
Reconstruction of square pulse Consider square pulse of duration = 256 and length M = 128 Reconstruct with frequencies up to k = 32.1.9.8.7.6.5.4.3.2.1 Pulse reconstruction with k=32 frequencies ( = 256, M = 128) -.1 32 64 96 128 16 192 224 Discrete time index n [, 255] Can tradeoff less compression for better signal accuracy Signal and Information Processing Discrete Fourier transform 4
Spectrum (re)shaping (1) Start with a signal x with elements x(n). Compute DFT X as X (k) := 1 n= x(n)e j2πkn/ (2) (Re)shape spectrum Transform DFT X into DFT Y (3) With DFT Y available, recover signal y with inverse DFT y(n) := 1 Y (k)e j2πkn/ k= x F X SS Y F 1 y Signal and Information Processing Discrete Fourier transform 41
Spectrum reshaping to remove noise An application of spectrum reshaping is to clean a noisy signal Signal with some underlying trend (good) and some noise (bad) 2. Original signal x(n). It moves randomly, but not that much 1.5 1..5 -.5-1. 16 32 48 64 8 96 112 Discrete time index n [, 128] Which is which? ot clear Let s look at the spectrum (DFT) Signal and Information Processing Discrete Fourier transform 42
Spectrum reshaping to remove noise An application of spectrum reshaping is to clean a noisy signal ow the trend (spikes) is clearly separated from the noise (the floor) 4.5 4. 3.5 3. 2.5 2. 1.5 1..5 DFT X (k) of original signal 64 56 48 4 32 24 16 8 8 16 24 32 4 48 56 64 Frequency index k [ 64, 64] How do we remove the noise? Reshape the spectrum Signal and Information Processing Discrete Fourier transform 43
Spectrum reshaping to remove noise An application of spectrum reshaping is to clean a noisy signal Remove freqs. larger than 8 Y (k) = for k > 8, Y (k) = X (k) else 4.5 4. 3.5 3. 2.5 2. 1.5 1..5 DFT Y (k) of signal with reshaped spectrum 64 56 48 4 32 24 16 8 8 16 24 32 4 48 56 64 Frequency index k [ 64, 64] How do we recover the trend? Inverse DFT Signal and Information Processing Discrete Fourier transform 44
Spectrum reshaping to remove noise An application of spectrum reshaping is to clean a noisy signal Inverse DFT of reshaped specturm Y (k) yields cleaned signal y(n) 2. Signal y(n) reconstructed from cleaned spectrum 1.5 1..5 -.5-1. 16 32 48 64 8 96 112 Discrete time index n [, 128] The trend now is clearly visible. oise has been removed Signal and Information Processing Discrete Fourier transform 45
Properties of the DFT Discrete complex exponentials Discrete Fourier transform (DFT), definitions and examples Units of the DFT DFT inverse Properties of the DFT Signal and Information Processing Discrete Fourier transform 46
Three important properties of DFTs DFTs of real signals (no imaginary part) are conjugate symmetric X ( k) = X (k) Signals of unit energy have transforms of unit energy More generically, the DFT preserves energy (Parseval s theorem) x(n) 2 = x 2 = X 2 = X (k) 2 n= k= The DFT operator is a linear operator F(ax + by) = af(x) + bf(y) Signal and Information Processing Discrete Fourier transform 47
Symmetry Theorem The DFT X = F(x) of a real signal x is conjugate symmetric X ( k) = X (k) Can recover all DFT components from those with freqs. k [, /2] What about components with freqs. k [ /2, 1]? Conjugates of those with freqs k [, /2] Other elements are equivalent to one in [ /2, /2] (periodicity) Signal and Information Processing Discrete Fourier transform 48
Proof of symmetry property Proof. Write the DFT X ( k) using its definition X ( k) = 1 n= x(n)e j2π( k)n/ When the signal is real, its conjugate is itself x(n) = x (n) Conjugating a complex exponential changing the exponent s sign Can then rewrite X ( k) = 1 x (n) (e j2πkn/) Sum and multiplication can change order with conjugation n= [ 1 ] X ( k) = x(n)e j2πkn/ = X (k) n= Signal and Information Processing Discrete Fourier transform 49
Energy conservation Theorem (Parseval) Let X = F(x) be the DFT of signal x. The energies of x and X are the same, i.e., x(n) 2 = x 2 = X 2 = X (k) 2 n= In energy of DFT, any set of consecutive freqs. would do. E.g., k= X 2 = X (k) 2 = k= /2 k= /2+1 X (k) 2 Signal and Information Processing Discrete Fourier transform 5
Proof of Parseval s Theorem Proof. From the definition of the energy of X X 2 = X (k)x (k) k= From the definition of the DFT of x X (k) := 1 n= x(n)e j2πkn/ Substitute expression for X (k) into one for X 2 (observe conjugation) [ X 2 1 ][ = x(n)e j2πkn/ 1 ] x (ñ)e +j2πkñ/ k= n= ñ= Signal and Information Processing Discrete Fourier transform 51
Proof of Parseval s Theorem Proof. Distribute product and exchange order of summations sum over k first X 2 = n= ñ= [ x(n)x (ñ) k= ] 1 e j2πkn/ 1 e +j2πkñ/ Pulled x(n) and x (ñ) out because they don t depend on k Innermost sum is the inner product between eñ and e n. Orthonormality: k= 1 e j2πkn/ 1 e +j2πkñ/ = eñ, e n = δ(ñ n) Thus X 2 = x(n)x (ñ)δ(ñ n) = x(n)x (n) = x 2 n= ñ= n= True because only terms n = ñ are not null in the sum Signal and Information Processing Discrete Fourier transform 52
Linearity Theorem The DFT of a linear combination of signals is the linear combination of the respective DFTs of the individual signals, F(ax + by) = af(x) + bf(y). In particular... Adding signals (z = x + y) Adding DFTs (Z = X + Y ) Scaling signals(y = ax) Scaling DFTs (Y = ax ) Signal and Information Processing Discrete Fourier transform 53
Proof of Linearity Proof. Let Z := F(ax + by). From the definition of the DFT we have Z(k) = 1 [ ] ax(n) + by(n) e j2πkn/ n= Expand the product, reorder terms, identify the DFTs of x and y Z(k) = a x(n)e j2πkn/ + b n= n= y(n)e j2πkn/ First sum is DFT X = F(x). Second sum is DFT Y = F(y) Z(k) = ax (k) + by (k) Signal and Information Processing Discrete Fourier transform 54
DFT of a discrete cosine DFT of discrete cosine of freq. k x(n) = 1 cos(2πk n/) Can write cosine as a sum of discrete complex exponentials x(n) = 1 [ 2 e j2πkn/ + e j2πkn/] = 1 [ ] e k(n) + e k(n) 2 From linearity of DFTs X = F(x) = 1 2 [ ] F(e k) + F(e k) DFT of complex exponential e k is delta function δ(k k ). Then X (k) = 1 2 [ ] δ(k k ) + δ(k + k ) A pair of deltas at positive and negative frequency k Signal and Information Processing Discrete Fourier transform 55
DFT of a discrete sine DFT of discrete sine of freq. k x(n) = 1 sin(2πk n/) Can write sine as a difference of discrete complex exponentials x(n) = 1 [ 2j e j2πkn/ e j2πkn/] = j 2 From linearity of DFTs X = F(x) = j 2 [ ] e k(n) e k(n) [ ] F(e k) F(e k) DFT of complex exponential e k is delta function δ(k k ). Then X (k) = j 2 [ ] δ(k + k ) δ(k k ) Pair of opposite complex deltas at positive and negative frequency k Signal and Information Processing Discrete Fourier transform 56
DFT of discrete cosine and discrete sine Cosine has real part only (top). Sine has imaginary part only (bottom) 1/2 1/2 /2 k k k /2 /2 k k k /2 1/2 k /2 k k k /2 /2 k /2 k -1/2 Cosine is symmetric around k =. Sine is antisymmetric around k =. Signal and Information Processing Discrete Fourier transform 57
DFT of discrete cosine and discrete sine (more) Real and imaginary parts are different but the moduli are the same 1/2 1/2 1/2 1/2 /2 k k k /2 /2 k k k /2 Cosine and sine are essentially the same signal (shifted versions) The moduli of their DFTs are identical Phase difference captured by phase of complex number X (±k ) Signal and Information Processing Discrete Fourier transform 58