ECE 421 Introduction to Signal Processing ·  · 2014-04-14Let x(n) be a discrete time signal with...

8

Click here to load reader

Transcript of ECE 421 Introduction to Signal Processing ·  · 2014-04-14Let x(n) be a discrete time signal with...

Page 1: ECE 421 Introduction to Signal Processing ·  · 2014-04-14Let x(n) be a discrete time signal with Fourier transform X(!) ... x(n) = 1 3 n; y(n) = 1 2 n ... cosine wave of unit amplitude

ECE 421 Introduction to Signal Processing

Midterm 2 – Spring 2014

April 2, 2014

Name: Student ID:

1

Page 2: ECE 421 Introduction to Signal Processing ·  · 2014-04-14Let x(n) be a discrete time signal with Fourier transform X(!) ... x(n) = 1 3 n; y(n) = 1 2 n ... cosine wave of unit amplitude

Question 1Let x(n) be a discrete time signal with Fourier transform X(ω) given by thefigure below. The signal x(n) is processed by two discrete time systems inparts (a) and (b). For each system, compute and sketch the Fourier transformof the output signal.

(a) y1(n) = x(n) cos(πn

4

).

Solution:

y1(n) = x(n)1

2

[exp

(−j πn

4

)+ exp

(jπn

4

)]Y1(ω) =

1

2

[X(ω − π

4) +X(ω +

π

4)]

A sketch appears in the top part of the figure.

(b) y2(n) = x(−n).

Solution:Y2(ω) = X(−ω)

2

Page 3: ECE 421 Introduction to Signal Processing ·  · 2014-04-14Let x(n) be a discrete time signal with Fourier transform X(!) ... x(n) = 1 3 n; y(n) = 1 2 n ... cosine wave of unit amplitude

A sketch appears in the bottom part of the figure.

3

Page 4: ECE 421 Introduction to Signal Processing ·  · 2014-04-14Let x(n) be a discrete time signal with Fourier transform X(!) ... x(n) = 1 3 n; y(n) = 1 2 n ... cosine wave of unit amplitude

Question 2A digital filter is characterized by the following properties:

• It is a notch filter and has one pole and one zero.

• The pole is at a distance r = 0.9 from the origin of the z-plane.

• Constant signals do not pass through the system.

(a) Where are the zero z and pole p located? Plot the pole-zero pattern ofthe filter.Solution: The zero is located at z = +1 in order to block constant signals,and the pole is also real valued and positive, in order to compensate for thezero. Therefore, the pole is located at p = 0.9.(b) The transfer function has the general form, H(ω) = G e+jω−z

e+jω−p , where z

and p are from part (a), and G is a gain parameter. Compute G using thefollowing information: H(ω = π) = 1.Solution: At ω = π we have that ejπ = −1, and so 1 = H(π) = G −1−1

−1−0.9 ,

implying that G = 1.92

= 0.95.(c) Determine a difference equation that corresponds to the filter in the timedomain.Solution: H(z) = Y (z)/X(z) = 0.95 z−1

z−0.9 = 0.95 1−z−1

1−0.9z−1 . Therefore,Y (z)(1 − 0.9z−1) = 0.95X(z)(1 − z−1), yielding the difference equation,y(n)− 0.9y(n− 1) = 0.95x(n)− 0.95x(n− 1). We can rewrite this as follows,y(n) = 0.9y(n− 1) + 0.95x(n)− 0.95x(n− 1).(d) The following Matlab code implements some difference equation.

n=-10:10; % time scale for simulation

x=(n>=0); % x is a step function

y=x*0; % initialize y with zeros

for index=2:length(n) % cannot start at first index - see below

y(index)=0.5*y(index-1)+x(index); % difference equation

end;

Express the transfer function that corresponds to the difference equationbeing implemented in this example.Solution: y(n) = 0.5y(n−1)+x(n), which corresponds to Y (z) = 0.5Y (z)z−1+X(z). We can simplify this expression, Y (z)(1 − 0.5z−1) = X(z), yieldingH(z) = Y (z)/X(z) = 1

1−0.5z−1 .(e) Provide Matlab code that plots x(n) as a function of n.Solution:

plot(n,x)

4

Page 5: ECE 421 Introduction to Signal Processing ·  · 2014-04-14Let x(n) be a discrete time signal with Fourier transform X(!) ... x(n) = 1 3 n; y(n) = 1 2 n ... cosine wave of unit amplitude

