Uploaded by Shara Sharmi

Solutions Chapter2[1]

advertisement
Chapter 2: Problem Solutions
Discrete Time Processing of Continuous Time Signals
Sampling
à Problem 2.1.
Problem:
Consider a sinusoidal signal
xt  3cos1000t  0.1
and let us sample it at a frequency Fs  2kHz.
a) Determine and expression for the sampled sequence xn  xnTs  and determine its Discrete
Time Fourier Transform X  DTFTxn;
b) Determine XF  FTxt;
c) Recompute X from the XF and verify that you obtain the same expression as in a).
Solution:
a) xn  xt tnTs  3cos0.5n  0.1. Equivalently, using complex exponentials,
xn  1.5ej0.1 ej0.5n  1.5ej0.1 ej0.5n
Therefore its DTFT becomes


j0.1   
X  DTFTxn  3ej0.1   
2   3e
2 
with     
b) Since FTej2F0 t   F  F0  then
2
Solutions_Chapter2[1].nb
XF  1.5ej0.1 F  500  1.5ej0.1 F  500
for all F.
c) Recall that X  DTFTxn and XF  FTxt are related as
X  Fs   XF  kFs  FFs 2

k
with Fs the sampling frequency. In this case there is no aliasing, since all frequencies are contained
within Fs  2  1kHz. Therefore, in the interval      we can write
X  Fs XF FFs 2
with Fs  2000Hz. Substitute for XF from part b) to obtain


j0.1 2000 
X  20001.5ej0.1 2000 
2  500  1.5e
2  500
Now recall the property of the "delta" function: for any constant a  0,
1
t
at  
a  
a 
Therefore we can write
   3ej0.1   
 
X  3ej0.1   
2
2
same as in b).
à Problem 2.2.
Problem
Repeat Problem 1 when the continuous time signal is
xt  3cos3000t
Solution
Following the same steps:
a) xn  3cos1.5n. Notice that now we have aliasing, since
Fs
F0  1500Hz  
2  1000Hz. Therefore, as shown in the figure below, there is an aliasing at
Fs  F0  2000  1500Hz  500Hz. Therefore after sampling we have the same signal as in
Problem 1.1, and everything follows.
Solutions_Chapter2[1].nb
3
X (F )
 1 .5
1.5
F (kHz )
Fs  X ( F  kFs )
k
 1 .5
 0.5 0.5
 F2s  1.0
Fs
2
1.5
F (kHz )
 1 .0
à Problem 2.3.
Problem
For each XF  FTxt shown, determine X  DTFTxn, where
xn  xnTs  is the sampled sequence. The Sampling frequency Fs is given for each case.
a) XF  F  1000, Fs  3000Hz;
b) XF  F  500  F  500, Fs  1200Hz
F
c) XF  3rect 
1000 , Fs  2000Hz;
F
d) XF  3rect 
1000 , Fs  1000Hz;
F3000
F3000
e) XF  rect 
   rect 
 , Fs  3000Hz;
1000
1000
Solution
For all these problems use the relation
X  Fs   X Fs  2  kFs 

k


k
k
3000
2
a) X  3000   
2  1000  k3000  2    
3  k2;
4
Solutions_Chapter2[1].nb

1200
1200
b) X  1200   
2  500  k1200   
2  500  k1200
k

 2    0  k2    0  k2
0  2  500  1200    1.2;
k
20002
2000
k2
c) X  2000  3  rect 
  k 
1000
1000   6000  rect 
   shown


k
k
below.
X ( )
 2


2

2

2

10002
1000
k2
d) X  1000  3  rect 
  k 
1000
1000   3000  rect 
2   shown below


k
k
X ( )
 2


2

300023000
3000
300023000
3000
e) X  3000  rect 
1000  k 
1000   rect 
1000  k 
1000 

3
3
 3000  rect 
2  3  3k   rect 
2  3  3k
k

k2
 
 6000  rect 
23
k

k
shown below.
X ( )
6000
 2

 26
