Anda di halaman 1dari 14

4/1/2011

Practical Sampling

 In practice we cannot perform ideal sampling


 It is not practically possible to create a train of impulses
 Thus a non-ideal approach to sampling must be used
 We can approximate a train of impulses using a train of very thin rectangular

TLC 503
pulses:

Digital Communications x p (t ) 

  
 t  nTs 
n   
Dr Imran Shafi
ai_case@yahoo.com
Note:
 Fourier Transform of impulse train is another impulse train
 Convolution with an impulse train is a shifting operation

Natural Sampling
If we multiply x(t) by a train  Each pulse in xp(t) has width Ts and amplitude 1/Ts
of rectangular pulses xp(t),
 The top of each pulse follows the variation of the signal being
we obtain a gated waveform
sampled
that approximates the ideal
sampled waveform, known  Xs (f) is the replication of X(f) periodically every fs Hz
as natural sampling or  Xs (f) is weighted by Cn  Fourier Series Coeffiecient
gating (see Figure 2.8)  The problem with a natural sampled waveform is that the tops of the
x s (t )  x (t ) x p (t ) sample pulses are not flat
  It is not compatible with a digital system since the amplitude of each
 x (t ) 
n  
c n e j 2  nf s t sample has infinite number of possible values
 Another technique known as flat top sampling is used to alleviate
X s ( f )  [ x ( t ) x p ( t )] this problem

 
n  
c n [ x ( t ) e j 2  nf s t ]

 
n  
cn X [ f  n f s ]

1
4/1/2011

Flat-Top Sampling

 Here, the pulse is held to a constant height for the whole


sample period
 Flat top sampling is obtained by the convolution of the signal
obtained after ideal sampling with a unity amplitude
rectangular pulse, p(t)
 This technique is used to realize Sample
Sample-and-Hold
and Hold (S/H) Flat top sampling (Time Domain)
operation
x '(t )  x(t ) (t )
 In S/H, input signal is continuously sampled and then the
value is held for as long as it takes to for the A/D to acquire
its value
xs (t )  x '(t ) * p (t )
 

 p (t ) * x(t ) (t )  p(t ) *  x(t )   (t  nTs ) 
 n  

 Taking the Fourier Transform will result to

X s ( f )  [ x s ( t )]
 

 P ( f )   x ( t )   ( t  nTs ) 
 n   
 1 

 P( f )   X ( f ) *  (f  nff s )  Flat top sampling (Frequency Domain)
 T s n   
 Flat top sampling becomes identical to ideal sampling as the
1
 P( f )
Ts

n  
X ( f  nf s ) width of the pulses become shorter

where P(f) is a sinc function

2
4/1/2011

Recovering the Analog Signal


 Undersampling and Aliasing
 One way of recovering the original signal from sampled signal Xs(f)  If the waveform is undersampled (i.e. fs < 2B) then there will be
is to pass it through a Low Pass Filter (LPF) as shown below spectral overlap in the sampled signal

The signal at the output of the filter will be


different from the original signal spectrum

 If fs > 2B then we recover x(t) exactly


This is the outcome of aliasing!
 Else we run into some problems and signal
This implies that whenever the sampling condition is not met, an
is not fully recovered
irreversible overlap of the spectral replicas is produced

 This could be due to:


1. x(t) containing higher frequency than were expected
2. An error in calculating the sampling rate
Plot of Aliased Cosine (with 90 degrees phase
shift) and Its Reconstruction

3
4/1/2011

close all
clear all
fs=8000; 1
f0=1;% 1Hz
fst=4;% 4Hz 0.8

t=0:1/fs:2-1/fs; 0.6
x=sin(2*pi*f0*t); % 1 Hz sine wave
0.4
x2=sin(2*pi*(f0+fst)*t); % 5 Hz sine wave
N=length(x); % total length of signal x(1st signal) 0.2
plot(t,x);
0
hold on
plot(t,x2,'g'); -0.2
xs=x(1:fs/fst:N); % samples of 1st signal at interval of
fs/fst=2000 -0.4

tn=t(1:fs/fst:N); -0.6
stem(tn,xs,'r');
pause -0.8

xsn=x2(1:fs/fst:N); -1
stem(tn,xsn,'c'); 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

 Solution 1: Anti-Aliasing Analog Filter

 All physically realizable signals are not completely bandlimited


 If there is a significant amount of energy in frequencies above
half the sampling frequency (fs/2), aliasing will occur
 Aliasing can be prevented by first passing the analog signal
