ECE 3 Fall Division Homework Solutions Problem. Reconstruction of a continuous-time signal from its samples. Consider the following periodic signal, depicted below: {, if n t < n +, for any integer n, x(t =, if n t < n, for any integer n. x(t 4 t Suppose we use the ideal impulse-train sampling model considered in class, to sample and reconstruct this signal. First, in order to avoid aliasing, we filter the signal using an ideal CT low-pass filter H with passband gain and cut-off frequency ω s /: { H, if ω ω s (jω =, otherwise. We then sample the filtered signal at the rate of ω s /(π samples per second, using an ideal impulsetrain sampler with sampling period T = π/ω s (i.e. multiplication by a periodic train of ideal continuous-time unit impulses with period T. From the continuous-time impulse train obtained through sampling, we reconstruct a signal y(t using another ideal analog low-pass filter, H: { T, if ω ω s H(jω =, otherwise. Find the reconstructed signal y(t for the following values of ω s /(π. (i.5 samples per second (i.e., one sample is taken every two seconds. (ii.5 samples per second. (iii.5 samples per second. (iv.5 samples per second. For Parts (i, (ii, (iii, give expressions for y(t without using MATLAB. For Part (iv, use MATLAB to plot y(t. Comment on your results.
x (t x'( t p (t x p (t y(t H '(f H(f Figure : Block diagram of the system in Problem. Solution. The system diagram is shown in Fig.. Let us first consider the effect of the last two stages, sampling and low-pass filter H. Suppose X, X p, and Y are the CTFT of x, x p, and y, respectively. As derived in class, we have: X p (jω = Y (jω = H(jωX p (jω = Because of the first low-pass filter H, we have: X (jω = k= T X (j(ω ω s { TXp (ω if ω ωs if ω > ωs for ω > ω s. Thus, there is no aliasing in X p. So ( can be rewritten as follows: { T Y (jω = T X (jω if ω ωs if ω > ωs = X (jω. ( This means that y(t = x (t. The last two stages together did nothing to the signal and can be omitted. Therefore, we only need to consider the effect of the first filter, to decide which frequency components of x it keeps and which ones it discards. To do that, let us compute the Fourier series expansion of x: x(t = where T = is the fundamental period of x. a k = = = = { j { j k= πk j x(te t dt x(te jkπt dt = kπ e jkπt k k = ( a k e j πk T t, (3 kπ [( k ] k k = e jkπt dt The same result can be obtained by using the time-shifting property of the CT Fourier transform, in conjunction with the result of Example from the notes on CT Fourier transform. This is because x is related to the signal s from that example as follows: x(t = s ( t + t,
..8.6.4.. 4 4 6 8 Figure : Matlab plot for Problem (iv. with A =, t =, and T =. Notice that a k = a k, to get the following from Eq. (3: x(t = + (a k e jkπt + a k e jkπt k= = + a k (e jkπt e jkπt k= = + a k j sin(kπt k= = + k= kπ [ ( k ]sin(kπt = + π sin(πt + 3π sin(3πt + sin(5πt +... (4 5π After the low-pass filter H, only those terms with angular frequency no greater than ω s / in (4 are preserved in x (t. Now let us see the results for different ω s. (i If ωs = π, only the first term in (4 gets through H : x (t =. (ii If ωs =.5π, only the first terms in (4 get through H : x (t = + π sin(πt. (iii If ωs =.5π, only the first terms in (4 get through H : x (t = + π sin(πt. 3
(iv If ωs =.5π, only the first 6 terms in (4 get through H : x (t = + π sin(πt + 3π sin(3πt + 5π sin(5πt + 7π sin(7πt + 9π sin(9πt. A plot of y(t is shown in Figure. Problem. Sampling theorem. Consider sampling the signal below (which is defined for all time, < t <. x c (t = sin(6πt πt cos(3πt (a x c (t is sampled with sampling period T = /4 seconds, to produce the discrete-time signal x d [n] = x c (nt. Plot the magnitude of the DTFT of x d, X d (e jω, over the interval π < Ω < π. Show as much detail as possible. (b What is the Nyquist sampling rate for this signal? Solution. Multiplication in the time domain corresponds to convolution in the frequency domain. Breaking up x c (t into x (t = sin(6πt πt and x (t = cos(3πt, we have: { if ω < 6π, X (jω = otherwise, X c (jω = π X X (jω = X (jω = πδ(ω + 3π + πδ(ω 3π, if ω < 3π, / if 3π ω < 9π, otherwise, see the top three plots of Fig. 3. To get X d (e jω from X c (jω, we can use the following formulas from the notes and the text: X p (jω = ( X c (j ω πk (5 T T k= ( X d (e jω = X p j Ω = ( j(ω πk X c. (6 T T T k= Note that the highest frequency in X c (jω is 9π, which means that the Nyquist sampling rate for this signal is 9 samples per second. Since we are sampling at f s = 4 Hz > 9 Hz, there will be no aliasing, i.e., the shifted replicas of X c (jω/t in the formula (5 will not overlap. Thus, in order to get X p (jω we simply put replicas of X c (jω/t at ω =, ±ω s, ±ω s,... Then, to get X(e jω from X p (jω according to the formula (6, we rescale the frequency axis by a factor T = /4, as shown in the bottom plot of Fig. 3. Problem 3. Interpolation. Consider the following continuous-time signal illustrated in Fig. 4: {, if n.5 t < n +.5, for any integer n, x(t =, if n.5 t < n.5, for any integer n. 4
X (jω.5 6kpi 6kpi 6kpi 6kpi X (jω.5 6kpi 3kpi 3kpi 6kpi X c (jω.5 6kpi 9kpi 3kpi 3kpi 9kpi 6kpi 4 X(e jω pi 3pi/8 pi/8 pi/8 3pi/8 pi Figure 3: Spectra for Problem. 5
x(t t Figure 4: Signal x(t for Problem 3. Suppose this signal is ideally sampled (with no prefiltering at the rate of Hz, to obtain a discretetime signal x d [n] = x(n. The latter is then filtered with a nonlinear discrete-time filter specified by the following input-output relationship: y d [n] = (x d [n], where y d is the response of the filter to the input x d. (a Find and plot x d [n]. (Hint. Do not do this in the frequency domain. Just recall the time-domain definition of ideal sampling and write down x d directly. { if n is even Solution. As shown in Fig. 5, x d [n] = x(n = if n is odd (b Find and plot y d [n]. x d [n] = y d [n] n Figure 5: Signals x d = y d for Problem 3. Solution. Since x(t is either zero or one for all t, we have that x d [n] is either zero or one for all n. But = and =, so y d [n] = x d [n] for this particular signal. (c Suppose we subtract.5 from y d to obtain another discrete-time signal y: y[n] = y d [n].5. y[n] y u [n] LPF y int [n] Figure 6: Interpolator for Problem 3(c. 6
Suppose further y int is the result of interpolating y using the scheme illustrated in Fig. 6: first, y is upsampled by a factor of to result in y u ; and then y u is filtered with an ideal discretetime low-pass filter. For this problem, we assume the following frequency response for the ideal low-pass filter: { H(e jω, ω π = 3 π, 3 < ω π Find y int [n]. Solution. Note that y d can be represented as follows: y d [n] =.5 +.5cos(πn, and therefore y[n] =.5cos(πn. Since y u is the result of inserting a zero after each sample of y, we have:.5 n =..., 4,,4,8,... y[n] =.5 n =..., 6,,,6,... =.5cos(πn/. if n is odd Since all frequencies below π/3 are preserved, this sinusoid of frequency π/ will be preserved exactly: y int [n] =.5cos(πn/. Problem 4. Decimation. The system depicted below is a (discrete-time decimator. Assume that the frequency response of the discrete-time low-pass filter is: { H(e jω, ω π = 3 π, 3 < ω π x[n] LPF y[n] Find the output y for each of the following inputs: (a x[n] =, for < n < ( + j n (b x[n] =, for < n < (c (d (e x[n] = j n, for < n < ( π x[n] = cos 8 n, for < n < ( π x[n] = cos n, for < n < (Hint. The inputs in (a-c are everlasting complex exponential signals, and the two remaining inputs can be represented as sums of complex exponentials. Solution. Let x denote the output signal of the low-pass filter. We know that for any complex exponential signal x[n] = e jω n, x [n] = e jω n H(e jω. Therefore, if the angular frequency ω π 3, then x [n] = x[n]; otherwise x [n] =. 7
(a (b x[n] = = e jn, < n < The angular frequency ω = π 3, so x [n] = x[n] =, and hence y[n] = x [n] =. x[n] = ( + j n = e j π 4 n, < n < The angular frequency ω = π/4 π 3, so x [n] = x[n], and the output is y[n] = x [n] = x[n] = e j π n = j n. (c x[n] = j n = e j π n, < n < The angular frequency ω = π > π 3, so x (n =, therefore y[n] =. (d (e ( π x[n] = cos 8 n = ej π 8 n + e j π 8 n, < n < Note that x is a linear combination of two complex exponentials with angular frequencies ω = π 8 and ω = π 8. Using the fact that ω = ω = π 8 π 3 and linearity of LPF, we get x [n] = x[n]. Therefore, the output is y[n] = x [n] = x[n] = cos ( π 4 n. ( π x[n] = cos n = ej π n + e j π n, < n < Again, x is a linear combination of two complex exponentials. Their angular frequencies are ω = π and ω = π. In this case, we have π > ω = ω = π > π 3. Therefore, x [n] = and y[n] =. 8