2
6

2

Solutions_Chapter2[1].nb
5
à Problem 2.4.
Problem
In the system shown, let the sequence be
yn  2cos0.3n    4
and the sampling frequency be Fs  4kHz. Also let the low pass filter be ideal, with bandwidth
Fs  2.
s (t )
y[n]
ZOH
LPF
y (t )
Fs
a) Determine an expression for SF  FTst. Also sketch the frequency spectrum
(magnitude only) within the frequency range Fs  F  Fs ;
b) Determine the output signal yt.
Solution.
From what we have seen, recall that
1
F
SF  ejFFs  
Fs sinc 
Fs Y 2FFs
From Y  2 
2

 ej4   0.3  k2  ej4   0.3  k2 we obtain
k
Y 2FFs 

F
F
j4 2 
 ej4 2 
Fs  0.3  k2  e
Fs  0.3  k2
k

Fs
j4 F  600  k4000 
 2  
2   e
k
F
j4
e
2 
Fs
 600  k4000
and then
600k4000
SF  Fs   Ts ej600k40004000sinc 
 ej4 F  600  k4000 
4000

k
600k4000
F
j600k40004000
j4 2 
Ts e
sinc 
4000  e
Fs
 600  k4000
where we used the fact that the ZOH has frequency response Ts ejFFs sincF  Fs .
6
Solutions_Chapter2[1].nb
This can be simplified to

3
j4 F  600  k4000 
20 sinc 
SF   1k ej 
20  ke
3
3
j4 F  600  k4000
20 sinc 
1 ej 
20  ke
k
k
3
In the interval Fs  4000  F  Fs  4000 we have only terms corresponding to
k  1, 0, 1. The reader can verify that all other frequencies are outside this interval. Therefore, for
4000  F  4000 we have
SF  0.17ej2.827F  3400  0.9634ej0.1  F  600 
 0.9634ej0.1  F  600  0.17ej2.827F  3400
shown below.
| S (F ) |
 5.6  3.4
0.6
3.4
5.6 F (kHz )
b) Since the Low Pass Filter stops all the frequencies above Fs  2 the output signal yt has only
the frequencies at F   600Hz, and therefore
yt  IFT0.9634ej0.1  F  600  0.9634ej0.1  F  600 
 2  0.9634 cos1200t  0.1
à Problem 2.5.
Problem
We want to digitize and store a signal on a CD, and then reconstruct it at a later time. Let the signal
xtbe
xt  2cos500t  3sin1000t  cos1500t
Solutions_Chapter2[1].nb
7
x[n]
x(t )
x[n]
ZOH
Fs
LPF
Fs
and let the sampling frequency be Fs  2000Hz.
a) Determine the continuous time signal yt after the reconstruction.
b) Notice that yt is not exactly equal xt. How could we reconstruct the signal xt exactly
from its samples xn?
Solution
a) Recall the formula, in absence of aliasing,
F
YF  ejFFs sinc 
Fs XF
with Fs  2000Hz being the sampling frequency. In this case there is no aliasing, since the maximum frequency is 750Hz smaller than Fs  2  1000Hz. Therefore, each sinusoid at frequency F
has magnitude and phase scaled by the above expression. Define
F
 sin 
2000
e 

2000
GF  


F

