0% found this document useful (0 votes)
25 views59 pages

SP Slides 3

Uploaded by

tquan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views59 pages

SP Slides 3

Uploaded by

tquan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

Ideal Sampling of Continuous-Time Signals

Periodic Sampling
Continous-time signals are usually sampled periodically every T seconds:

x[n] = xc (nT ) 1<n<1

1
Since T is the sampling period, its reciprocal Fs = T (samples/sec) is the sampling
frequency, or in radians per second: ⌦s = 2⇡T .
Sampling With a Periodic Impulse Train
1
X 1
X
xs (t) = xc (t) (t nT ) = xc (nT ) (t nT )
n= 1 n= 1
Frequency-Domain Perspective of Sampling
The impulse train that we used in the model of the sampling process,
1
X
s(t) = (t nT )
n= 1

has a Fourier transform


1
2⇡ X
S(j⌦) = (⌦ k⌦s )
T
k= 1
Frequency-Domain Perspective of Sampling (Continued)

The continuous-time signal, xc (t), has a Fourier-transform represented by this


arbitrary spectrum:

Notice this spectrum is bandlimited:

Xc (j⌦) = 0 for |⌦| ⌦N


Frequency-Domain Perspective of Sampling (Continued)
In the sampling process, we multiply the impulse train, s(t), the continuous-time
signal, xc (t), which is equivalent to convolving their spectra:
1
Xs (j⌦) = Xc (j⌦) ⇤ S(j⌦)
2⇡

Spectrum of sampled signal:


1
1 X
Xs (j⌦) = Xc (j (⌦ k⌦S ))
T
k= 1
Sampling Rate to Avoid Aliasing Distortion
⌦s ⌦N ⌦N , or ⌦s 2⌦N , Fourier transform of sampled signal:

⌦s < 2⌦N , causes aliasing:


Nyquist-Shannon Sampling Theorem

Let xc (t) be a bandlimited signal with

Xc (j⌦) = 0 for |⌦| ⌦N .

Then xc (t) is uniquely determined by its samples x[n] = xc (nT ), n = 0, ±1, ±2, ...,
if
2⇡
⌦s = 2⌦N .
T
⌦N is the Nyquist frequency.
2⌦N is the Nyquist rate.
Relationship Between Continuous-Time and Discrete-Time
Frequency Variables with Periodic Sampling
Discrete-Time Sinusoidal Signals

x[n] = A cos (!n + ✓) = A cos (2⇡f n + ✓) where n is an integer

I A discrete-time sinusoid is periodic only if its frequency f is a rational number:


f = Nk , where k and N are integers (common factors cancelled, N is period)
I Discrete-time sinusoids whose frequencies are separated by an integer multiples
of 2⇡ are identical: cos [(! + 2⇡) n + ✓] = cos (!n + 2⇡n + ✓) = cos (!n + ✓).
I The highest rate of oscillation in a discrete-time sinusoid is when frequency
w = ±⇡ (or f = ±1/2); fundamental range: ⇡  !  ⇡ ( 12  f  12 )
Relative or Normalized Frequency
Periodic sampling creates relationship between time variables t and n:
n
t = nT =
Fs
This leads to a relationship between the continuous-time frequency F (or ⌦) and
the discrete-time frequency f (or !), assuming the signal is sampled at Fs = 1/T
samples per second.

xc (t) = A cos (2⇡F t + ✓)


✓ ◆
2⇡nF
x[n] = xc (nT ) = A cos (2⇡F nT + ✓) = A cos +✓
Fs

F
f= or, ! = ⌦T
Fs
Example: Sampled Sinusoidal Signal
If we sample xc (t) = cos(4000⇡t) with a sampling period of T = 1/6000 we obtain:
2⇡
x[n] = xc (nT ) = cos (4000⇡T n) = cos 3 n

The sample rate is ⌦s = 2⇡/T = 12000⇡ rad/sec which is more than twice the
frequency of the original signal so there is no aliasing.

The DTFT is a function


of the normalized
frequency: ! = ⌦T
Example: Sampling Two Analog Signals

Determine the discrete-time signals from sampling analog signals at fs = 40 Hz:

x1 (t) = cos (2⇡10t)


x2 (t) = cos (2⇡50t)
n n
replace t = nT = fs = 40 :

x1 [n] = cos 2⇡ 10
40 n = cos

