Digital Signal Processing Fourier Analysis of Continuous-Time Signals with the Discrete Fourier Transform D. Richard Brown III D. Richard Brown III 1 / 11
Fourier Analysis of CT Signals with the DFT Scenario: Ideally, would like to compute the DTFT of the sequence x[n] since we have a direct relationship between X(e jω ) and X c (jω), i.e., X(e jω ) = 1 T r= ( ω X c (j T 2πr )) T In practice, we can usually only compute the DFT (via the FFT). Since the DFT operates on a finite number of samples, we usually must apply a window function w[n] to the sequence x[n] prior to computing the DFT. D. Richard Brown III 2 / 11
Common Window Functions (window length M + 1) Main lobe width ML is defined as the distance between the first nulls in the DTFT of the window W (e jω ). Relative side lobe amplitude A SL is the ratio (in db) of the amplitude of the main lobe to the amplitude of the largest side lobe. The sign of this parameter is inconsistent. D. Richard Brown III 3 / 11
Effect of Window Function Recall that multiplication in the time domain leads to convolution in the frequency domain, i.e., V (e jω ) = 1 2π π π X(e jγ )W (e j(ω γ) ) dγ One effect of the window is that it blurs any sharp features in the original DTFT X(e jω ). D. Richard Brown III 4 / 11
Computing the DFT: Relating k and Ω Recall that the DFT is computed on the windowed sequence v[n] of length M + 1. The length- DFT (usually = M + 1) is then V [k] = M n= for k =,..., 1 with W = e j2π/. Since v[n]w kn V [k] = V (e jω ) ω=2πk/ and ω = ΩT we can relate the frequency index k to the original continuous time frequency as where Ω s = 2π T Ω = 2πk T = Ω sk is the radian sampling frequency. D. Richard Brown III 5 / 11
Using fftshift When computing the DFT in Matlab, we use the fft command. This returns V [k] for k =,..., 1 which corresponds to frequencies Ω =, Ωs, 2Ωs ( 1)Ωs,...,. Sometimes we prefer to visualize the frequency response over Ωs to Ωs We can use 2 2 the Matlab command fftshift to swap the left and right halves of X[k] so that ( ( 1) Ω 2 s Example: Ω = 2 Ωs, + 1) Ω 2 s,..., = 16; % signal length T = 1/8; % sampling period n = :-1; % discrete time indices Omega_s = 2*pi/T; % radian sampling frequency v = sin(2*pi*n*t); % make finite-length signal subplot(2,1,1); stem(n*omega_s/,abs(fft(v))); xlabel( \Omega ); ylabel( magnitude response ); subplot(2,1,2); stem((n-8)*omega_s/,abs(fftshift(fft(v)))); xlabel( \Omega ); ylabel( magnitude response ); D. Richard Brown III 6 / 11
fftshift Example 1 magnitude response 8 6 4 2 5 1 15 2 25 3 35 4 45 5 Ω 1 magnitude response 8 6 4 2 3 2 1 1 2 3 Ω D. Richard Brown III 7 / 11
Choosing the Window and DFT Length : Example Suppose we have a continuous-time signal s c (t) = sin(2π97t) + sin(2π99t) and we want the two frequencies present in this signal to line up exactly at separate DFT frequency indices k 1 and k 2 without aliasing. Assume a rectangular window. Since Ω = Ωsk and Ω s = 2π T, we can write 97 T = k 1 99 T = k 2 where, k 1, and k 2 are all integers. Some possible solutions: T = 1 2 and = 2 so that k 1 = 97 and k 2 = 99 T = 1 2 and = 4 so that k 1 = 194 and k 2 = 198 T = 1 4 and = 4 so that k 1 = 97 and k 2 = 99 D. Richard Brown III 8 / 11
Example Continued X[k] 2 15 1 T=1/2, = 2 5 5 1 15 2 25 3 35 4 frequency index k X[k] 2 15 1 T=1/2, = 4 5 5 1 15 2 25 3 35 4 frequency index k X[k] 2 15 1 T=1/4, = 4 5 5 1 15 2 25 3 35 4 frequency index k D. Richard Brown III 9 / 11
Frequencies Corresponding to on-integer DFT Indices 11 1 T=1/4, = 2 9 8 7 X[k] 6 5 4 3 2 1 2 4 6 8 1 12 14 16 18 2 frequency index k D. Richard Brown III 1 / 11
Remarks DSP: Fourier Analysis of CT Signals with the DFT In the first three examples, the signal v[n] contained an integer number of periods of s c (t). In the last example, the signal v[n] contained a non-integer number of periods of s c (t). Recall the relationship between the DFT and the DFS: V [k] = Ṽ [k] k =,..., 1 Since ṽ[n] Ṽ [k] is the periodic extension of the finite-length signal v[n] V [k], we get undesirable discontinuities in ṽ[n] if v[n] contains a non-integer number of periods of s c (t). v[n] ṽ[n] D. Richard Brown III 11 / 11