You are on page 1of 18

Downsampling,

Upsampling, and
Reconstruction
• A-to-D and its relation to sampling
• Downsampling and its relation to sampling
• Upsampling and interpolation
• D-to-A and reconstruction filtering
• Filters and their relation to convolution
Copyright © 2007 by M.H. Perrott
All rights reserved.
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 1
Digital Processing of Analog Signals
xc(t) A-to-D x[n] Downsample
Converter by N
1/T Sample/s 1/(NT) Sample/s

Digital Signal
r[n] Processing u[n]
Operations
1/(NT) Sample/s

Upsample D-to-A yc(t)


by M Converter
M/(NT) Sample/s M/(NT) Sample/s

• Digital circuits can perform very complex


processing of analog signals, but require
– Conversion of analog signals to the digital domain
– Conversion of digital signals to the analog domain
– Downsampling and upsampling to match sample rates of
A-to-D, digital processor, and D-to-A
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 2
Inclusion of Filtering Operations
xc(t) A-to-D x[n] Anti-Alias Downsample
Converter Filter by 10
Analog 1/T Sample/s 1/T Sample/s 1/(NT) Sample/s
Anti-Alias
Filter
Digital Signal
r[n] Processing u[n]
Operations
1/(NT) Sample/s

Upsample Interpolate y[n] D-to-A yc(t)


by 10 with Filter Converter
M/(NT) Sample/s M/(NT) Sample/s M/(NT) Sample/s Analog
Reconstruction
Filter

• A-to-D and downsampler require anti-alias filtering