2n
x2 [n] = cos 2⇡ 50
40 n = cos
5⇡
2 n

5⇡ 5⇡ ⇡
However, cos 2 n = cos cos 2 n 2⇡n = cos 2n so x2 [n] = x1 [n].

50 Hz is an alias of 10 Hz when the sampling frequency is 40 Hz


Reconstruction of a Signal From Its Samples
Recovery of Signal From Its Samples: Frequency Domain
Recovery of Signal From Its Samples: Time Domain

Sampled signal represented by impulse train of successive values:


1
X
xs (t) = x[n] (t nT )
n=1
Reconstructed signal is output of ideal lowpass filter, with impulse response, hr (t):
1
X
xr (t) = xs (t) ⇤ hr (t) = ... = x[n]hr (t nT )
n=1
Impulse Responses of Ideal Reconstruction Filter
Cuto↵ frequency:

⌦c = ⌦s /2 = ⇡/T

Impulse response:

sin(⇡t/T )
hr (t) =
⇡t/T
= sinc(t/T )

Using normalized sinc function:

sin(⇡x)
sinc(x) =
⇡x
Reconstruction of the Original Signal

Output of reconstruction filter:


1
X
xr (t) = x[n]hr (t nT )
n=1

where impulse response is

hr (t) = sinc(t/T )

Output:
1
X
xr (t) = x[n] sinc ((t nT )/T )
n=1
Discrete-Time Processing of Continuous-Time Signals
Summary of Mathematical Representations

