Aoucemets EE3 Digital Sigal Processig Last time: FF oday: Frequecy aalysis with DF Widowig Effect of zero-paddig Lecture 9 based o slides by J.M. Kah Spectral Aalysis with the DF Spectral Aalysis with the DF he DF ca be used to aalyze the spectrum of a sigal. It would seem that this should be simple, take a block of the sigal ad compute the spectrum with the DF. Cosider these steps of processig cotiuous-time sigals: However, there are may importat issues ad tradeo s: Sigal duratio vs spectral resolutio Sigal samplig rate vs spectral rage Spectral samplig rate Spectral artifacts Sprig, EE3 Digital Sigal Processig Sprig, EE3 Digital Sigal Processig Spectral Aalysis with the DF wo importat tools: Applyig a widow to the iput sigal reduces spectral artifacts Paddig iput sigal with zeros icreases the spectral samplig Key Parameters: Parameter Symbol Uits Samplig iterval s Samplig frequecy s = rad/s Widow legth L uitless Widow duratio L s DF legth N L uitless DF duratio N s Spectral resolutio s L = L rad/s Spectral samplig iterval rad/s s N = N Filtered Cotiuous-ime Sigal We cosider a example: x c (t) = A cos! t + A cos! t X c (j ) = A [ (! )+ ( +! )] + A [ (! )+ ( +! )] x c (t) C Sigal x c (t), - < t <, / = 3. Hz, / =. Hz.. -. - -.... t (s) F of Origial C Sigal (heights represet areas of () Ω impulses) X c (j) 3. 3... - - Ω/ (Hz) Sprig, EE3 Digital Sigal Processig Sprig, EE3 Digital Sigal Processig
Sampled Filtered Cotiuous-ime Sigal Sampled Filtered Cotiuous-ime Sigal Sampled Sigal If we sampled the sigal over a ifiite time duratio, we would have: x[] =x c (t) t=, < < described by the discrete-time Fourier trasform: X (e j )= X r= X c j r, < < Recall X (e j! )=X (e j ), where! =... more i ch. I the examples show here, the samplig rate is s / =/ = Hz, su cietly high that aliasig does ot occur. x[].. -. - -. Sampled Sigal, x[] = x c (), - < <, / = Hz DF of Sampled Sigal (heights represet areas of () Ω impulses) X(e j ) 7 3 - - / (Hz) Sprig, EE3 Digital Sigal Processig Sprig, EE3 Digital Sigal Processig Widowed Sampled Sigal Widowed Sampled Sigal Block of L Sigal Samples I ay real system, we sample oly over a fiite block of L samples: x[] =x c (t) t=, apple apple L his simply correspods to a rectagular widow of duratio L. Recall: i Homework we explored the e ect of rectagular ad triagular widowig Widowed Block of L Sigal Samples We take the block of sigal samples ad multiply by a widow of duratio L, obtaiig: v[] =x[] w[], apple apple L Suppose the widow w[] hasdfw (e j! ). he the widowed block of sigal samples has a DF give by the periodic covolutio betwee X (e j! )adw(e j! ): V (e j! )= Z X (e j )W (e j(! ) )d Sprig, EE3 Digital Sigal Processig Sprig, EE3 Digital Sigal Processig Widowed Sampled Sigal Widows (as defied i MALAB) Name(s) Defiitio MALAB Commad Graph (M = ) boxcar(m+), M = Covolutio with W (e j! )hastwoe ects i the spectrum: It limits the spectral resolutio. Mai lobes of the DF of the widow he widow ca produce spectral leakage. Side lobes of the DF of the widow Rectagular Boxcar Fourier riagular w M M M w M M boxcar(m+) triag(m+) w[] w[].... - triag(m+), M =.... * hese two are always a tradeo -time-frequecyucertaity priciple - bartlett(m+), M = Bartlett w M M M bartlett(m+) w[].... - Sprig, EE3 Digital Sigal Processig Sprig, EE3 Digital Sigal Processig
Widows (as defied i MALAB) Widows Name(s) Defiitio MALAB Commad Graph (M = ) Ha cos w M M M ha(m+) w[].... ha(m+), M = - haig(m+), M = All of the widow fuctios w[] are real ad eve. All of the discrete-time Fourier trasforms W (e j! )= M X = M w[]e j! Haig Hammig cos w M M M..cos w M M M haig(m+) hammig(m+) w[] w[].... - hammig(m+), M =.... are real, eve, ad periodic i! with period. I the followig plots, we have ormalized the widows to uit d.c. gai: M X W (e j )= w[] = = M his makes it easier to compare widows. - Sprig, EE3 Digital Sigal Processig Sprig, EE3 Digital Sigal Processig Widow Example Widows Properties W (e j ) W (e j ) M = Boxcar riagular.... -.... 3 M = Haig Hammig.... -.... 3 log W (e j ) log W (e j ) - - -3 - - - M = Boxcar riagular -7... 3 - - -3 - - - M = Haig Hammig -7... 3 hese are characteristic of the widow type Widow Mai-lobe Sidelobe s Sidelobe log s Rect.9 M + Bartlett. M + Ha.3 M + Hammig. 3 M + Blackma. 7 M + Most of these (Bartlett, Ha, Hammig) have a trasitio width that is twice that of the rect widow. Warig: Always check what s the defiitio of M Adapted from ACourseIDigitalSigalProcessigby Boaz Porat, Wiley, 997 Sprig, EE3 Digital Sigal Processig Sprig, EE3 Digital Sigal Processig Widows Examples Widows Examples Here we cosider several examples. As before, the samplig rate is s / =/ = Hz. Rectagular Widow, L = 3 w[]...... Rectagular Widow, L = 3 3 Sampled, Widowed Sigal, Rectagular Widow, L = 3 W(e j ) 3 3 DF of Rectagular Widow - - Ω/ (Hz) DF of Sampled, Widowed Sigal riagular Widow, L = 3 w[]...... 3 riagular Widow, L = 3 Sampled, Widowed Sigal, riagular Widow, L = 3 W(e j ) - - / (Hz) DF of riagular Widow DF of Sampled, Widowed Sigal v[]. -. V(e j ) v[]. -. V(e j ) - - -. -. 3 - - / (Hz) 3 - - / (Hz) Sprig, EE3 Digital Sigal Processig Sprig, EE3 Digital Sigal Processig
Widows Examples Widows Examples Hammig Widow, L = 3 Hammig Widow, L =. Hammig Widow, L = 3 DF of Hammig Widow. Hammig Widow, L = DF of Hammig Widow w[].... W(e j ) w[].... W(e j ) 3 3. 3 Sampled, Widowed Sigal, Hammig Widow, L = 3 - - / (Hz) DF of Sampled, Widowed Sigal. 3 Sampled, Widowed Sigal, Hammig Widow, L = - - / (Hz) DF of Sampled, Widowed Sigal v[]. -. V(e j ) v[]. -. V(e j ) - - -. 3 - - / (Hz) -. 3 - - / (Hz) Sprig, EE3 Digital Sigal Processig Sprig, EE3 Digital Sigal M. Lustig, Processig EECS UC Berkeley Optimal Widow: Kaiser Miimum mai-lobe width for a give sidelobe eergy % R sidelobes H(ej! ) d! R H(ej! ) d! Example y = si(.99)+. si(.) apple < Widow is parametrized with L ad β β determies side-lobe level L determies mai-lobe width OS Eq. Example Zero-Paddig I preparatio for takig a N-poit DF, we may zero-pad the widowed block of sigal samples to a block legth N L: ( v[] apple apple L L apple apple N his zero-paddig has o e ect o the DF of v[], sice the DF is computed by summig over < <. E ect of Zero Paddig We take the N-poit DF of the zero-padded v[], to obtai the block of N spectral samples: V [k], apple k apple N Sprig, EE3 Digital Sigal Processig
Zero-Paddig Cosider the DF of the zero-padded v[]. Sice the zero-padded v[] is of legth N, its DF ca be writte: V (e j! )= v[]e j!, <! < = he N-poit DF of v[] is give by: V [k] = v[]w k = N = N X v[]e j( /N)k, apple k apple N = We see that V [k] correspods to the samples of V (e j! ): V [k] =V (e j! )!=k, apple k apple N N o obtai samples at more closely spaced frequecies, we zero-pad v[] to loger block legth N. he spectrum is the same, we just have more samples. Frequecy Aalysis with DF Note that the orderig of the DF samples is uusual. V [k] = v[]wn k = he DC sample of the DF is k = V [] = v[]w = N = N X v[] = he positive frequecies are the first N/ samples he first N/ egative frequecies are circularly shifted (( k)) N = N k so they are the last N/ samples. (Use fftshift to reorder) Sprig, EE3 Digital Sigal Processig Sprig, EE3 Digital Sigal Processig Frequecy Aalysis with DF Examples: Hammig Widow, L = 3, N = 3 Frequecy Aalysis with DF Examples: Hammig Widow, L = 3, Zero-Padded to N = Sampled, Widowed Sigal, Hammig Widow, L = 3, Zero-Padded to N = 3 N-Poit DF of Sampled, Widowed, Zero-Padded Sigal Sampled, Widowed Sigal, Hammig Widow, L = 3, Zero-Padded to N = N-Poit DF of Sampled, Widowed, Zero-Padded Sigal.. Zero-Padded v[]. -. - -. V[k] Zero-Padded v[]. -. - -. V[k] 3 3 k 3 3 k Spectrum of Sampled, Widowed, Zero-Padded Sigal Spectrum of Sampled, Widowed, Zero-Padded Sigal V(e j ) V[k], k = k/n V(e j ) V[k], k = k/n V[k], V(e j ) V[k], V(e j ) / (Hz) / (Hz) Sprig, EE3 Digital Sigal Processig Sprig, EE3 Digital Sigal Processig idf Rect widow idf
Frequecy Aalysis with DF Legth of widow determies spectral resolutio ype of widow determies side-lobe amplitude. (Some widows have better tradeo betwee resolutio-sidelobe) A yo pt with a history of lower limb weakess referred for mri screeig of brai ad whole spie for cord. MRI sagittal screeig of dorsal regio shows a fait uiform liear high sigal at the ceter of the cord. he sigal abormality likely to represet: Zero-paddig approximates the DF better. Does ot itroduce ew iformatio! () Cord demyeliatio. () Syrix (spial cord disease). (3) Artifact. Aswer : Its a artifact, kow as trucatio or Gibbs artifact http://www.euroradiologycases.com Sprig, EE3 Digital Sigal Processig Potetial Problems ad Solutios Potetial Problems ad Solutios Problem Possible Solutios. Spectral error a. Filter sigal to reduce frequecy cotet above s/ = /. from aliasig Ch. b. Icrease samplig frequecy s = /.. Isu ciet frequecy a. Icrease L resolutio. b. Use widow havig arrow mai lobe. 3. Spectral error a. Use widow havig low side lobes. from leakage b. Icrease L. Missig features a. Icrease L, due to spectral samplig. b. Icrease N by zero-paddig v[] to legth N > L. Sprig, EE3 Digital Sigal Processig