2000
jF
which yields
G250  0.9745ej0.392,
G500  0.9003ej0.785, G750  0.784ej1.178
Finally, apply to each sinusoid to obtain.
yt  2  0.9745  cos500t  0.392  3  0.9003  sin1000t  0.785 
0.784cos1500t  1.178
b) In order to compensate for the distortion we can design a filter with frequency response 1  GF,
Fs
Fs
when 
2   F  
2 .The magnitude would be as follows
8
Solutions_Chapter2[1].nb
à Problem 2.6.
Problem
In the system shown below, determine the output signal yt for each of the following input signals
xt. Assume the sampling frequency Fs  5kHz and the Low Pass Filter (LPF) to be ideal with
bandwidth Fs  2:
x[n]
x(t )
ZOH
Fs
LPF
y (t )
Fs
a) xt  ej2000t ;
b) xt  cos2000t  0.15;
c) xt  2cos5000t;
d) xt  2sin5000t;
e) xt  cos2000t  0.1  cos5500t.
Solution
Recall the frequency response, in case of no aliasing, is
pF
ÅÅÅÅ Sin ÅÅÅÅÅÅÅÅ
5000
‰- ÅÅÅÅÅÅÅÅ
ÅÅ Å 
jpF
5000
GF = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
pÅÅÅÅÅÅÅÅ
F ÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅ
5000
with 2500  F  2500. Then:
a) G1000  0.935ej0.628 and then yt  0.935ej2000t0.628
b) Using the same number for 1000Hz we obtain
yt  0.935  cos2000 t  0.15   0.628
c) G2500  0.637ej1.5708 , therefore yt  2  0.637cos5000t  1.5708
d) same: yt  2  0.637sin5000t  1.5708
Solutions_Chapter2[1].nb
9
e) the term cos2 2750 t has aliasing, since it has a frequency above 2500Hz. From the
figure, the aliased frequency is
X (F )






X ( F  Fs )  2.75
2.75
X ( F  Fs )
F (kHz )
 2.75  5  2.25
Faliased  5.00  2.75  2.25kHz. Therefore it is as if the input signal were
xt  cos2000t  0.1  cos4500t. This yields G1000  0.935ej0.628
and G2250  0.699ej0.393 , and finally
yt  0.935cos2000t  0.1  0.628  0.699cos4500t  1.41372
à Problem 2.7.
Problem
Suppose in the DAC we want to use a linear interpolation between samples, as shown in the figure
below. We can call this reconstructor a First Order Hold, since the equation of a line is a polynomial
of degree one.
y[n]
y[n]
y (t )
y (t )
FOH
Fs
n
Ts
a) Show that yt   xngt  nTs , with gt a triangular pulse as shown below;

n
10
Solutions_Chapter2[1].nb
g (t )
 Ts
1
Ts
t
b) Determine an expression for YF  FTyt in terms of Y  DTFTyn and
GF  FTgt;
c) In the figure below, let yn  2cos0.8n , the sampling frequency Fs  10kHz and the
filter be ideal with bandwidth Fs  2. Determine the output signal yt.
y[n]
FOH
LPF
y (t )
Fs
Solution
a) From the interpolation yt   xngt  nTs  and the definition of the interpolating

n
function gt we can see that yt is a sequence of straight lines. In particular if we look at any
interval nTs  t  n  1Ts it is easy to see that only two terms in the summation are nonzero, as
yt  xngt  nTs   xn  1gt  n  1Ts , for nTs  t  n  1Ts
This is shown in the figure below. Since g Ts   0 we can see that the line has to go through the
two points xn and xn  1, and it yields the desired linear interpolation.
Solutions_Chapter2[1].nb
11
y (t )
x[n]g (t  nTs )
x[ n  1]g (t  ( n  1)Ts )


nTs (n  1)Ts
t
Interpolation by First Order Hold (FOH)
b) Taking the Fourier Transform we obtain

YF  FTyt   xnGFej2FnTs
 GFX 2FFs
