1 EE102B Spring 2018 Signal Procssing and Linar Systms II Goldsmith Problm St #2 Du: Friday April 20, 2018 at 5 PM. 1. Non-idal sampling and rcovry of idal sampls by discrt-tim filtring 30 pts) Considr a systm to convrt a continuous-tim signal to discrt-tim dfind by th input-output rlation nts y[n] = xτ)dτ. n 1)T s 1) a) Show that th systm in 1) can b obtaind by passing xt) through a filtr with impuls rspons ht) = ut) ut T s ) followd by a pointwis uniform samplr at tims t = nt s, n N: y c t) = xt) ht) y[n] = y c nt s ) xt) H jω) samplr b) Find an xprssion for Y jω) in trms of X jω) and T s. Your answr should involv a sum of frquncy-shiftd copis of X jω), multiplid by othr frquncy-dpndnt factors. c) Assum that A ω π/t s, X jω) = 0 othrwis. Sktch a singl priod of th magnitud and phas of Y jω). Also, sktch a singl priod of th magnitud and phas of X d jω ), th DTFT of th sampld signal x d [n] = xnt s ). d) W now filtr y[n] using g[n] to obtain z[n] = y[n] g[n]. Find th frquncy rspons G jω) such that z[n] = x[n] = xnt s ). Can th systm g[n] b causal? xplain. ) Sktch a singl priod of th magnitud and phas of G jω). 2. Effct of upsampling on rconstruction filtr rquirmnts 20 pts) A continuous music signal is bandlimitd to ω m 2π = 10kHz and sampld at a frquncy ω s 2π = 32kHz. a) Using zro-ordr hold, a continuous signal is rconstructd from th sampls. Sktch th magnitud of th rconstruction filtr, H r jω) that nabls prfct rconstruction. What is th rang of frquncis for which th output spctrum of th zro-ordr hold is 0? What if any) rstrictions ar thr on th rconstruction filtr rspons at ths frquncis? 10 pts) b) Idal upsampling by a factor of L = 2 as dscribd in th radr) is prformd and a continuous signal is rconstructd from a zro-ordr hold. Rpat part a) for this nw sampling rat. 10 pts)
2 3. Discrt tim upsampling and downsampling 20 pts) Adaptd from OWN, Prob. 7.19) Considr th systm shown blow with input x[n] and output y[n]. Th zro insrtion systm insrts two points with zro amplitud btwn ach of th squnc valus in x[n]. Th dcimation is dfind by y[n] = w[5n], whr w[n] is th input squnc for th dcimation systm, and H jω ) = 1, if Ω [ π/5,π/5] and zro othrwis. t[n] w[n] x[n] Zro insrtion H jω ) Dcimation y[n] a) If th input is of th form x[n] = sinω 1n πn, dtrmin th output y[n], and plot th DTFT of x[n],t[n],w[n] and y[n] for th following valus of ω 1. i. ω 1 3π 5 ii. ω 1 > 3π 5. b) Assum ω 1 3π 5. Suppos th low pass filtr H was rplacd with a filtr H jω ) that is constant ovr bandwidth [ W 1,W 1 ], taks any valu btwn [ W 2, W 1 ] and [W 1,W 2 ] and is zro outsid [ W 2,W 2 ]. For what valus of W 1 and W 2 ar W jω ) and Y jω ) th sam as with th idal LPF of part a)? Extra Crdit Rconstruction of a band-limitd signal from nonuniform sampling. 10 pts) Takn from OWN, Problm 7.37) A signal limitd in bandwidth to ω < W can b rcovrd from non-uniformly spacd sampls as long as th avrag sampl dnsity is 2W/2π) sampls pr scond. This problm illustrats a particular xampl of nonuniform sampling. Assum that in Figur a):
3 xt) is band-limitd; X jω) = 0, ω > W. pt) is a non-uniformly spacd priodic puls train, as shown in Figur b). f t) is a priodic wavform with priod T = 2π/W. Sinc f t) multiplis an impuls train, th only valus that ar significant ar f 0) = a and f δ) = b at t = 0 and t =, rspctivly. H 1 jω) is a 90 dgr phas shiftr dfind as follows: j ω > 0 H 1 jω) = j ω < 0 H 2 jω) is an idal lowpass filtr dfind as follows: K 0 < ω < W H 2 jω) = K W < ω < 0 0 ω < W whr K is a possibly complx) constant. Answr th following qustions: a) Exprss th CTFT of pt), y 1 t), y 2 t), and y 3 t) in trms of X jω). b) Spcify th valus of a, b, and K as functions of such that zt) = xt) for any band-limitd xt) and any such that 0 < δ < π/w.
1 UPSAMPLING AND DOWNSAMPLING 4 MATLAB Assignmnt Gnral Instructions Answr all qustions askd. Your submission should includ all m-fil listings and plots rqustd. All plots should hav a titl and x and y-axs proprly labld. 1 Upsampling and Downsampling In this xrcis, you will xamin how upsampling and downsampling a discrt-tim signal affcts its discrt-tim Fourir transform DTFT). 20 pts) a) For most of this xrcis, you will b working with finit sgmnts of th two signals ) sin0.4πn 62)) 2 x 1 [n] = 1) 0.4πn 62)) ) sin0.2πn 62)) 2 x 2 [n] = 2) 0.2πn 62)) Dfin x1 and x2 to b ths signals for 0 n 124 using th sinc command. Plot both of ths signals using stm. If you dfind th signals proprly, both plots should show that th signals ar symmtric about thir largst sampl, which has hight 1. b) Analytically comput th DTFTs X 1 jω ) and X 2 jω ) of x 1 [n] and x 2 [n] as givn in Eqs. 1) and 2), ignoring th ffct of truncating th signals. Us fft to comput th sampls of th DTFT of th truncatd signals in x1 and x2 at Ω k = 2πk/2048 for 0 k 2047 and stor th rsults in X1 and X2. Gnrat appropriatly labld plots of th magnituds of X1 and X2. How do ths plots compar with your analytical xprssions? c) Dfin th xpansion of th signal x[n] by L to b th procss of insrting L 1 zros btwn ach sampl of x[n] to form x [n] = { x[n/l], n = kl, k intgr, 0, othrwis. If x is a row vctor containing x[n], th following commands implmnt xpanding by L >> x = zros1, L*lngthx)); >> xl:l:lngthx)) = x; Basd on this tmplat, dfin xl and x2 to b x1 and x2 xpandd by a factor of 3. Also, dfin X1 and X2 to b 2048 sampls of th DTFT of ths xpandd signals computd using fft. Gnrat appropriatly labld plots of th magnitud of ths DTFTs. Expanding by L should giv a DTFT X jω) = X jωl ). Do your plots agr with this?
2 QUANTIZATION 5 2 Quantization In this qustion you will mpirically study th ffct of quantization on th accuracy of th digital rprsntation of a signal. 20 pts) Lt x[n] = 10sinct) Crat a vctor x which contains th sampls of xt) at 100 tims sampls uniformly spacd btwn 5 to 5. a) Construct a function quantizx,mid_points) which rturns th lmnt in th vctor mid_points closst to x in absolut valu. b) Us th function you cratd in a) to quantiz ach sampl in x into k = 8 quantization lvls this corrsponds to rprsnting th signal with 3 bits) uniformly spacd btwn th maximum and th minimum of th signal. That is, th vctor mid_points should contain L numbrs that rprsnts th mid-points of th quantization bin boundaris. Plot on th sam figur th original signal xt) and its quantizd vrsion ˆxt). c) W dfin quantization rror as x[n] ˆx[n]. Plot a histogram of th quantization rror you rcivd in b). What distribution dos th rror sm to follow? d) Rpat part b) with k = 4, k = 16, k = 32, and k = 64 quantization lvls 2, 4, 5 and 6 bits, rspctivly). For ach cas, calculat th SNR signal nrgy dividd by nois nrgy) whr w dfin nois nrgy as n x[n] ˆx[n]) 2 and signal nrgy as n x[n]) 2. Plot SNR vs. log numbr of quantization lvls L. Extra crdit xtnsion of scond matlab problm) 10 pts) Matlab has a built in function lloyds.m that quantizs a signal using Lloyd s algorithm. Th Lloyd algorithm also known as th K-mans algorithm ) taks as inputs a st of points on th ral lin x and th numbr L of bins or clustrs. Th algorithm divid th ral lin into L disjoints intrvals, such that th distanc from ach point to th cntr of mass of all othr points in its intrval is minimal. Th rsult is a quantization rul or a partition) that is optimal with rspct to th givn data points in th sns that th quantization nois nrgy is minimial ovr all partitions of th ral lin into L rgions. Lloyd s algorithm is also usful in partitioning mor than on dimnsion. With mor than on dimnsion, howvr, th algorithm is not guarantd to convrg to a global optimal partition. Rpat part a) - c) abov using this function to prform quantization. How do your rsults diffr?