Question 3The following input-output pair has been observed,

x(n) =

(1

3

)n,

y(n) =

(1

2

)nu(n).

(a) Explain whether the system could be LTI. If it can, then determine thefrequency response.Solution: The input x(n) does not have a Fourier transform, and thereforethe system cannot be LTI.(b) Compute

∫ π−π |Y (ω)|2dω.

Solution:∫ π

−π|Y (ω)|2dω = 2π

∑n

|y(n)|2 = 2π∑n

(1

4)n = 2π

1

1− 14

=8

3π.

To verify this, recall that H(ω) = 11− 1

2e−jω . We can integrate numerically as

follows,

Delta=0.001;

w=-pi:Delta:pi;

H=1./(1-0.5*exp(-j*w));

fprintf(’Numerical=%10.5f\n’,sum(abs(H.^2)*Delta));

fprintf(’Theory =%10.5f\n’,8/3*pi);

5

Page 6: ECE 421 Introduction to Signal Processing ·  · 2014-04-14Let x(n) be a discrete time signal with Fourier transform X(!) ... x(n) = 1 3 n; y(n) = 1 2 n ... cosine wave of unit amplitude

Question 4This question investigates band pass signals. Consider a real-valued bandpass signal xa(t) with Xa(F ) = 0 for |F | < F1 and |F | > F2. The Nyquistsampling theorem shows that sampling the signal at rate exceeding Fs = 2F2

allows to reconstruct the signal perfectly.In some applications, it is possible to sample signals at a lower rate. Forexample, recall the AM radio example that we discussed in class. A radiostation is transmitted around a carrier frequency in the MHz range, whereasthe audio signal is in the KHz range. This question discusses how such asignal can be demodulated.

(a) Suppose that F1 = 4 KHz and F2 = 5 KHz. Let the spectrum of xa(t)be given by the figure. The signal is sampled at sampling rate Fs = 2 KHz(Ts = 0.5 ms), resulting in x(n) = xa(nTs). Sketch the discrete-time Fouriertransform.

Solution: The spectrum of the sampled signal

xs(t) =∞∑

n=−∞

xa(nTs)δ(t− nTs)

is

Xs(F ) = Fs

∞∑k=−∞

Xa(F − kFs),

which is formed by shifting Xa(F ) by integer multiples of the sampling fre-quency and summing. The resulting spectrum is sketched below. Next, recall

6

Page 7: ECE 421 Introduction to Signal Processing ·  · 2014-04-14Let x(n) be a discrete time signal with Fourier transform X(!) ... x(n) = 1 3 n; y(n) = 1 2 n ... cosine wave of unit amplitude

that Fs is analogous to 2π radians per sample. Therefore, the range from −1KHz to +1 KHz in the figure corresponds to −π and +π radians per sample.(b) Suppose that in addition to the desired signal xa(t) there is an unwantedcosine wave of unit amplitude at 1.5kHz as shown below. Such signals areoften called interference. The signal is sampled at Fs = 2 KHz as before,

where an anti aliasing filter whose magnitude response is given in the follow-ing figure is used to attenuate the noise. Draw the spectrum of the discrete

time baseband signal x(n) after sampling at Fs = 2kHz.Solution: The unwanted cosine is now folded into 0.5 KHz, and this willchange the spectrum of the signal in baseband. Even though the sinusoid isattenuated by the antialiasing filter, the amplitude of the cosine is not zero.Hence, the recovered baseband signal is corrupted by noise. The spectrumof the baseband is shown below.(c) In our example, the interference signal 1.5 KHz was nicely separated fromthe desirable signal xa(t). But the cosine could have been much closer to the

7

Page 8: ECE 421 Introduction to Signal Processing ·  · 2014-04-14Let x(n) be a discrete time signal with Fourier transform X(!) ... x(n) = 1 3 n; y(n) = 1 2 n ... cosine wave of unit amplitude

signal, for example at 3800 Hz. Please discuss informally how the possiblepresence of nearby interference influences the design of the anti aliasing filterH(F ). Recall that other radio stations could be viewed as interference; inorder to reduce costs of radio receivers, how would you recommend to allocatefrequency bands to different radio stations?Solution: In applications where interference is close to our pass band, it isdifficult to design anti aliasing filters with such good attenuation character-istics. In order to reduce costs, it is desirable to space radio channels farapart.

8