n
where GF  FTgt. Using the Fourier Transform tables, or the fact that (easy to verify)
1
t
t
gt  
Ts rect 
Ts   rect 
Ts 
F
t
F
we determine GF  Ts sinc 
Fs  , since FTrect 
Ts   Ts sinc 
Fs .
2
à Problem 2.8.
Problem
In the system below, let the sampling frequency be Fs  10kHz and the digital filter have difference
equation
yn  0.25xn  xn  1  xn  2  xn  3
Both analog filters (Antialiasing and Reconstruction) are ideal Low Pass Filters (LPF) with bandwidth
Fs  2.
ADC
x (t )
H ( z)
LPF
anti-aliasing
filter
y[ n ]
x[ n]
Ts
Ts
clock
y(
DAC
ZOH
Ts
LPF
reconstruction
filter
12
Solutions_Chapter2[1].nb
a) Sketch the frequency response H of the digital filter (magnitude only);
b) Sketch the overall frequency response YF  XF of the filter, in the analog domain (again
magnitude only);
c) Let the input signal be
xt  3cos6000t  0.1  2cos12000t
Determine the output signal yt.
Solution.
1z  , where
a) The transfer function of the filter is Hz  0.251  z1  z2  z3   0.25 
1z1
we applied the geometric sum. Therefore the frequency response is
4
sin2
1e
H  Hz zej  0.25 
  0.25 ej1.5  

 
1ej
sin


j4
2
whose magnitude is shown below.
b) Recall that the overall frequency response is given by
YF
F
jFFs sinc 

XF  H 2FFs e
Fs 
In our case Fs  10kHz, and therefore we obtain
YF
  
XF
1.4
1.2
1
0.8
0.6
0.4
0.2
4000 2000
F
2000
4000
Solutions_Chapter2[1].nb
13
c) The input signal has two frequencies: F1  3kHz  Fs  2, and F2  6kHz  Fs  2, with
Fs  10kHz the sampling frequency. Therefore the antialising filter is going to stop the second
frequency, and the overall output is going to be
yt  3  0.156 cos6000  t  0.1  0.1  
 0.467745 cos6000  t  0.62832
since, at F  3kHz, YF  XF  0.156ej0.1 .
Quantization Errors
à Problem 2.9
Problem
In the system below, let the signal xn be affected by some random error en as shown. The
error is white, zero mean, with variance e2  1.0. Determine the variance of the error n after the
filter for each of the following filters Hz:
e[n]
y[n]
x[n]
H (z )

e[n]
H (z )
x[n]
H (z )
 [n]
y[n]
14
Solutions_Chapter2[1].nb
a) Hz an ideal Low Pass Filter with bandwidth   4;
z
b) Hz  
 ;
z0.5
1 sn  sn  1  sn  2  sn  3, with sn  xn  en;
c) yn  
4
d) H  e , for     .
Solution.
Recall the two relationships in the frequency and time domain:



 1 





2
2 d




2  


H

 2  
 e





 


    hn 2  e2

 1 

a) 2  
 
2  






 1 4 





1

2  
2
2 d
 2



H



 e 
 
2   d e  
4 e ;






4




b) the impulse response in this case is hn  0.5n un therefore
1
4
2
2     hn 2  e2    0.52n  e2  
 e2  
10.25
3 e



0
1
c) in this case n  
4 en  en  1  en  2  en  3 . Therefore the impulse
response is
1
hn  
4 n  n  1  n  2  n  3
and therefore
1
1
1
2
2
2
2     
42 e  4  
16 e  
4 e
3
 1  w 
2
2
 

d) 2  
d

e  0.3045 e
2   e



n0
à Problem 2.10.
Problem
A continuous time signal xt has a bandwidth FB  10kHz and it is sampled at Fs  22kHz,
using 8bits/sample. The signal is properly scaled so that  xn   128 for all n.
a) Determine your best estimate of the variance of the quantization error e2 ;
b) We want to increase the sampling rate by 16 times. How many bits per samples you would use in
order to maintain the same level of quantization error?
Solutions_Chapter2[1].nb
Solution
a) Since the signal is such that 128  xn  128 it has a range VMAX  256. If we digitize it with
Q1  8 bits. we have 28  256 levels of quantization. Therefore each level has a range
  VMAX  2Q1  256  256  1. Therefore the variance of the noise is e2  1  12 if we assume
uniform distribution.
b) If we increase the sampling rate as Fs2  16  Fs1 , the number of bits required for the same
quantization error becomes
Fs1
1 log  
1 4  6 bits  sample
Q2  Q1  
2 Fs2  8  
2
2
15
Download