through an anti-aliasing filter (also called a prefilter) before
sampling is performed  Aliasing is prevented by forcing the bandwidth of the sampled
 Th anti-aliasing
The ti li i filtfilter iis simply
i l a LPF with
ith cutoff
t ff ffrequency signal
i l tto satisfy
ti f the
th requirement
i t off the
th Sampling
S li ThTheorem
equal to half the sample rate

4
4/1/2011

Summary Of Sampling

 Solution 2: Over Sampling and Filtering in the Digital
 Ideal Sampling x s (t )  x (t ) x (t )  x (t )   (t  nTs )
Domain n 
(or Impulse Sampling)
 The signal is passed through a low performance (less costly) 
analog low-pass filter to limit the bandwidth.  
n 
x ( nTs ) (t  nTs )
 Sample the resulting signal at a high sampling frequency.
 Natural Sampling
 The digital samples are then processed by a high 
performance digital filter and down sample the resulting
(or Gating)
x s (t )  x (t ) x p (t )  x (t )  cn e j 2 nf s t
signal.
signal n 

 Flat-Top Sampling
 

xs (t )  x '(t ) * p (t )   x(t )   (t  nTs )  * p (t )
 n  
 For all sampling techniques
 If fs > 2B then we can recover x(t) exactly

 If fs < 2B) spectral overlapping known as aliasing will occur

Example 1: Practical Sampling Rates


 Consider the analog signal x(t) given by
x(t )  3cos(50 t )  100sin(300 t )  cos(100 t )  Speech
- Telephone quality speech has a bandwidth of 4 kHz
 What is the Nyquist rate for this signal? (actually 300 to 3300Hz)
Example 2: - Most digital telephone systems are sampled at 8000
 Consider the analog signal xa(t) given by samples/sec
 Audio:
xa (t )  3cos
3 2000 t  5sin
5 i 6000 t  cos12000
12000 t - The highest frequency the human ear can hear is
 What is the Nyquist rate for this signal? approximately 15kHz
 What is the discrete time signal obtained after sampling, if - CD quality audio are sampled at rate of 44,000
fs=5000 samples/s. samples/sec
 What is the analog signal x(t) that can be reconstructed from the  Video
sampled values? - The human eye requires samples at a rate of at
least 20 frames/sec to achieve smooth motion

5
4/1/2011

2.6 Pulse Code Modulation (PCM)

 Pulse Code Modulation refers to a digital baseband signal that is


generated directly from the quantizer output
 Sometimes the term PCM is used interchangeably with quantization

See Figure 2.16 (Page 80)

Advantages of PCM:
 Relatively inexpensive

 Easily multiplexed: PCM waveforms from different


sources can be transmitted over a common digital
channel (TDM)
 Easily regenerated: useful for long-distance
communication, e.g.g telephone
 Better noise performance than analog system

 Signals may be stored and time-scaled efficiently (e.g.,


satellite communication)
 Efficient codes are readily available

Disadvantage:
 Requires wider bandwidth than analog signals

6
4/1/2011

2.5 Sources of Corruption in the sampled, Signal to Quantization Noise Ratio


quantized and transmitted pulses  The level of quantization noise is dependent on how close any
particular sample is to one of the L levels in the converter
 Sampling and Quantization Effects
 Quantization (Granularity) Noise: Results when
quantization levels are not finely spaced apart enough
to accurately approximate input signal resulting in
truncation or rounding error.
 Quantizer Saturation or Overload Noise: Results when
input signal is larger in magnitude than highest
quantization level resulting in clipping of the signal.
 Timing Jitter: Error caused by a shift in the sampler
position. Can be isolated with stable clock reference.
 Channel Effects
 For a speech input, this quantization error resembles a noise-
 Channel Noise
like disturbance at the output of a DAC converter
 Intersymbol Interference (ISI)

2.7 Uniform and Nonuniform Quantization


Signal to Quantization Noise Ratio
 A quantizer with equal quantization level is a Uniform Quantizer
 Each sample is approximated within a quantile interval  The mean-squared value (noise variance) of the quantization error is
 Uniform quantizers are optimal when the input distribution is given by:
uniform
 i.e. when all values within the range are
 2   e 2 p(e)de   e 2  1  de  1  e 2 de
q/2 q/2 q/2
equally likely
q / 2 q q
q / 2   q / 2

q/2 2
 1q e q
3

 Most ADC’s are implemented using uniform quantizers 3 q / 2 12


 Error of a uniform quantizer is bounded by  q  e  q
