EECE 301 Signals & Systms Prof. Mark Fowlr ot St #21 D-T Signals: Rlation btwn DFT, DTFT, & CTFT 1/16
W can us th DFT to implmnt numrical FT procssing This nabls us to numrically analyz a signal to find out what frquncis it contains!!! sampls FFT algorithm ADC crats stramd computs sampls into mmory DFT valus A CT signal from a snsor & lctronics DFT valus dumpd into mmory ADC x (t) x[n] @ F s So w nd to undrstand what th DFT valus tll us about th CTFT of x(t) W nd to undrstand th rlations btwn CTFT, DTFT, and DFT x[0] x[1] x[2] x[-1] mmory array Computr DFT Procssing (via FFT) H/W or S/W on procssor X[0] X[1] X[2] X[-1] mmory array 2/16
W ll mathmatically xplor th link btwn DTFT & DFT in two cass: 1. For x[n] of finit duration: 0 0 x[0] x[1] x[2]... X[ 1] 0 0 non-zro trms (of cours, w could hav som of th intrior valus = 0) For this cas w ll assum that th signal is zro outsid th rang that w hav capturd. So w hav all of th maningful signal data. This cas hardly vr happns but it s asy to analyz and provids a prspctiv for th 2 nd cas 2. For x[n] of infinit duration or at last of duration longr than what w can gt into our DFT Procssor insid our computr. So w don t hav all th maningful signal data. This is th practical cas. What ffct dos that hav? How much data do w nd for a givn goal? 3/16
DFT & DTFT: Finit Duration Cas If x[n] = 0 for n < 0 and n thn th DTFT is: X ( ) n x[ n] jn 1 n0 x[ n] jn w can lav out trms that ar zro - ow if w tak ths sampls and comput th DFT (using th FFT, prhaps) w gt: 1 j2kn / X [ k] x[ n] k 0,1,2,..., 1 n0 2 Comparing ths w s that for th finit-duration signal cas: X [ k] X k X () -/2 X [k] 0 1 2 3 4 5 6 7 /2 2 k DTFT & DFT : DFT points li xactly on th finit-duration signal s DTFT!!! 4/16
Summary of DFT & DTFT for a finit duration x[n] x[n] X () X [ k] X k 2 Points of DFT ar sampls of DTFT of x[n] Th numbr of sampls sts how closly spacd ths sampls ar on th DTFT sms to b a limitation. Zro-Padding Trick Aftr w collct our sampls, w tack on som additional zros at th nd to trick th DFT Procssing into thinking thr ar rally mor sampls. (Sinc ths ar zros tackd on thy don t chang th valus in th DFT sums) If w now hav a total of Z sampls (including th tackd on zros), thn th spacing btwn DFT points is 2/ Z which is smallr than 2/ 5/16
Ex. 4.11 DTFT & DFT of puls 1, x[ n] 0, n 0,1,2,...2q othrwis Rcall : 1, p q [ n] 0, n q,, 1, othrwis 0,1,, q Thn x[ n] pq[ n q] ot: w ll nd th dlay proprty for DTFT From DTFT Tabl: p q [ n] P ( ) q sin[( q 0.5) ] sin[ / 2] From DTFT Proprty Tabl (Dlay Proprty): X ( ) sin[( q 0.5) ] sin[ / 2] jq Sinc x[n] is a finit-duration signal thn th DFT of th = 2q+1 non-zro sampls is just sampls of th DTFT: X [ k] X k 2 X [ k] sin[( q.5)2k / sin[ k / ] ] jq2k / 6/16
ot that if w don t zro pad, thn all but th k = 0 DFT valus ar zro!!! That dosn t show what th DTFT looks lik! So w nd to us zro-padding. Hr ar two numrically computd xampls, both for th cas of q = 5: For th cas of zropadding 11 zros onto th nd of th signal th DFT points still don t rally show what th DTFT looks lik! For th cas of zropadding 77 zros onto th nd of th signal OW th DFT points rally show what th DTFT looks lik! DFTs wr computd using matlab s fft command s cod on nxt slid 7/16
Comput th DTFT Equation drivd for th puls. Using ps adds a vry small numbr to avoid gtting = 0 and thn dividing by 0 omga=ps+(-1:0.0001:1)*pi; q=5; % usd to st puls lngth to 11 points X=sin((q+0.5)*omga)./sin(omga/2); subplot(2,1,1) plot(omga/pi,abs(x)); % plot magn of DTFT xlabl('\omga/\pi (ormalizd rad/sampl)') ylabl(' X(\Omga) and X[k] ') hold on x=zros(1,22); % Initially fill x with 22 zros x(1:(2*q+1))=1; % Thn fill first 11 pts with ons Xk=fftshift(fft(x)); % fft computs th DFT and fftshift r-ordrs points % to btwn -pi and pi omga_k=(-11:10)*2*pi/16; % comput DFT frquncis, xcpt mak thm % btwn -pi and pi stm(omga_k/pi,abs(xk)); % plot DFT vs. normalizd frquncis hold off subplot(2,1,2) plot(omga/pi,abs(x)); xlabl('\omga/\pi (ormalizd rad/sampl)') ylabl(' X(\Omga) and X[k] ') hold on x=zros(1,88); x(1:(2*q+1))=1; Xk=fftshift(fft(x)); omga_k=(-44:43)*2*pi/88; stm(omga_k/pi,abs(xk)); hold off Mak th zro-paddd signal Comput th DFT Comput th DFT point s frquncy valus and plot th DFT 8/16
Important Points for Finit-Duration Signal Cas DFT points li on th DTFT curv prfct viw of th DTFT But only if th DFT points ar spacd closly nough Zro-Padding dosn t chang th shap of th DFT It just givs a dnsr st of DFT points all of which li on th tru DTFT Zro-padding provids a bttr viw of this prfct viw of th DTFT 9/16
DFT & DTFT: Infinit Duration Cas As w said in a computr w cannot dal with an infinit numbr of signal sampls. So say thr is som signal that gos on forvr (or at last continus on for longr than w can or ar willing to grab sampls) x[n] n =, -3, -2, -1, 0, 1, 2, 3, W only grab sampls: x[n], n = 0,, 1 W v lost som information! W can dfin an imagind finit-duration signal: W can comput th DFT of th collctd sampls: X x[ n], x [ n] 0, [ k] n 1 0 x [ n] n lswhr j2nk / 0,1,2,..., k 1 0,1,..., 1 Q: How dos this DFT of th truncatd signal rlat to th tru DTFT of th full-duration x[n]? which is what w rally want to s!! 10/16
"Tru" DTFT : n X ( ) x[ n] jn What w want to s DTFT of truncatd signal : X ( ) n 1 n0 x x[ n] [ n] jn jn A distortd vrsion of what w want to s DFT of collctd signal data : X [ k] 1 n0 x[ n] j2kn / What w can s DFT givs sampls of So DFT of collctd data givs sampls of DTFT of truncatd signal Tru DTFT DFT of collctd data dos not prfctly show DTFT of complt signal. Instad, th DFT of th data shows th DTFT of th truncatd signal So our goal is to undrstand what kinds of rrors ar in th truncatd DTFT thn w ll know what rrors ar in th computd DFT of th data X ( ) 11/16
To s what th DFT dos show w nd to undrstand how X () rlats to X () First, w not that: x [ n] x[ n] p q n q DTFT P ( ) q sin / 2 sin / 2 j( 1) / 2 with =2q+1 From mult. in tim domain proprty in DTFT Proprty Tabl: 1 X ( ) X( ) Pq( ) d 2 causs smaring of X () So X () which w can s via th DFT X [k] is a smard vrsion of X () Fact : Th mor data you collct, th lss smaring bcaus P q () bcoms mor lik () 12/16
Suppos th infinit-duration signal s DTFT is: X () DTFT of infinitduration signal 2 2 Thn it gts smard into somthing that might look lik this: X () DTFT of truncatd signal 2 2 Thn th DFT computd from th data points is: X [k] 2 2 Th DFT points ar shown aftr uppr points ar movd (.g., by MATLAB fftshift ) 13/16
Th only cas that rally happns in practic! Important points for Infinit-Duration Signal Cas 1. DTFT of finit collctd data is a smard vrsion of th DTFT of th infinit-duration data 2. Th computd DFT points li on th smard DTFT curv not th tru DTFT a. This givs an imprfct viw of th tru DTFT! 3. Zro-padding givs dnsr st of DFT points a bttr viw of this imprfct viw of th dsird DTFT!!! 14/16
Connctions btwn th CTFT, DTFT, & DFT x(t) ADC x[n] Fs / 2 X ( f ) CTFT Fs / 2 X ()Full Aliasing f DTFT x[0] x[1] x[2] x[-1] Insid Computr DFT procssing X [0] X [1] X [2] X [-1] Look hr to s aliasd viw of CTFT X () Truncatd Smaring DTFT X [ k] Computd DFT 15/16
Errors in a Computd DFT CTFT DTFT DTFT DFT Aliasing Error control through F s choic (i.. through propr sampling) Smaring Error control through Grid Error control through choic window choic choic zro padding S DSP cours This is th only thing w can comput from data and it has all ths rrors in it!! Th thory covrd hr allows an nginr to undrstand how to control th amount of thos rrors!!! Zro padding trick Collct sampls dfins X () Tack M zros on at th nd of th sampls Tak ( + M)pt. DFT givs points on X () spacd by 2/(+M) (rathr than 2/) 16/16