x[n] = xc (nT )
1
1 X ⇥ ⇤
X(ej! ) = Xc j !
T
2⇡k
T
T
k= 1
1
X
yr (t) = y[n] sinc [(t nT )/T ]
n= 1
(
j⌦T T Y (ej⌦T ), |⌦| < ⇡/T
Yr (j⌦) = Hr (j⌦)Y (e )=
0, otherwise
Overall Frequency Response

For the LTI discrete-time system:

Y (ej! ) = H(ej! )X(ej! )

The Fourier-transform of the output of entire system is:

Yr (j⌦) = He↵ (j⌦)Xc (j⌦)

where (
H(ej⌦T ), |⌦| < ⇡/T
He↵ (j⌦) =
0, |⌦| ⇡/T
Example: Ideal Lowpass Filter
( (
j! 1, |!| < !c 1, |⌦T | < !c or |⌦| < !c /T
H(e ) = He↵ (j⌦) =
0, !c < |!|  ⇡ 0, |⌦T | !c or |⌦| !c /T
Example: Ideal Lowpass Filter (Continued)
Impulse Invariance for Implementing Continuous-Time
System in Discrete-Time
Impulse Invariance (Given a Desired Continuous-Time System)

Desired: hc (t), Hc (j⌦)


Choose:

H(ej! ) = Hc (j!/T ), |!| < ⇡

Select T such that:

Hc (j⌦) = 0, |⌦| ⇡/T

Then the impulse-invariant


version of hc (t) is:

h[n] = T hc (nT )
Example: Lowpass Filter Using Impulse Invariance
Use the impulse invariance technique to find an ideal lowpass discrete-time filter
with cuto↵ frequency !c < ⇡, given this continuous-time ideal lowpass filter:
(
1, |⌦| < ⌦c
Hc (j⌦) = where ⌦c = !c /T < ⇡/T
0, |⌦| ⌦c

The inverse Fourier transform is the impulse response of this system:


✓ ◆
sin (⌦c t) ⌦c ⌦c t
hc (t) = = sinc
⇡t ⇡ ⇡
Finding the impulse-invariant system h[n] = T hc (nT ):
(
sin (⌦c nT ) sin (!c n) 1, |!| < !c
h[n] = T hc (nT ) = T = ! H(ej! ) =
⇡nT ⇡n 0, !c  |!|  ⇡
Example: Rational System Function Using Impulse Invariance
Use the impulse invariance technique to find discrete-time system to implement:

hc (t) = Aes0 t u(t)

Applying the impulse invariance method: h[n] = T hc (nT ) = AT es0 T n u[n]

Finding z-transform:
AT
H(z) = 1 |z| > |es0 T |
1 e s0 T z
Gives frequency response, assuming Re(s0 ) < 0:

AT A
H(ej! ) = 6= Hc (j T! ) =
1 e s0 T e j! j T! s0

(original continuous-time system did not have bandlimited frequency response)


Sample Rate Conversion: Downsampling
Sample Rate Reduction: Downsampling

xd [n] = x[nM ] = xc (nM T )

I Reduce sample rate by integer factor M


I Same as sampling xc (t) if Td = M T ,
I Assume Xc (j⌦) = 0 for |⌦| ⌦N
I Using mapping ⌦ = !/T : No aliasing if ⇡/Td = ⇡/(M T ) ⌦N
I Can reduce sampling rate by factor of M without aliasing if original sample
rate is at least M times Nyquist rate (or bandwidth reduced by factor of M )
Downsampling: Frequency Domain Perspective
DTFT of x[n], the original sampled signal:
1
1 X ⇥ ⇤
X(ej! ) = Xc j !
T
2⇡k
T
T
k= 1

DTFT of xd [n] = x[nM ], in terms of Xc (j⌦):


1
1 X ⇥ ⇤
Xd (ej! ) = Xc j !
MT
2⇡r
MT
M T r= 1

or DTFT of xd [n] = x[nM ], in terms of the spectrum of x[n]

1 X ⇣ j(!/M ⌘
M 1
j! 2⇡i/M )
Xd (e ) = X e
M
i=0
Example: Downsampling, M = 2, With No Aliasing

To avoid aliasing, ensure X(ej! )


is bandlimited:

X(ej! ) = 0, !N  |!|  ⇡

and 2⇡/M is above the Nyquist


rate:
2⇡/M 2!N
or
⇡/M !N
Example: Downsampling, M = 3, With Aliasing and Prefilter
Highest frequency:
!N = ⌦N T

To avoid aliasing:
!M  ⇡ or !N  ⇡/M

In this example: M !N = 3⇡/2 ⇥ ⇡

Decimation: Lowpass filtering followed


by compression
Sample Rate Conversion: Upsampling and Changing Sample
Rate by a Rational Factor
Sample Rate Reduction: Upsampling
Goal is to obtain: xi [n] = xc (nTi )

where Ti = T /L, from original sequence: x[n] = xc (nT )

( 1
x[n/L], n = 0, ±L, ±2L, .... X
xe [n] = or xe [n] = x[k] [n kL]
0, otherwise k= 1
Upsampling: A frequency Domain Perspective
After upsampling:
1
X
xe [n] = x[k] [n kL]
k= 1

Fourier transform of upsampled sequence:


1 1
!
X X
j! j!n
Xe (e ) = x[k] [n kL] e
n= 1 k= 1
X1
j!Lk
= x[k]e = X(ej!L )
k= 1

DTFT is frequency scaled version of input:

! ! !L so that !L = ⌦T and ! = ⌦(T /L) = ⌦Ti


Example: Upsampling (Interpolation)
Upsampling: Interpolation Formula
Output of expander and input to lowpass filter:
1
X
xe [n] = x[k] [n kL]
k= 1

Impulse response of lowpass filter:

sin(⇡n/L)
hi [n] = note: hi [0] = 1 and hi [n] = 0, n = 0, ±L, ±2L, ....
⇡n/L

Output of lowpass filter:


1
X sin(⇡(n kL)/L)
xi [n] = x[k]
⇡(n kL)/L
k= 1

With this ideal filter: xi [n] = x[n/L] = xc (nT /L) = xc (nTi ), n = 0, ±L, ±2L, ...
Simple and Practical Interpolation Filters
Linear Interpolation:

(
1 |n|L, |n|  L
hlin [n] =
0, otherwise

FIR Filter for interpolation, where h̃i [n] = 0 for |n| KL:

n+KL
X 1
x̃i [n] = xe [k]h̃i [n k]
k=n KL+1
Changing Sample Rate by Rational Factor

If M > L: increase in sample period (decrease sampling rate).


Multirate Signal Processing
Interchange of Lowpass Filter with Compressor

These two systems are From downsampling, output of second system:


equivalent: M 1
j! 1 X
Y (e ) = Xb (ej(!/M 2⇡i/M )
)
M
i=0
M
X1
1
= X(ej(!/M 2⇡i/M )
)H(ej(! 2⇡i)
)
M
i=0

Since H(ej(! 2⇡i) ) = H(ej! ):


M 1
1 X
Y (ej! ) = H(ej! ) X(ej(!/M 2⇡i/M )
)
M
i=0
Xb (ej! ) = H(ej!M )X(ej! )
= H(ej! )Xa (e ) j!
Interchange of Lowpass Filter with Expander

These two systems are


Spectrum at expander output (2nd system):
equivalent:
(Linear filter modified) Xb (ej! ) = X(ej!L )

Spectrum at output (1st system):

Y (ej! ) = Xa (ej!L )
= X(ej!L )H(ej!L)
= H(ej!L )Xb (ej! )

(which corresponds to output of second system)


Multistage Decimation To Reduce Computation
Two-stage decimation system with overall rate reduction M = M1 M2 :

Equivalent single-stage lowpass filter: H(z) = H1 (z)H2 (z M1 )


Single-stage required lowpass cuto↵ frequency: ⇡/(M1 M2 )
Two-stage required lowpass cuto↵ frequencies: ⇡/M1 and ⇡/M2
Multistage Interpolation To Reduce Computation
Two-stage interpolation system with overall sample rate increase L = L1 L2 :

Equivalent single-stage lowpass filter:

H(z) = H1 (z L2 )H2 (z)


Prefiltering to Avoid Aliasing
Digital Processing of Analog Signals
Anti-Aliasing Filter to Avoid Aliasing

Remember frequency scaling: ! = ⌦T


Anti-aliasing filter:
(
1, |⌦| < ⌦c  ⇡/T Since Haa (j⌦) can’t be ideally
Haa (j⌦) = bandlimited, the overall
0, |⌦| ⌦c
frequency response is:
From xa (t) to yr (t):
He↵ (j⌦) ⇡ Haa (j⌦)H(ej⌦T )
(
H(ej⌦T ), |⌦| < ⌦c
He↵ (j⌦) =
0, |⌦| ⌦c
Oversampling to Simplify Anti-Aliasing Filter

I Simple anti-aliasing filter with gradual cuto↵ at ⌦N


I Significant attenuation at M ⌦N
I Sample at rate higher than 2⌦N (sample at 2M ⌦N )
I Implement sharp antialiasing filter in discrete-time domain when
downsampling by factor of M
I Subsequent discrete-time processing completed at lower sampling rate
Spectrum of Oversampling Followed by Decimation
Analog-to-Digital Conversion
Ideal Sample-and-Hold

Analog-to-digital conversion:
Analog-to-Digital Conversion System

Quantizer maps input sample to finite set of values:

x̂[n] = Q(x[n])

Coder will label each quantization level with binary code of (B + 1)-bits.
Quantizer for A/D Conversion (8 Levels with B + 1 bits, B = 2)

Quantizer step
size:
2Xm Xm
= B+1
= B
2 2
Example: Sampling, Quantization, Coding, D/A Conversion (3-bits)
Analysis of Quantization Errors
Quantization Error

Quantization error is di↵erence between quantized sample and true sample value:

e[n] = x̂[n] x[n]

If is the step-size and the input samples stay within the full range of

( Xm /2) < x[n]  (Xm /2)

then the quantization error will be between:

/2  e[n] < /2

otherwise, then |e[n]| > /2 and samples are clipped (quantizer is overloaded)
Model of Quantizer

I e[n] is sample sequence of stationary


random process
I e[n] is uncorrelated with x[n]
I e[n] is a white noise process
I uniform distribution over the range
of quantization error
Statistical Model for Quantization Noise
Probability density function of e[n], the quantization error using (B + 1) bits:

Variance (and quantization noise power):


Z /2 2
2 1 2 2B Xm
2 Xm
e = e2 de = = since =
/2 12 12 2B

Since autocorrelation is 2
ee [m] = e [m], the power spectral density is:
2 2B X 2
m
Pee (ej! ) = 2
e = |!|  ⇡
12
Signal-to-Quantization-Noise Ratio (SNR)

SNR for (B + 1)-bit uniform quantizer is


✓ 2◆ ✓ ◆
x 12 · 22B 2
x
SN RQ = 10 log10 2
= 10 log 10
e X2
✓ ◆ m
Xm
= 6.02B + 10.8 20 log10
x

I SNR increases about 6 dB for each bit added (doubling of quantization levels)
I To prevent last term from becoming large and negative, signal amplitude
should be matched to full-scale amplitude of A/D

You might also like