PROBLEM SET 6 Issued: 2/32/19 Due: 3/1/19 Reading: During the past week we discussed change of discrete-time sampling rate, introducing the techniques of decimation and interpolation, which is covered in OSYP 4.6. During the coming week we will begin a discussion of the spectral representation of discrete-time periodic and finite-duration signals, leading to the discrete Fourier transform (DFT) and the fast Fourier transform (FFT). Note: Quiz 1 will be on March 6. The exam will be closed book, but you may bring in one sheet of 8.5 x 11 or A4 paper with notes on both sides. There will be a review session before the exam, most likely to be scheduled during the Sunday afternoon or Monday evening preceding the exam. Final date, time, and place TBA. Most of the time will be spend answering questions and working problems... come with questions or the review will be short and boring! The exam will cover through this problem set, or in other words the material we have discussed in OSYP Chapters 1-5. Note: This version is preliminary in that it does not yet have instructions for uploading the MATLAB problems. Problem 6.1: x[n] L x e [n] H(e jω ) y e [n] M y[n] Consider the multi-rate discrete-time system shown in the figure above. We know that: L and M are positive integers x e n xn L for n rl and zero otherwise yn y e nm He j M 4 0 4
18-491 Problem Set 6-2- Spring, 2019 X(e jω ) 1 π π/2 π/2 π ω (a) Assume that L 2 and M 4 and that Xe j, the DTFT of xn, is real and is as shown in the figure above. Sketch and dimension the functions X e e j, Y e e j, and Ye j, the DTFTs of x e n, y e n, and yn, respectively. Be sure to label clearly all important magnitudes and frequencies. (b) Now assume that L 2 and M 8. Determine yn for this case. Hint: See which diagrams in your answer to part (a) change. Problem 6.2: x[n] v[n] 5 4 w[n] H(e jω ) y[n] In the system above, the input signal is xn sin 0.25n -- 4 The system decimates the input by a factor of 5, upsamples the result by a factor of 4 (i.e. places three zeros between each successive sample of vn ), and finally passes the system through the ideal lowpass filter He j with frequency response He j 40 4 0 4 As it turns out, this system is not particularly well designed, but do not let that bother you. (a) Sketch and dimension the following DTFTs: 1. Ve j, the DTFT of vn
18-491 Problem Set 6-3- Spring, 2019 2. We j, the DTFT of wn 3. Ye j, the DTFT of yn (b) It is claimed that the output Acos 0 n + yn can be expressed in the following form: Find numerical values for the coefficients A, 0, and. Note: in obtaining the answer to this problem, please keep in mind that at 1 ----- t a in the distributional sense. This should be taken into consideration whenever you are working with a delta function of a continuous argument, and the scale of the horizontal axis is changed. Problem 6.3: (an old quiz problem) xn x 3 s n x LPF i n z -1 3 x i n 1 x r n The block diagram above depicts a system that is designed to delay the input signal (or at least its envelope) by 1/3 of a sample. In the diagram above, the signal x s n is obtained by inserting two zeros between successive samples of the input xn so that x s n xn 3 for n 3r and zero otherwise. The ideal lowpass filter has a gain of 3 and a cutoff frequency of 3. The final output x r n is obtained by decimating x i n 1 such that x r n x i 3n 1. 1 X(e jω ) π/3 π/3 ω (a) The input signal xn has the DTFT Xe j depicted above. Sketch and dimension carefully the magnitude and phase of the following spectra:
18-491 Problem Set 6-4- Spring, 2019 4. Sketch and dimension X s e j, the DTFT of x s n. 5. Sketch and dimension X i e j, the DTFT of x i n. 6. Sketch and dimension X r e j, the DTFT of x r n. (b) Now suppose that the input to the system is changed to x b n cos0.5n. It is claimed that the overall system output can now be expressed in the form y b n Acosn +. Obtain numerical values for the parameters A,, and. Problem 6.4: Introduction: Commercial CD players routinely employ upsampling, although this fact is not as heavily advertised as it was during the early days of compact disks when this feature provided some competitive advantage. In this problem we discuss one of the reasons why upsampling is commonly used in commercial digital audio systems. Although digital sound reproduction systems (like compact discs) nominally store and process sound without distortion, the signal still has to be converted back to a continuous-time waveform (frequently called an analog waveform) before it reaches the listener. While rapidly declining hardware costs make it practical to implement discrete-time filters with very sharp skirts, it is still difficult and expensive to design high-performance continuous-time filters. We will compare the effect that nonideal continuous-time filtering has on an idealized discrete-time sound reproduction system with and without upsampling. Assume that an arbitrary audio signal with a bandwidth of 20 khz (or 22010 3 radians/sec) is sampled at a sampling frequency of 44.1 khz (the standard sampling rate for commercial digital audio). As you learned in lectures and from the text, this means that the upper discrete-time cutoff frequency of the digitized audio signal is 2.85 or 0.907 radians. Assume also that a third-order Butterworth filter is used for the continuous-time lowpass anti-aliasing filter. (This is not necessarily the type of filter that is actually used in commercial digital audio systems, but it s a simple design that is easy to apply to this problem.) The magnitude of the (continuous-time) frequency response is Hj 1 --------------------------------------------- 1 + c 6 1 2 where c is the cutoff frequency of the filter. Note that this filter has a gain of 1 at very low frequencies. Following common practice, we will compare the magnitudes of the frequency response of the continuoustime filter at different frequencies in decibels. As you may recall, the ratio in decibels (db) of the magnitudes of a filter s transfer functions at two frequencies is equal to
18-491 Problem Set 6-5- Spring, 2019 20 log Hj 1 ------------------ Hj 2, with the logarithm taken to the base 10. (a) Now we re ready to consider a simple discrete-time playback system without upsampling. Consider the system shown in block diagram form in Fig 6.4a. Assume that Xe j, the DTFT of the digitized signal xn, is as shown in Fig 6.4b. xn y s t x c t Hj T Figure 6.4a A X(e jω ) -.907π.907π ω Figure 6.4b y s t n xn t nt where the sampling period is T 1 44.1 khz in this case. Hj is a three-pole Butterworth filter, and the magnitude of its transfer function was given above. (Please note: this is not the ideal reconstruction filter discussed in Sec. 4.3 (cf. Fig. 4.9a) of OSYP!) The function y(t) is the output of the filter. 1. Sketch and dimension Y s j, the (continuous-time) Fourier transform of y s t. 2. What is the lowest frequency (in rad/sec) at which unwanted upper frequency components of y s t appear that were introduced by the sampling of the original audio signal? (In other words, determine
18-491 Problem Set 6-6- Spring, 2019 the lowest frequency of the first periodic repetition of the spectrum that is centered at sec.) 2 T rad/ 3. Assume that c, the cutoff frequency of the analog lowpass filter Hj is set to the Nyquist frequency, 222.0510 3 rad/sec. Relative to its response at low frequencies, by how much does the analog lowpass filter attenuate the magnitude of the original audio signal at its upper cutoff frequency ( 22010 3 rad/sec)? By how much does the analog lowpass filter attenuate the magnitude of the lowest unwanted frequency component that was your answer to part (a2) of this question? Express your answers to these questions in decibels. (b) Now we ll consider a similar system, but with upsampling by a factor of 4:1. In Figure 6.4c, v[n] is an upsampled or interpolated version of x[n]. xn wn vn H I e j y su t y u t vn Hj T Figure 6.4c To obtain v[n] we first construct w[n], a zero-padded version of x[n]: wn xn 4, where n equals some integer multiple of 4 0otherwise v[n] is obtained by passing w[n] through an ideal discrete-time lowpass filter with transfer function H I e j given (for ) by H I e j 1, 4 0, otherwise The ideal D/C converter works as described above, except that the sampling period has been decreased by a factor of 4 so that now T 1 444.1 khz. y su t is the output of the D/C converter of this second
18-491 Problem Set 6-7- Spring, 2019 system with upsampling, and y u t is the total system output after lowpass filtering. As before, we will assume that Hj is a third-order Butterworth lowpass filter. 1. Sketch and dimension We j and Ve j, the DTFTs of w[n] and v[n], respectively, and Y su j, the CTFT of y su t. 2. What is the lowest frequency (in rad/sec) at which unwanted components of y su t (not in the original audio signal) appear in this second system with upsampling? 3. Again assume that the cutoff frequency of the analog lowpass filter Hj is set to 222.0510 3 rad/sec. Relative to its response at low frequencies, by how much does the analog lowpass filter attenuate the magnitude of the original audio signal at its upper cutoff frequency, 22010 3 rad/sec? By how much does the analog lowpass filter attenuate the magnitude of the lowest unwanted frequency component? Express your answers to these questions in decibels. MATLAB Problems In working the MATLAB problems, turn in a printout of your results, a copy of the MATLAB code you developed to work the problem, as well as any additional comments you'd like to add. [These instructions will be updated by Saturday morning.] Problem C6.1: The MATLAB routines decimate, interp, and resample are used to accomplish decimation, interpolation, and general change of sampling rate, respectively. You will be provided with a main file main_6_1.m that you must complete. In MATLAB, enter load mtlb, to load a pre-recorded segment of a genuine Mathworks employee uttering the word MATLAB. The signal is sampled at 7000 Hz. (a) Let the sequence x represent samples 1000 through 1127 of the waveform mtlb. Plot x and its DTFT (perhaps using the DTFT routine you wrote for Problem Set 2). (b) Upsample the sequence x by a factor of 3. Plot the new sequence and its DTFT. Compare to your plots in (a). (c) Downsample the original sequence x by a factor of 2. Plot the new sequence and its DTFT. Compare to your plots in (a) and (b). (d) Plot the sequence that is derived from the original sequence x by increasing its sampling rate by a factor of 1.5. Again plot the new sequence and its DTFT.
18-491 Problem Set 6-8- Spring, 2019 Problem C6.2: As we discussed this week, a common operation in digital signal processing is interpolation or upsampling, where we begin with a discrete-time signal and stuff zeros between the sample points of the original function lowpass filter the result, to obtain a new function with a greater density of sample points with respect to time. While we typically used ideal lowpass filters in the examples discussed in class, we will consider in this problem the properties of the filter that is implied by the common operation of linear interpolation. This topic is discussed in some detail in OSYP Sec. 4.6.3. You will be provided with a file main_6_2.m that you must complete. (a) For our example of linear interpolation, we will consider interpolation by a factor of 5, in which we begin by inserting 4 samples between a series of original sample points. x i n x n 5 + x n 5 + 1 x n 5 1 5n 5 In the difficult-to-read expression above, s refers to the greatest integer that is less than or equal to s and the expression n m refers to n mod m, or the remainder that is obtained when n is divided by m. A more transparent but less compact description of the expression above is the following sequence of operations: 1. Let x e n be equal to xn 5 for integer values of n 5, and zero otherwise. 2. The function x i n defined above is obtained the convolution of x e n and the non-causal finite impulse response filter defined by hn n 1 ----- 5 n 4 0 otherwise Consider the (arbitrary) discrete-time sequence xn 1 4 1 3 1. Obtain the corresponding sequence x i n which is obtained by linearly interpolating the sequence xn by a factor of 5 according to the linear interpolation equation that is stated at the beginning of this problem. Implement the interpolation in the function interp_491.m that is provided. 2. Use the MATLAB function conv to show that the same interpolated result is indeed obtained by convolving the sequences x e n and hn defined immediately above. (b) Sketch hn in the time domain. Obtain an analytical expression for He j, the DTFT of hn by expressing hn as the convolution of two finite-duration rectangular functions. Obtain sketches of He j both using the MATLAB function dtft that you developed for Problem Set 2, and using the freqz function that is built into MATLAB.
18-491 Problem Set 6-9- Spring, 2019 (c) Note that the function hn is zero for values of n that are integer multiples of 5 and that He j is lowpass in nature. As we will see, the lowpass filter for interpolation by a factor of 5 (as is being done here) is an ideal lowpass filter with cutoff frequency 5. Compare the He j implied by linear interpolation of the time functions to this ideal lowpass filter. Please turn in the following to Gradescope: main_6_1.m, main_6_2.m, interp_491.m Answers to all the questions All plots that are requested