– Prevents aliasing
• D-to-A and upsampler require interpolation (i.e.,
reconstruction) filtering
– Provides `smoothly’ changing waveforms
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 3
Summary of Sampling Process (Review)
p(t)
1

t
p(t) T

xc(t) xp(t) Impulse Train x[n]


to Sequence
xc(t) xp(t) x[n]

t t n
T 1

Xc(f) Xp(f) X(ej2πλ)


A A
A T T

f f λ
0 -2 -1 0 1 2 -2 -1 0 1 2
T T T T

• Sampling leads to periodicity in frequency domain


We need to avoid overlap of replicated
signals in frequency domain (i.e., aliasing)
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 4
The Sampling Theorem (Review)
xc(t) p(t) xp(t)
1

t t t
T T

Xc(f) P(f) Xp(f)


1 A
A T T

f f f
-fbw fbw -2 -1 0 1 2 -2 -1 0 1 2
T T T T T T T T
-fbw fbw
- 1 + fbw 1 - fbw
T T

• Overlap in frequency domain (i.e., aliasing) is


avoided if:

• We refer to the minimum 1/T that avoids aliasing


as the Nyquist sampling frequency
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 5
A-to-D Converter
xc(t) xc(t) A-to-D x[n]
Converter
Analog 1/T Sample/s
Anti-Alias
Filter

1
t
p(t) T

xc(t) xp(t) Quantize xp(t) Impulse Train x[n]


Value to Sequence
t

t n
T 1

• Operates using both a sampler and quantizer


– Sampler converts continuous-time input signal into a
discrete-time sequence
– Quantizer converts continuous-valued signal/sequence into
a discrete-valued signal/sequence
• Introduces quantization noise as discussed in Lab 4
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 6
Frequency Domain View of A-to-D
xc(t) xc(t) A-to-D x[n]
Converter
Analog 1/T Sample/s
Anti-Alias
Filter

P(f)
1/T
f
-1/T 0 1/T
Xc(f) p(t)
xc(t) xp(t) Quantize xp(t) x[n]
1 Impulse Train
Value to Sequence
f
0 Xp(f) X(ej2πλ)
1/T 1/T
f λ
-2/T -1/T 0 1/T 2/T -2 -1 0 1 2

• Analysis of A-to-D same as for sampler


– For simplicity, we will ignore the influence of quantization
noise in our picture analysis
• In lab 4, we will explore the influence of quantization noise
using Matlab
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 7
Downsampling
Anti-Alias x[n] Downsample r[n]
Filter by N

N p[n]

x[n] xs[n] Remove r[n]


Zero Samples
n
1
n n
N 1

• Similar to sampling, but operates on sequences


• Analysis is simplified by breaking into two steps
– Multiply input by impulse sequence of period N samples
– Remove all samples of xs[n] associated with the zero-
valued samples of the impulse sequence, p[n]
• Amounts to scaling of time axis by factor 1/N
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 8
Frequency Domain View of Downsampling
Anti-Alias x[n] Downsample r[n]
Filter by N

P(ej2πλ)
1/N
λ
-1 -2/N -1/N 0 1/N 2/N 1
p[n]
X(e j2πλ ) r[n]
x[n] xs(t) Remove
1
Zero Samples
λ
-1 0 1
Xs(ej2πλ) R(ej2πλ)
1/N 1/N
λ λ
-1 -2/N -1/N 0 1/N 2/N 1 -1 0 1

• Multiplication by impulse sequence leads to replicas


of input transform every 1/N Hz in frequency
• Removal of zero samples (i.e., scaling of time axis)
leads to scaling of frequency axis by factor N
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 9
The Need for Anti-Alias Filtering
Anti-Alias x[n] Downsample r[n]
Filter by N

P(ej2πλ)
1/N
Undesired
λ
Signal or -1 -2/N -1/N 0 1/N 2/N 1
Noise p[n]
X(e j2πλ ) r[n]
x[n] xs(t) Remove
1
Zero Samples
λ
-1 0 1
Xs(ej2πλ) R(ej2πλ)
1/N 1/N
λ λ
-1 -2/N -1/N 0 1/N 2/N 1 -1 0 1

• Removal of anti-alias filter would allow undesired


signals or noise to alias into desired signal band
What is the appropriate bandwidth of the
anti-alias lowpass filter?
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 10
Upsampler
u[n] up[n] y[n]
Upsample Interpolate
by N with Filter

u[n] up[n] Interpolate y[n]


Add
n Zero Samples with Filter
1
n n
1 N 1 N

• Consists of two operations


– Add N-1 zero samples between every sample of the input
• Effectively scales time axis by factor N
– Filter the resulting sequence, up[n], in order to create a
smoothly varying set of sequence samples
• Proper choice of the filter leads to interpolation between
the non-zero samples of sequence up[n] (discussed in Lab 5)
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 11
Frequency Domain View of Upsampling
u[n] up[n] y[n]
Upsample Interpolate
by N with Filter

u[n] up[n] Interpolate y[n]


Add
Zero Samples with Filter
U(ej2πλ) Y(ej2πλ)
1/N 1
λ λ
-1 0 1 -1 0 1
Up(ej2πλ)
1/N
λ
-1 -2/N -1/N 0 1/N 2/N 1

• Addition of zero samples (scaling of time axis)


leads to scaling of frequency axis by factor 1/N
• Interpolation filter removes all replicas of the
signal transform except for the baseband copy
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 12
D-to-A Converter
y[n] D-to-A yc(t) yc(t)
Converter
n
1/T Sample/s Analog
1 Reconstruction
Filter

n t
1 T
y[n] yc(t)
Sequence to
Impulse Train

• Simple analytical model includes two operations


– Convert input sequence samples into corresponding impulse
train
– Filter impulse train to create a smoothly varying signal
• Proper choice of the reconstruction filter leads to
interpolation between impulse train values
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 13
Frequency Domain View of D-to-A
Y(ej2πλ) y[n] yc(t) yc(t) Yc(f)
1/T D-to-A 1
Converter
λ f
-2 -1 0 1 2 1/T Sample/s Analog 0
Reconstruction
Filter

Y(ej2πλ) Y(f)
1/T 1/T
λ f
-2 -1 0 1 2 y[n] yc(t) -2/T -1/T 0 1/T 2/T
Sequence to
Impulse Train

• Conversion from sequence to impulse train amounts


to scaling the frequency axis by sample rate of D-
to-A (1/T)
• Reconstruction filter removes all replicas of the
signal transform except for the baseband copy
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 14
A Common Reconstruction Filter
y[n] D-to-A yc(t) yc(t)
Hzoh(f)
Converter
n t
1/T Sample/s Zero-Order
1 Hold T

n t
1 T
y[n] yc(t)
Sequence to
Impulse Train

• Zero-order hold circuit operates by maintaining


the impulse value across the D-to-A sample period
– Easy to implement in hardware

How do we analyze this?


M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 15
Filtering is Convolution in Time
yc(t) yc(t)
Hzoh(f)
t t
T Zero-Order
Hold T
hzoh(t)

t
T

yc(t) hzoh(t) yc(t)

t t t
T T T

• Recall that multiplication in frequency corresponds


to convolution in time

• Filtering corresponds to convolution in time


between the input and the filter impulse response
M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 16
Frequency Domain View of Filtering
yc(t) yc(t)
Hzoh(f)
t t
T Zero-Order
Hold T
hzoh(t)

t
T

yc(t) hzoh(t) yc(t)

t t t
T T T

Yc(f) Hzoh(f) Yc(f)

-2 2
T T
f f f
-2 -1 0 1 2 0 -2 -1 0 1 2
T T T T -1 1 T T T T
T T

• Zero-order hold is not a great filter, but it’s simple…


M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 17
Summary
• A-to-D converters convert continuous-time signals
into sequences with discrete sample values
– Operates with the use of sampling and quantization
• D-to-A converters convert sequences with discrete
sample values into continuous-time signals
– Analyzed as conversion to impulse train followed by
reconstruction filtering
• Zero-order hold is a simple but low performance filter
• Upsampling and downsampling allow for changes in
the effective sample rate of sequences
– Allows matching of sample rates of A-to-D, D-to-A, and
digital processor
– Analysis: downsampler/upsampler similar to A-to-D/D-to-A

• Up next: digital modulation


M.H. Perrott©2007 Downsampling, Upsampling, and Reconstruction, Slide 18

You might also like