2 2

7
4/1/2011

If q is the step size, then the maximum quantization error that can
occur in the sampled output of an A/D converter is q
 The peak power of the analog signal (normalized to 1Ohms )can be
V
expressed as: q  pp
V 2
V p2   L2 q 2  L
P   pp  
1  2   4  where L = 2n is the number of quantization levels for the converter.
  (n is the number of bits).

 Therefore the Signal


g to Q
Quatization Noise Ratio is given
g by:
y
 Si
Since L = 2n, SNR = 22n or in
i ddecibels
ib l
2 2
S N R q  L 2q / 4  3 L 2  S 
q /12 

 10 log (2 2 n )  6 n dB
 N  dB 10

Nonuniform Quantization
 Nonuniform quantizers have unequally spaced levels
 The spacing can be chosen to optimize the Signal-to-Noise Ratio
 Many signals such as speech have a nonuniform distribution
for a particular type of signal
 It is characterized by:  See Figure on next page (Fig. 2.17)
 Variable step size Basic principle is to use more levels at regions with large probability
 Quantizer size depend on signal size
density function (pdf)
 Concentrate quantization levels in areas of largest pdf
 O use fine
Or fi quantization
ti ti (small
( ll step
t size)
i ) for
f weakk signals
i l and
d
coarse quantization (large step size) for strong signals

8
4/1/2011

Statistics of speech Signal Amplitudes Nonuniform quantization using companding


 Companding is a method of reducing the number of bits required in
ADC while achieving an equivalent dynamic range or SQNR
 In order to improve the resolution of weak signals within a converter,
and hence enhance the SQNR, the weak signals need to be
enlarged, or the quantization step size decreased, but only for the
weak signals
 But strong signals can potentially be reduced without significantly
degrading the SQNR or alternatively increasing quantization step size
 The compression process at the transmitter must be matched with an
equivalent expansion process at the receiver

Figure 2.17: Statistical distribution of single talker speech signal magnitudes


(Page 81)

 The signal below shows the effect of compression, where the  Basically, companding introduces a nonlinearity into the signal
amplitude of one of the signals is compressed
 This maps a nonuniform distribution into something that more
 After compression, input to the quantizer will have a more uniform closely resembles a uniform distribution
distribution after sampling
 A standard ADC with uniform spacing between levels can be used
after the compandor (or compander)
At the receiver, the signal is  The companding operation is inverted at the receiver
expanded by an inverse
operation
 There are in fact two standard logarithm based companding
The process of COMpressing techniques
and exPANDING the signal is
 US standard called µ-law companding
called companding
 European standard called A-law companding
 Companding is a technique
used to reduce the number of bits
required in ADC or DAC while
achieving comparable SQNR

9
4/1/2011

Input/Output Relationship of Compander Types of Companding


 -Law Companding Standard (North & South
America, and Japan)

