CHAPTER 7. The Discrete Fourier Transform 36 hfa figconfg( P7a, long ); subplot() stem(k,abs(ck), filled );hold on stem(k,abs(ck_approx), filled, color, red ); xlabel( k, fontsize,lfs) title( Magnitude Response, fontsize,tfs) legend( c_k, \tilde{c}_k, location, best ) subplot() stem(k,angle(ck), filled );hold on stem(k,angle(ck_approx), filled, color, red ); xlabel( k, fontsize,lfs) title( Phase Response, fontsize,tfs) legend( c_k, \tilde{c}_k, location, best ) 3. (a) Solution: The DTFT of (.9) n u[n] is: The DTFT of x[n] is: (b) See plot below. (c) See plot below. (d) See plot below. MATLAB script:.9e jω X ( e jω) ( j) d dω (.9e jω (.9e jω ).9e jω % P73: umerical DFT approximation of DTFT close all; clc w linspace(,,)*pi; X.9*exp(-j*w)./(-.9*exp(-j*w)).^; ; % Part (b) % 5; % Part (c) % ; % Part (d) n :-; )
CHAPTER 7. The Discrete Fourier Transform 37 Magnitude Response Phase Response 8 6 X(e jω ) X (e jω ) X(e jω ) X (e jω ).5.5.5.5 FIGURE 7.6: Magnitude and phase responses of X ( e jω) and X ( e jω ) when. Magnitude Response Phase Response 8 6 X(e jω ) X (e jω ) X(e jω ) X (e jω ).5.5.5.5 FIGURE 7.7: Magnitude and phase responses of X ( e jω) and X ( e jω ) when 5. xn n.*.9.^n; X fft(xn); wk /*(:-); %% Plot: hfa figconfg( P73a, long ); subplot() plot(w/pi,abs(x));hold on stem(wk,abs(x), filled, color, red ); xlabel( \omega/\pi, fontsize,lfs) title( Magnitude Response, fontsize,tfs) legend( X(e^{j\omega}), X_(e^{j\omega}), location, best ) subplot() plot(w/pi,angle(x));hold on
CHAPTER 7. The Discrete Fourier Transform 38 Magnitude Response Phase Response 8 6 X(e jω ) X (e jω ) X(e jω ) X (e jω ).5.5.5.5 FIGURE 7.8: Magnitude and phase responses of X ( e jω) and X ( e jω ) when. stem(wk,angle(x), filled, color, red ); xlabel( \omega/\pi, fontsize,lfs) title( Phase Response, fontsize,tfs) legend( X(e^{j\omega}), X_(e^{j\omega}), location, best ). (a) Solution: The DFT matrix is: W W W...... W W ( )( ) Thekth column of W is w k [W k...w k] T. Thei,jth element of W is: ( ) W i,j ( W T W ) i,j wt i w j {, i+j, i+j Hence, we proved that W.... J........
CHAPTER 7. The Discrete Fourier Transform 8. (a) See plot below. (b) See plot below. (c) See plot below. MATLAB script: % P78: Regenerate Figure~7.5 and Example 7.3 close all; clc 6; a.9; % Part (a) % 8; a.8; % Part (b) % 6; a.8; % Part (c) wk *pi/*(:-); Xk./(-a*exp(-j*wk)); xn real(ifft(xk)); w linspace(,,)*pi; X fft(xn,length(w)); X_ref./(-a*exp(-j*w)); n :-; xn_ref a.^n; %% Plot: hfa figconfg( P78a, small ); plot(w/pi,abs(x_ref), color, black ); hold on plot(w/pi,abs(x)) stem(wk/pi,abs(xk), filled ); ylim([ max(abs(x))]) xlabel( \omega/\pi, fontsize,lfs) ylabel( Magnitude, fontsize,lfs) title( Magnitude of Spectra, fontsize,tfs) hfb figconfg( P78b, small ); plot(n,xn,. ); hold on plot(n,xn_ref,., color, black ) ylim([.*max(xn)]) xlim([ -]) xlabel( Time index (n), fontsize,lfs) ylabel( Amplitude, fontsize,lfs) title( Signal Amplitudes, fontsize,tfs) legend( x[n], \tilde{x}[n], location, northeast )
CHAPTER 7. The Discrete Fourier Transform 3 Magnitude of Spectra 8 Magnitude 6.5.5 (a) Signal Amplitudes Amplitude..8.6. x[n] \tilde{x}[n]. 5 5 Time index (n) (b) FIGURE 7.9: (a) Magnitude response of the DTFT signal. (b) Time sequence and reconstructed time sequence.
CHAPTER 7. The Discrete Fourier Transform 5 Magnitude of Spectra Magnitude 3.5.5 (a) Signal Amplitudes Amplitude..8.6. x[n] \tilde{x}[n]. 3 5 6 7 Time index (n) (b) FIGURE 7.: (a) Magnitude response of the DTFT signal and (b) time sequence and reconstructed time sequence for a.8 and 8.
CHAPTER 7. The Discrete Fourier Transform 5 5 Magnitude of Spectra Magnitude 3.5.5 (a) Signal Amplitudes Amplitude.8.6. x[n] \tilde{x}[n]. 3 5 6 Time index (n) (b) FIGURE 7.: (a) Magnitude response of the DTFT signal and (b) time sequence and reconstructed time sequence for a.8 and 6.
CHAPTER 7. The Discrete Fourier Transform 9 3. (a) Proof: If k is even and is even, the correspondent DFT is: X[k] / / x[n]e jπ nk / x[n]e jπ nk + n/ (x[n]e jπ nk +x[n+ ]e jπ (n+ )k ) (x[n] x[n])e jπ nk (b) Proof: If m,k l, the correspondent DFT is: x[n]e jπ nk X[l] + x[n]e jπ n(l) x[n]e jπ n(l) + 3 x[n]e jπ n(l) x[n]e jπ n(l) + x[n]e jπ n(l) n n n 3 x[n]e jπ n(l) + x[n+ ]e jπ (n+ )(l) 3 + x[n]e jπ n(l) + n 3 n (x[n]+x[n+ ) ] e jπ n(l) + x[n+ ]e jπ (n+ )(l) 3 n. (a) Solution: Solving the circular convolution using hand calculation: 3 6 5 7 (x[n]+x[n+ ] ) e jπ n(l)
CHAPTER 7. The Discrete Fourier Transform 5 (b) See script below. (c) See script below. MATLAB script: % P7: Circular convolution close all; clc xn :5; xn [ - -]; %% Part (b): xn circonv(xn,[xn ] ); %% Part (c): max(length(xn),length(xn)); Xk fft(xn,); Xk fft(xn,); Xk Xk.*Xk; xn_dft ifft(xk); 5. (a) Proof: X [K] can be obtained by frequency sampling of X 3 [k], hence in the time domain, according the aliasing equation, we have x [n] l x 3 [n+l] (b) Proof: When L, there is no time aliasing, we conclude x [n] x 3 [n], for n L When max(, ) < L, since L +, we conclude that x [n] x 3 [n]+x 3 [n+], for n Hence, we proved the equation (??). (c) MATLAB script: % P75: Verify formula in Problem 75 close all; clc xn :; xn :-:;
CHAPTER 7. The Discrete Fourier Transform 55 Linearity. w c (t) (a x c (t)+a x c (t)) a w c (t)x c (t)+a w c (t)x c (t) a x c (t)+a x c (t) Time-varying. In general, w c (t τ)x c (t τ) w c (t)x c (t). Proof: Hence, x c (t τ) x c (t). (b) Proof: If t T, and n L, we have x[n] w[n]x[n] (7.6) x c (nt) w c (nt)x c (nt) x c (nt) x[n] x[n] w[n]x[n] x[n] If t > T, and > L, we have The CTFT of ˆx c (t) is: ˆX c (jω) x c (nt) x[n] ˆX c (jω) X c (jθ)w c (j(ω θ))dθ (7.7) π π π ˆx c (t)e jωt dt ( w c (t)e jωt π ( X c (jθ) w c (t)x c (t)e jωt dt ) X c (jθ)e jθt dθ dt w c (t)e )dθ j(ω θ)t X c (jθ)w c (j(ω θ))dθ. Proof: The CTFT of x c (at) is: Scaling Property: x c (at)e jωt dt a x c (at) CTFT a X c ( ) jω a x c (at)e jω a at dat (7.7)
CHAPTER 7. The Discrete Fourier Transform 56 If a >, we have a If a <, we have a x c (at)e jω a at dat a x c (at)e jω a at dat a Hence, we proved the scaling property. 3. Proof: x c (t)x c (t)dt Suppose a is a real number, define function p(a) as where A p(a) x c (t)e jω a t dt a X c x c (t)e jω a t dt a X c ( ) jω a ( ) jω a x c (t) dt x c (t) dt (7.79) (a x c (t)+x c (t)) dt Aa +Ba+C x c(t)dt, B x c (t)x c (t)dt, C Since we have B AC, that isb AC, ( x c (t)x c (t)dt) x c(t)dt x c(t)dt. Proof: The CTFT of generic window is: x c(t)dt. W(jΩ) aw R (jω)+bw R (j(ω π)/t )+bw R (j(ω+π)/t ) (7.89) The ICTFT is: π [aw R (jω)+bw R (j(ω π)/t )+bw R (j(ω+π)/t )]e jωt dω aw R (t)+be jπ t T wr (t)+be jπ )] [ a+bcos ( π T t w R (t) T t wr (t)
CHAPTER 7. The Discrete Fourier Transform 66 6 Magnitude Response Phase Response 5 X(e jω ) X (e jω ) 3 X(e jω ) X (e jω ).5.5.5.5 FIGURE 7.: Magnitude and phase responses of X ( e jω) and X ( e jω ) when. 3. tba title( Magnitude Response, fontsize,tfs) legend( X(e^{j\omega}), X_(e^{j\omega}), location, best ) subplot() plot(w/pi,angle(x));hold on stem(wk,angle(x), filled, color, red ); xlabel( \omega/\pi, fontsize,lfs) title( Phase Response, fontsize,tfs) legend( X(e^{j\omega}), X_(e^{j\omega}), location, best ) 3. (a) See plot below. (b) See plot below. (c) See plot below. (d) See plot below. MATLAB script: % P73: Compute and plot DFT and IDFT close all; clc %% Part (a): 8; n :-; xn zeros(size(n)); xn() ; %% Part (b):
CHAPTER 7. The Discrete Fourier Transform 67 Magnitude Response 3 Phase Response.8.6.. 3 5 6 7 k (a) 3 3 5 6 7 k Time Sequence.8.6.. 6 6 8 Time index (n) (b) FIGURE 7.: -point (a) DFT and (b) IDFT of x[n] δ[n], 8 in the range ( ) n ( ). % ; % n :-; % xn n; %% Part (c): % 3; % n :-; % xn cos(6*pi*n/5); %% Part (d): % 3; % n :-; % xn cos(.*pi*n); Xk fft(xn);
CHAPTER 7. The Discrete Fourier Transform 68 5 Magnitude Response 3 Phase Response 3 6 8 k (a) 3 6 8 k Time Sequence 8 6 5 5 5 Time index (n) (b) FIGURE 7.3: -point (a) DFT and (b) IDFT of x[n] n, in the range ( ) n ( ). ind abs(xk) < e-; Xk(ind) ; xn_ref ifft(xk); nn -(-):*-; xn_plot xn_ref(mod(nn,)+); %% Plot: hfa figconfg( P73a, long ); subplot() stem(n,abs(xk), filled ); xlim([ -]) xlabel( k, fontsize,lfs) title( Magnitude Response, fontsize,tfs) subplot() stem(n,angle(xk), filled );
CHAPTER 7. The Discrete Fourier Transform 69 5 Magnitude Response 3 Phase Response 5 5 5 5 k (a) 3 5 5 5 k Time Sequence.5.5 3 5 Time index (n) (b) FIGURE 7.: -point (a) DFT and (b) IDFT of x[n] cos(6πn/5), 3 in the range ( ) n ( ). xlim([ -]) ylim([-pi pi]) xlabel( k, fontsize,lfs) title( Phase Response, fontsize,tfs) hfb figconfg( P73b, long ); stem(nn,xn_plot, filled ) xlim([nn() nn(end)]) xlabel( Time index (n), fontsize,lfs) title( Time Sequence, fontsize,tfs)
CHAPTER 7. The Discrete Fourier Transform 7 5 Magnitude Response 3 Phase Response 5 5 5 5 k (a) 3 5 5 5 k Time Sequence.5.5 3 5 Time index (n) (b) FIGURE 7.5: -point (a) DFT and (b) IDFT of x[n] cos(.πn), 3 in the range ( ) n ( ). 3. (a) Solution: The DFS of x[n] and x 3 [n] can be written as: X[k] X[ k ] X 3 [k] X 3 [ k 3 ] 3 x[n]e jπ n k π j x[n]e 3 n k 3
CHAPTER 7. The Discrete Fourier Transform 7 We have 3 π j X 3 [k] x[n]e 3 n k 3 π j x[n]e 3 n k 3 + n π j x[n]e 3 n k 3 + + ( 3 X[k/3] (b) MATLAB script: π j x[n+]e 3 (n+) k 3 x[n]e jπ n k ) % P73: Matlab verification close all; clc xn [ 3 3 3]; Xk fft(xn(:)); X3k fft(xn); 3 π j x[n]e 3 n k 3 + n π j x[n+]e 3 (n+) k 3 ( ) + e jπ 3 k 3 + e jπ 3 k 3 π j x[n]e 3 n k 3
CHAPTER 7. The Discrete Fourier Transform 79 (c) By applying the correlation property, the DFT of x 3 [n] is: X 3 [k] X[k]X [k] X[k] (d) By applying the windowing property, the DFT of x [n] is: X [k] 9 X[k] 9 X[k] (e) By applying the frequency-shifting property, the DFT of x 5 [n] is: 39. (a) Proof: X[] X 5 [k] X[ k + 9 ] x[n]w n which is real-valued since x[n] is real-valued. (b) Proof: If k, since x[] is real, we have If k, we have X[ k ] X [k] X[] X [] x[n] x[n]w n k x[n]w nk ( x[n]w n( k) x[n]w nk Hence, we proved X[ k ] X [k] for every k. (c) Proof: ) X[/] x[n]w n x[n]e jnπ x[n] cos(nπ) which is real-valued since x[n] and cos(nπ) are both real-valued.