log e 1   (| x | / xmax 
y  ymax sgn( x )
log e (1   )

where
 x and y represent the input and output voltages

  is a constant number determined by experiment


 Logarithmic expression Y = log X is the most commonly  In the U.S., telephone lines uses companding with  = 255
used compander  Samples 4 kHz speech waveform at 8,000 sample/sec
 This reduces the dynamic range of Y  Encodes each sample with 8 bits, L = 256 quantizer levels
 Hence data rate R = 64 kbit/sec
  = 0 corresponds to uniform quantization

A-Law Companding Standard (Europe, China, Russia,


Asia, Africa)
 |x|
 A
xmax | x| 1
 ymax sgn( x), 0 
 (1  A) xmax A
y ( x)  
   | x | 
 1  log e  A 
  xmax   1 |x|
 ymax sgn( x),  1
 (1  log e A) A xmax
where
 x and y represent the input and output voltages

 A = 87.6

 A is a constant number determined by experiment

10
4/1/2011

2.8 Baseband Modulation (PCM waveform types)


 Recall that analog signals can be represented by a sequence of discrete
samples (output of sampler)
 Samples are converted into bits. But bits are just abstract entities that
have no physical definition
 We use pulses to convey a bit of information, e.g.,

 In order to transmit the bits over a physical channel they must be


transformed into a physical waveform
 A line coder or baseband binary transmitter transforms a stream of bits
into a physical waveform suitable for transmission over a channel
 Line coders use the terminology mark for “1” and space to mean “0”
 In baseband systems, binary data can be transmitted using many kinds of
pulses

Goals of Line Coding (qualities to look for)


 A line code is designed to meet one or more of the following goals:
 There are many types of waveforms. Why?  performance criteria!
 Self-synchronization
 Each line code type have merits and demerits
 The ability to recover timing from the signal itself
 The choice of waveform depends on operating characteristics of a
 That is, self-clocking (self-synchronization) - ease of clock lock
system such as:
or signal recovery for symbol synchronization
 Modulation-demodulation requirements
 Long series of ones and zeros could cause a problem
 Bandwidth requirement
 Low probability of bit error
 Synchronization requirement
 Receiver needs to be able to distinguish the waveform associated
 Receiver complexity, etc.,
with a mark from the waveform associated with a space
 BER performance

 relative immunity to noise

 Error detection capability

 enhances low probability of error

11
4/1/2011

 Spectrum Suitable for the channel


Line Coder
 Spectrum matching of the channel
 The input to the line encoder is
 e.g. presence or absence of DC level
the output of the A/D converter
 In some cases DC components should be avoided or a sequence of values an that
 The transmission bandwidth should be minimized is a function of the data bit
 Power Spectral Density  The output of the line encoder
 Particularly its value at zero is a waveform:


 PSD of code should be negligible at the frequency near zero

Transmission Bandwidth
s (t )  a
n 
n f (t  nTb )
 Should be as small as possible

 Transparency where f(t) is the pulse shape and Tb is the bit period (Tb=Ts/n for n
bit quantizer)
 The property that any arbitrary symbol or bit pattern can be
transmitted and received, i.e., all possible data sequence should  This means that each line code is described by a symbol mapping
be faithfully reproducible function an and pulse shape f(t)
 Details of this operation are set by the type of line code that is
being used

Commonly Used Line Codes


Unipolar NRZ Line Code
 Polar line codes use the antipodal mapping  Unipolar non-return-to-zero (NRZ) line code is defined by
unipolar mapping
  A, w hen X n  1  A, when X n  1
an   a  Where Xn is the nth data bit
  A, w hen X n  0 n
0, when X n  0
 Polar NRZ uses NRZ pulse shape
 In addition, the pulse shape for unipolar NRZ is:
where Tb is the bit period f (t )    t  , NRZ Pulse Shape
 Polar RZ uses RZ pulse shape
 
 Tb 

12
4/1/2011

Bipolar Line Codes Manchester Line Codes


 Manchester line codes use the antipodal mapping
 With bipolar line codes a space is mapped to zero and
and the following split-phase pulse shape:
a mark is alternately mapped to -A and +A
 A, when X n  1 and last mark   A  Tb   Tb 
 t 4  t 4 
an   A, when X n  1 and last mark   A f (t )     T 
T
0, when X n  0  b   b 
  2   2 
It
is also called pseudoternary signaling or alternate mark inversion
(AMI)
Either RZ or NRZ pulse shape can be used

Summary of Line Codes Comparison of Line Codes

 Self-synchronization
 Manchester codes have built in timing information because they
always have a zero crossing in the center of the pulse
 Polar RZ codes tend to be good because the signal level always
goes to zero for the second half of the pulse
 NRZ signals are not good for self-synchronization

 Error probability
 Polar codes perform better (are more energy efficient) than
Unipolar or Bipolar codes
 Channel characteristics
 We need to find the power spectral density (PSD) of the line
codes to compare the line codes in terms of the channel
characteristics

13
4/1/2011

Comparisons of Line Codes  First Null Bandwidth


 Unipolar NRZ, polar NRZ, and bipolar all have 1st null bandwidths
 Different pulse shapes are used of Rb = 1/Tb
 to control the spectrum of the transmitted signal (no DC value,  Unipolar RZ has 1st null BW of 2Rb
bandwidth, etc.)  Manchester NRZ also has 1st null BW of 2Rb, although the
 guarantee transitions every symbol interval to assist in symbol timing spectrum becomes very low at 1.6Rb
recovery
1. Power Spectral Density of Line Codes (see Fig. 2.23, Page 90)
 After line coding, the pulses may be filtered or shaped to further
improve there properties such as
 Spectral efficiency

 Immunity to Intersymbol Interference

 Distinction between Line Coding and Pulse Shaping is not easy

2. DC Component and Bandwidth


 DC Components

 Unipolar NRZ, polar NRZ, and unipolar RZ all have DC components

 Bipolar RZ and Manchester NRZ do not have DC components

14

Anda mungkin juga menyukai