Overview of Sampling Topics (Shannon) sampling theorem - - PowerPoint PPT Presentation

overview of sampling topics shannon sampling theorem
SMART_READER_LITE
LIVE PREVIEW

Overview of Sampling Topics (Shannon) sampling theorem - - PowerPoint PPT Presentation

Overview of Sampling Topics (Shannon) sampling theorem Impulse-train sampling Interpolation (continuous-time signal reconstruction) Aliasing Relationship of CTFT to DTFT DT processing of CT signals DT sampling


slide-1
SLIDE 1

Overview of Sampling Topics

  • (Shannon) sampling theorem
  • Impulse-train sampling
  • Interpolation (continuous-time signal reconstruction)
  • Aliasing
  • Relationship of CTFT to DTFT
  • DT processing of CT signals
  • DT sampling
  • Decimation & interpolation
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

1

slide-2
SLIDE 2

Amplitude versus Time

  • In this class we are working only with continuous-valued signals
  • Signals with discrete values that have been quantized are called

digital signals

  • Analog-to-Digital converters (ADC) convert continuous-valued

signals to discrete-valued signals. These often also convert from CT to DT.

  • Digital-to-analog converters (DAC) convert discrete-valued

signals to continuous-valued signals. These often also convert from DT to CT.

  • Signals that are both continuous-valued and continuous-time are

usually called analog signals

  • Signals that are both discrete-valued and discrete-time are usually

called digital

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

2

slide-3
SLIDE 3

Overview of DT Processing of CT Signals H(z)

x[n] y[n] x(t) y(t) Ts Ts CT ⇒ DT DT ⇒ CT

  • Many systems (1) sample a signal, (2) process it in discrete-time,

and (3) convert it back to a continuous-time signal

  • Called discrete-time processing of continuous-time signals
  • Most modern digital signal processing (DSP) uses this architecture
  • The first step is called sampling
  • The last step is called interpolation
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

3

slide-4
SLIDE 4

Signals x(t) → x[n] → xi(t) X(jω) → X(ejω) → Xi(jω)

  • For now, just consider the two conversions

– Sampling (CT → DT) – Interpolation (DT → CT)

  • Suppose we want xi(t) to be as close to x(t) as possible
  • Need to consider relationships in both time- and

frequency-domains

  • Three signals, three transforms
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

4

slide-5
SLIDE 5

Guiding Questions and Objectives x[n] = x(t)|t=nTs

  • The operation of sampling (CT → DT conversion) is trivial
  • The challenge is to understand the limits and tradeoffs
  • The remainder of these slides is dedicated to answering the

following three questions

  • 1. How is the CTFT of x(t), X(jω) related to the DTFT of

x[n] = x(nTs), X(ejΩ)?

  • 2. Under what conditions can we synthesize x(t) from x[n]:

x[n] → x(t)?

  • 3. How do we perform this DT → CT conversion?
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

5

slide-6
SLIDE 6

Need for a Bridge Signal Consider three signals Type Time Domain Frequency Domain Original Signal CT x(t) X(jω) Sampled Signal DT x[n] X(ejΩ) Bridge Signal CT xδ(t) Xδ(jω)

  • Goals: to determine the relationship of x(t) to x[n] = x(nTs) in

the time and frequency domains

  • In the time domain, the relationship x[n] = x(nTs) is clear
  • But what is the relationship of X(jω) to X(ejΩ)?
  • The transforms differ in character

– X(ejΩ) is periodic – X(ejΩ) has units of radians per sample

  • A bridge signal xδ(t) is the only way (that I know of) to determine

how X(jω) is related to X(ejΩ)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

6

slide-7
SLIDE 7

Use of the Bridge Signal

  • Define the bridge signal by relating Xδ(jω) to X(ejΩ)
  • Determine how x(t) is related to xδ(t) in the time domain
  • Determine how X(jω) is related to Xδ(jω)
  • Use the relationships of X(ejΩ) and X(jω) to Xδ(jω) to

determine their relationship to one another

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

7

slide-8
SLIDE 8

Defining the Bridge Signal

  • The bridge signal xδ(t) is a CT representation of a DT signal x[n]
  • It is defined as having the same transform, within a scale factor,

as the DT signal

  • Suppose x[n] = Aej(Ωn+φ)
  • What is the CT equivalent?
  • Let us pick x(t) = Aej(ωt+φ)
  • How do we relate the DT frequency Ω to the CT frequency ω?

– ω has units of radians/second – Ω has units of radians/sample

  • Let us use the conversion factor of Ts = f −1

s

seconds/sample Ω (radians/sample) = ω (radians/second) × Ts (seconds/sample) ω (radians/second) = Ω (radians/sample) × fs (samples/second)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

8

slide-9
SLIDE 9

Defining the Bridge Signal Xδ(jω) = X(ejΩ)

  • Ω=ωTs = X(ejωTs)
  • The bridge signal is a CT representation of a DT signal
  • We define it by equating the CTFT and DTFT with an

appropriate scaling factor for frequency

  • Note that this is a highly unusual CT signal

– The CTFT is periodic – What does this tell us about xδ(t)?

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

9

slide-10
SLIDE 10

Solving for the Bridge Signal X(ejΩ) =

  • n=−∞

x[n] e−jΩn Xδ(jω) = X(ejΩ)

  • Ω=ωTs =

  • n=−∞

x[n] e−jωTsn xδ(t)

FT

⇐ ⇒ Xδ(jω) δ(t − to)

FT

⇐ ⇒ e−jωto δ(t − Tsn)

FT

⇐ ⇒ e−jωTsn

  • n=−∞

x[n] δ(t − Tsn)

FT

⇐ ⇒

  • n=−∞

x[n] e−jωTsn xδ(t) =

  • n=−∞

x[n] δ(t − Tsn)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

10

slide-11
SLIDE 11

Why Isn’t the Inverse Transform Similar to x(t)? DTFT x[n] = 1 2π

X(ejω) ejΩn dΩ CTFT x(t) = 1 2π +∞

−∞

X(jω) ejωt dω

  • We generated xδ(t) from x[n] by equating a CTFT to the DTFT
  • f x[n]
  • This seems reasonable at first
  • But consider the range of the CTFT and DTFT synthesis

equations

  • The DTFT synthesizes x[n] out of a finite range of frequencies
  • The CTFT synthesizes x(t) out of all frequencies
  • This is why, if x[n] = x(nTs), that

xδ(t) = F−1 {Xδ(jω)} = F−1 X(ejωTs)

  • = x(t)
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

11

slide-12
SLIDE 12

Impulse Sampling

Ts 2Ts 3Ts 4Ts 5Ts

  • Ts
  • 2Ts
  • 3Ts
  • 4Ts

p(t)

1

p(t) =

  • n=−∞

δ(t − nTs) xδ(t) =

  • n=−∞

x(nTs) δ(t − Tsn) = x(t) p(t)

  • xδ(t) can also be formed from a CT signal
  • This is called impulse sampling
  • We can model sampling by use of the periodic impulse train
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

12

slide-13
SLIDE 13

Rectangular Window and Impulse Train Notation

Ts 2Ts 3Ts 4Ts 5Ts

  • Ts
  • 2Ts
  • 3Ts
  • 4Ts

p(t)

1

  • Note that a similar symbol was used for rectangular windows

pT (t) =

  • 1

|t| < T Otherwise but p(t) = pT (t)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

13

slide-14
SLIDE 14

Impulse Sampling Conceptual Example

Ts 2Ts 3Ts 4Ts 5Ts

  • Ts
  • 2Ts
  • 3Ts
  • 4Ts

1 Ts 2Ts 3Ts 4Ts 5Ts

  • Ts
  • 2Ts
  • 3Ts
  • 4Ts

1 Ts 2Ts 3Ts 4Ts 5Ts

  • Ts
  • 2Ts
  • 3Ts
  • 4Ts

1

x(t) p(t) x(t)p(t)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

14

slide-15
SLIDE 15

Impulse Sampling Terminology H(z)

x[n] y[n] x(t) y(t) Ts Ts CT ⇒ DT DT ⇒ CT

xδ(t) = x(t) p(t) =

  • n=−∞

x(nTs)δ(t − nTs)

  • The impulse train p(t) is called the sampling function
  • p(t) is periodic with fundamental period Ts
  • Ts, the fundamental period of p(t), is called the sampling period
  • fs ≡

1 Ts and ωs = 2π Ts are called the sampling frequency

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

15

slide-16
SLIDE 16

Fourier Transforms of Periodic Signals Overview xδ(t) =

  • n=−∞

x(nTs) δ(t − Tsn) = x(t) p(t) Xδ(jω) = 1 2π X(jω) ∗ P(jω)

  • To determine how Xδ(jω) is related to X(jω), we need to

calculate P(jω)

  • p(t) is a periodic function with infinite energy
  • The CTFT clearly doesn’t converge
  • Is easier to

– Calculate the Fourier series coefficients P[k] for p(t) – Solve for P(jω) from P[k] using the general relationship between the CTFS and the CTFT

  • Since periodic signals have infinite energy, the CTFT of these

signals consists of impulses

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

16

slide-17
SLIDE 17

Fourier Transforms of Periodic Signals Recall the Fourier series representations of periodic signals x(t) =

  • k=−∞

X[k] ejkωt ejωot

FT

⇐ ⇒ 2π δ(ω − ωo) x(t) =

  • k=−∞

X[k] ejkωot

FT

⇐ ⇒ 2π

  • k=−∞

X[k] δ(ω − kωo)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

17

slide-18
SLIDE 18

Example 1: CT Fourier Transform of an Impulse Train Solve for the Fourier transform of the impulse train p(t) =

  • n=−∞

δ(t − nTs) Hint: the impulse train is periodic. X[k] = 1 T

  • T

x(t)e−jkωot dt X(jω) = +∞

−∞

x(t) e−jωt dt

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

18

slide-19
SLIDE 19

Example 1: Workspace

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

19

slide-20
SLIDE 20

The Relationship of X(jω) to Xδ(jω) x(t) p(t)

FT

⇐ ⇒ 1 2π X(jω) ∗ P(jω) P(jω)

FT

⇐ ⇒ 2π Ts

  • k=−∞

δ

  • ω − k 2π

Ts

  • ωs

Ts x(t) p(t)

FT

⇐ ⇒ 1 2π X(jω) ∗ 2π Ts

  • k=−∞

δ(ω − kωs) X(jω) ∗ δ(ω − ωo) = X (j(ω − ωo)) x(t) p(t)

FT

⇐ ⇒ 1 Ts

  • k=−∞

X (j(ω − kωs))

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

20

slide-21
SLIDE 21

Summary Sampling: x[n] = x(nTs) Definition: Xδ(jω) = X(ejω)

  • Ω=ωTs

Inverse CTFT: xδ(t) =

  • n=−∞

x[n]δ(t − nTs) Impulse Sampling: xδ(t) =

  • n=−∞

x(nTs)δ(t − nTs) CTFT: P(jω) = 2π Ts

  • k=−∞

δ (t − kωs) Multiplication Property: Xδ(jω) = 1 2π X(jω) ∗ P(jω) = 1 Ts

  • k=−∞

X (j(ω − kωs))

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

21

slide-22
SLIDE 22

Conceptual Diagram of the Relationship

1

2π Ts 1 Ts 1 Ts

  • ωs-ωx
  • ωs+ωx

ωs-ωx ωs+ωx ωx ωx ωx

  • ωx
  • ωx
  • ωx

ωs ωs ωs

  • ωs
  • ωs
  • ωs
  • Ωs-Ωx
  • Ωs+Ωx

Ωs-Ωx Ωs+Ωx Ωx

  • Ωx

Ωs

  • Ωs

X(jω) P (jω) Xδ(jω) X(ejω)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

22

slide-23
SLIDE 23

Observations x(t) p(t)

FT

⇐ ⇒ 1 Ts

  • k=−∞

X (j(ω − kωs)) X(ejωTs) = 1 Ts

  • k=−∞

X (j(ω − kωs))

  • What is Ωs?

Ωs = ωsTs = 2π Ts Ts = 2π

  • Thus ωs in CT corresponds to 2π radians/sample in DT
  • Recall that the fastest DT signal is ejπn = (−1)n and oscillates at

π radians/sample

  • This is the fastest signal we can observe due to ejΩn = ej(Ω±ℓ2π)n
  • What is this frequency in the CT domain?
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

23

slide-24
SLIDE 24

Expressing DT Transform in Terms of CT Transform X(ejωTs) = 1 Ts

  • k=−∞

X (j(ω − kωs)) Ω = ωTs ω = Ω Ts X(ejΩ) = 1 Ts

  • k=−∞

X

  • j( Ω

Ts − kωs)

  • ωs = Ωs

Ts = 2π Ts X(ejΩ) = 1 Ts

  • k=−∞

X

  • j

Ω − k2π Ts

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

24

slide-25
SLIDE 25

What Does this Mean? x(t) p(t)

FT

⇐ ⇒ 1 Ts

  • k=−∞

X (j(ω − kωs))

  • Sampling with an impulse train results in a signal with a CTFT of

Xδ(jω) that is a periodic function of ω

  • There are replicas of X(jω) at each multiple of ωs
  • Note that the replicas will not overlap if ωx < ωs

2

  • In this case, X(jω) could be recovered from Xδ(jω) by applying a

lowpass filter with gain Ts and a cutoff frequency ωc such that ωx < ωc < ωs − ωx

  • This is a surprising result
  • This is the sampling theorem
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

25

slide-26
SLIDE 26

The Sampling Theorem Let x(t) be a bandlimited signal with X(jω) = 0 for |ω| > ωx. Then x(t) is uniquely determined by its samples x(nT), n = 0, ±1, ±2, . . . , if ωs > 2 ωx where ωs = 2π

Ts .

  • Thus, we can reconstruct any bandlimited signal x(t) exactly by

creating a scaled impulse train and lowpass filtering

  • This theorem is sometimes called the Shannon sampling

theorem

  • min ωs = 2ωx is called the Nyquist rate
  • max ωx = ωs

2 is called the Nyquist frequency

  • In other words, we must obtain at least two samples per a cycle of

the fastest sinusoidal component

  • This should sound familiar
  • Recall that the fastest perceivable frequency in discrete-time

signals is π radians per sample (i.e. 0.5 cycles per sample)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

26

slide-27
SLIDE 27

Signal Relationships Summary x[n] = x(nTs) X(ejωTs) = 1 Ts

  • k=−∞

X (j(ω − kωs)) xδ(t) =

  • n=−∞

x(nTs) δ(t − Tsn) Xδ(jω) = 1 Ts

  • k=−∞

X (j(ω − kωs)) xδ(t) =

  • n=−∞

x[n] δ(t − Tsn) Xδ(jω) = X

  • ejωTs
  • We now know the relationships between all of the three signals
  • Note that xδ(t) was just a means to determining the relationship
  • f X(ejω) to X(jω)
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

27

slide-28
SLIDE 28

Guiding Questions and Objectives Revisited x[n] = x(nTs) X(ejωTs) = 1 Ts

  • k=−∞

X (j(ω − kωs))

  • Recall our guiding questions

– How is the CTFT of x(t) related to the DTFT of x[n] = x(nTs)? – Under what conditions can we synthesize x(t) from x[n]? – How do we do this DT ⇒ CT conversion?

  • Only the last remains
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

28

slide-29
SLIDE 29

Example 2: Equivalent Sinusoids Suppose x[n] is a DT sinusoidal signal, x[n] = cos(Ωn + θ) Solve for all of the CT sinusoids x(t) = cos(ωt + φ) that satisfy the relationship x(t)|t=nTs = x[n]. Which of these CT sinusoids satisfy the sampling theorem criterion?

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

29

slide-30
SLIDE 30

Example 2: Workspace

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

30

slide-31
SLIDE 31

Example 2: Equivalent Sinusoids

−3 −2 −1 1 2 3 −1 1 cos(ω t+θ Equivalent DT Sinusoids −3 −2 −1 1 2 3 −1 1 cos((2π − ω)t − θ) −3 −2 −1 1 2 3 −1 1 cos((ω t+2π)t + θ) Time (s)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

31

slide-32
SLIDE 32

Example 2: MATLAB Code

function [] = EquivalentSinusoids(); close all; t = -3:6/1000:3; n = floor(min(t)):ceil(max(t)); ph = 2*pi*rand; w = 0.6*pi; figure; FigureSet(1,’LTX’); subplot(3,1,1); h = plot(t,cos(w*t + ph),n,cos(w*n + ph),’k.’); set(h,’MarkerSize’,12); box off; ylabel(’cos(\omega t+\theta’); title(’Equivalent DT Sinusoids’); ylim([-1.05 1.05]); AxisLines; subplot(3,1,2); h = plot(t,cos((2*pi-w)*t - ph),n,cos(w*n + ph),’k.’); set(h,’MarkerSize’,12); box off; ylabel(’cos((2\pi - \omega)t - \theta)’); ylim([-1.05 1.05]); AxisLines; subplot(3,1,3); h = plot(t,cos((w+2*pi)*t + ph),n,cos(w*n + ph),’k.’); set(h,’MarkerSize’,12); box off; ylabel(’cos((\omega t+2\pi)t + \theta)’); xlabel(’Time (s)’); ylim([-1.05 1.05]); AxisLines; AxisSet(8);

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

32

slide-33
SLIDE 33

print -depsc EquivalentSinusoids;

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

33

slide-34
SLIDE 34

Interpolation Introduction

  • CT ⇒ DT conversion is trivial: x[n] = x(nTs)
  • We now know that we can reconstruct x(t) from x[n] exactly
  • This should be surprising
  • There are many signals x(t) that satisfy the constraint

x[n] = x(nTs)

  • Which one is the original x(t)?
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

34

slide-35
SLIDE 35

Interpolation Possibilities

−3 −2 −1 1 2 3 −0.2 0.2 0.4 0.6 0.8 1 Time (s) Signal (scaled)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

35

slide-36
SLIDE 36

Bandlimited Interpolation

X

y(t) x(t) xp(t) p(t) =

n=−∞ δ(t − nTs)

H(jω)

  • Intuitively there are ∞ signals that are equal to x(t) and evenly

spaced samples

  • However, if

– The samples were taken from a bandlimited signal: X(jω) = 0 for ω > ωx – The conditions of the sampling theorem are satisfied: ωs > 2 ωx then there is only one bandlimited signal that passes exactly through the samples!

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

36

slide-37
SLIDE 37

DT Processing of CT Signals H(z)

x[n] y[n] x(t) y(t) Ts Ts CT ⇒ DT DT ⇒ CT

  • Since x[n] completely represents x(t), we can process x[n] in

discrete-time

  • However, once we process the discrete-time signal and generate a

discrete-time output, y[n] we need to create a continuous-time

  • utput y(t)
  • We assume that y[n] represent samples from a continuous-time

signal y(t) that is bandlimited the same as x(t)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

37

slide-38
SLIDE 38

Interpolation

X

xr(t) x(t) xδ(t) p(t) =

n=−∞ δ(t − nTs)

H(jω)

  • There are many forms of interpolation

– Piecewise constant – Linear (point to point) – Splines (piecewise cubic)

  • For bandlimited signals, a lowpass filter can be used to exactly

recover the signal

  • Called bandlimited interpolation
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

38

slide-39
SLIDE 39

Interpolation Simplified xδ(t) =

  • n=−∞

x(nTs) δ(t − nT) xr(t) = xδ(t) ∗ h(t) = ∞

−∞

xδ(t − τ) h(τ) dτ = +∞

−∞

  • n=−∞

x(nTs) δ(t − τ − nTs)

  • h(τ) dτ

=

  • n=−∞

x(nT) ∞

−∞

δ(t − τ − nTs) h(τ) dτ =

  • n=−∞

x(nTs) h(t − nTs)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

39

slide-40
SLIDE 40

Interpolation with Ideal Filters x[n] = x(nTs) Xδ(jω) = 1 Ts

  • k=−∞

X (j(ω − kωs))

  • If the terms of the sum do not overlap, an ideal lowpass filter can

extract X(jω) from Xδ(jω)

  • The passband gain must be Ts
  • Recall that the ideal lowpass filter with cutoff frequency ωc and

gain Ts has an impulse response given by h(t) = Tsωc π sin(ωct) ωct = Tsωc π sinc ωct π

  • Thus, for ideal interpolation

xr(t) = Tsωc π

  • n=−∞

x(nTs) sinc ωc(t − nTs) π

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

40

slide-41
SLIDE 41

Notes on Bandlimited Interpolation x[n] = x(nTs) xr(t) = Tsωc π

  • n=−∞

x(nTs) sinc ωc(t − nTs) π

  • If the sampling theorem criterion is satisfied, xr(t) = x(t)
  • However, this assumes that the frequency components of x[n] are

between −π/2 and +π/2

  • If the sampling criterion is not satisfied, high-frequency

components will appear as low-frequency components

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

41

slide-42
SLIDE 42

Bandlimited Interpolation Example

−5 −4 −3 −2 −1 1 2 3 4 5 0.5 1 Time (s) xr(t) −5 −4 −3 −2 −1 1 2 3 4 5 0.5 1 x[n] −5 −4 −3 −2 −1 1 2 3 4 5 0.5 1 x(t) Example of Band−limited Signal Reconstruction (Interpolation)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

42

slide-43
SLIDE 43

Introduction to Aliasing x(t) · p(t)

FT

⇐ ⇒ 1 Ts

+∞

  • k=−∞

X (j(ω − kωs))

  • If the sampling theorem is not satisfied (ωx > ωs

2 ), the sum of

replicated spectral components X(j(ω − kωs)) will overlap

  • This is called aliasing
  • In this case xr(t) = x(t), though the two will be equal at t = nTs
  • When aliasing occurs with pure tones (sinusoidal signals), signals

with frequencies above ωs

2 are reflected to lower frequencies

  • You should have experienced this in the lab with audio
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

43

slide-44
SLIDE 44

Example 3:Aliasing of Pure Tones

1 2 3 4 5 6 7 8 9 10 −1 −0.8 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 Time (ms) Signals (scaled) Aliasing of Pure Tones Example Tone Frequency:500 Hz Sample Rate:2000 Hz True Signal Reconstructed Signal

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

44

slide-45
SLIDE 45

Example 3:Aliasing of Pure Tones

1 2 3 4 5 6 7 8 9 10 −1 −0.8 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 Time (ms) Signals (scaled) Aliasing of Pure Tones Example Tone Frequency:900 Hz Sample Rate:2000 Hz True Signal Reconstructed Signal

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

45

slide-46
SLIDE 46

Example 3:Aliasing of Pure Tones

1 2 3 4 5 6 7 8 9 10 −1 −0.8 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 Time (ms) Signals (scaled) Aliasing of Pure Tones Example Tone Frequency:1100 Hz Sample Rate:2000 Hz True Signal Reconstructed Signal

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

46

slide-47
SLIDE 47

Example 3:Aliasing of Pure Tones

1 2 3 4 5 6 7 8 9 10 −1 −0.8 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 Time (ms) Signals (scaled) Aliasing of Pure Tones Example Tone Frequency:1500 Hz Sample Rate:2000 Hz True Signal Reconstructed Signal

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

47

slide-48
SLIDE 48

Example 3:Aliasing of Pure Tones

1 2 3 4 5 6 7 8 9 10 −1 −0.8 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 Time (ms) Signals (scaled) Aliasing of Pure Tones Example Tone Frequency:1800 Hz Sample Rate:2000 Hz True Signal Reconstructed Signal

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

48

slide-49
SLIDE 49

Example 3:Aliasing of Pure Tones

1 2 3 4 5 6 7 8 9 10 −1 −0.8 −0.6 −0.4 −0.2 0.2 0.4 0.6 0.8 1 Time (ms) Signals (scaled) Aliasing of Pure Tones Example Tone Frequency:2200 Hz Sample Rate:2000 Hz True Signal Reconstructed Signal

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

49

slide-50
SLIDE 50

Example 3: MATLAB Code

function [] = AliasingTones(); close all; fs = 2e3; % 2 kHz sample rate fx = [500 900 1.1e3 1.5e3 1.8e3 2.2e3]; t = 0:10e-3/500:10e-3; % Span of 5 ms ts = -15e-3:1/fs:25e-3; % Sampled times T = 1/fs; ws = 2*pi*fs; wc = ws/2; for c1 = 1:length(fx), xt = cos(2*pi*fx(c1)*t); % True signal xs = cos(2*pi*fx(c1)*ts); % True signal sampled xr = zeros(size(t)); % Reconstructed signal memory allocation for c2 = 1:length(ts), st = (wc*T/pi)*xs(c2)*sinc(wc*(t-ts(c2))/pi); % Band-limited interpolation xr = xr + st; end; figure; FigureSet(1,’LTX’); h = plot(t*1e3,xt,’b’,t*1e3,xr,’g’,ts*1e3,xs,’ko’); set(h(1),’LineWidth’,1.5); set(h(2),’LineWidth’,0.8); set(h(3),’MarkerFaceColor’,’k’); set(h(3),’MarkerSize’,4); xlim([min(t*1e3) max(t*1e3)]); ylim([-1.1 1.1]); box off; xlabel(’Time (ms)’); ylabel(’Signals (scaled)’); title(sprintf(’Aliasing of Pure Tones Example Tone Frequency:%d Hz Sample Rate:%d Hz’,fx(c1),fs));

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

50

slide-51
SLIDE 51

AxisSet(8); legend(’True Signal’,’Reconstructed Signal’); eval(sprintf(’print -depsc AliasingTones%04d;’,fx(c1))); end; return; n = -15:15; t = -5.5:0.01:5.5; xp = rand(size(n)); % Sampled signal wc = pi; T = 1; xr = zeros(size(t)); % Reconstructed signal subplot(3,1,3); for cnt = 1:length(n), st = (wc*T/pi)*xp(cnt)*sinc(wc*(t-n(cnt)*T)/pi); plot(t,st,’g’); hold on; xr = xr + st; end; h = plot(t,xr,’b’,n,xp,’ro’); set(h(2),’MarkerFaceColor’,’r’); set(h(2),’MarkerSize’,2); hold off; xlim([min(t) max(t)]); ylim([-0.2 1.2]); xlabel(’Time (s)’); ylabel(’Signal’); box off; subplot(3,1,2); plot([min(t) max(t)],[0 0],’k:’); hold on; h = stem(n,xp,’r’); set(h(1),’MarkerFaceColor’,’r’); set(h(1),’MarkerSize’,2);

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

51

slide-52
SLIDE 52

hold off; ylabel(’Sampled Signal’); subplot(3,1,1); h = plot(t,xr,’b’,n,xp,’ro’); set(h(2),’MarkerFaceColor’,’r’); set(h(2),’MarkerSize’,2); ylabel(’Reconstructed Signal’); xlim([min(t) max(t)]); ylim([-0.2 1.2]); box off; title(’Example of Band-limited Siganl Reconstruction (Interpolation)’);

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

52

slide-53
SLIDE 53

Example 4:Aliasing of Speech The following slides show a segment of speech for Regis Philbin stating part of the word “Your”. The signal was sampled at various rates and then interpolated. The difference between the true signal and the reconstructed signal demonstrates the hazard of under

  • sampling. The original signal was sampled at 44.1 kHz.

Why isn’t the aliasing apparent at 22 kHz?

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

53

slide-54
SLIDE 54

Example 4:Aliasing of Speech

30 32 34 36 38 40 42 44 46 48 50 −0.5 −0.4 −0.3 −0.2 −0.1 0.1 0.2 0.3 0.4 0.5 Time (ms) Signals (scaled) Regis "Your" Sample Rate:22050.0 Hz True Signal Reconstructed Signal

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

54

slide-55
SLIDE 55

Example 4:Aliasing of Speech

30 32 34 36 38 40 42 44 46 48 50 −0.5 −0.4 −0.3 −0.2 −0.1 0.1 0.2 0.3 0.4 0.5 Time (ms) Signals (scaled) Regis "Your" Sample Rate:8820.0 Hz True Signal Reconstructed Signal

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

55

slide-56
SLIDE 56

Example 4:Aliasing of Speech

30 32 34 36 38 40 42 44 46 48 50 −0.5 −0.4 −0.3 −0.2 −0.1 0.1 0.2 0.3 0.4 0.5 Time (ms) Signals (scaled) Regis "Your" Sample Rate:4410.0 Hz True Signal Reconstructed Signal

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

56

slide-57
SLIDE 57

Example 4:Aliasing of Speech

30 32 34 36 38 40 42 44 46 48 50 −0.5 −0.4 −0.3 −0.2 −0.1 0.1 0.2 0.3 0.4 0.5 Time (ms) Signals (scaled) Regis "Your" Sample Rate:2205.0 Hz True Signal Reconstructed Signal

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

57

slide-58
SLIDE 58

Effect of Aliasing in the Frequency Domain

1 1 1 1 2

  • 2ws

2ws

ω ω ω ω ωx ωx ωx −ωx −ωx −ωx ωs ωs ωs ωs −ωs −ωs −ωs −ωs Xδ(jω) Xδ(jω) Xδ(jω) Xδ(jω)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

58

slide-59
SLIDE 59

Aliasing Comments

  • In discrete-time, one of the key concepts of this class is that

complex exponentials with frequencies that differ by a multiple of 2π are indistinguishable: ej(ω+ℓ2π)n = ejωn

  • When we sample a signal, we convert a continuous-time signal to

a discrete-time signal

  • Sinusoidal components that are above ωs

2 are reflected down to

lower frequencies

  • You have experienced aliasing before

– Spoked wheels in street lights that strobe at 120 Hz – Spoked wagon wheels or helicopter blades in movies and television – Strobe lights applied to rapidly oscillating objects

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

59

slide-60
SLIDE 60

Preventing Aliasing

x[n] C/D Conversion T

H(s)

x(t) Anti-Aliasing Filter

  • In practice, most data acquisition systems that convert CT signals

to DT signals take two measures to prevent aliasing – Apply an analog (continuous-time) lowpass filter prior to sampling to ensure the signal is bandlimited – Use a higher sampling rate than required by the sampling theorem (e.g. ωs = 2.2 · ωx)

  • These lowpass filters are often called anti-aliasing filters
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

60

slide-61
SLIDE 61

Anti-aliasing Filter Tradeoffs

x[n] C/D Conversion T

H(s)

x(t) Anti-Aliasing Filter

Over-sampling also has a number of benefits for the anti-aliasing filter (AAF).

  • The transition band can be wider
  • If the filter order is fixed, the passband and stopband attenuation

can be improved

  • If the passband and stopband attenuation are fixed, a lower order

filter can be used (easier and less expensive to design and build)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

61

slide-62
SLIDE 62

Discrete-Time Processing of Continuous-Time Signals H(z)

x[n] y[n] x(t) y(t) Ts Ts CT ⇒ DT DT ⇒ CT

X(ejΩ) = 1 Ts

  • k=−∞

X

  • j

Ω − k2π Ts

  • Most electronic “systems” that process signals do so in

discrete-time

  • There are many advantages to this approach

– Digital technology is cheap to manufacture and very advanced – Digital systems do not drift over time – Parameter tuning (expensive) is not necessary; repeatable – More flexible

  • The sampling theorem is the theoretical basis for DT processing of

CT signals

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

62

slide-63
SLIDE 63

Fourier Example of CTFT & DTFT Relationship

1 1

ω ω Ω

1 T

−2π 2π ωs ωs −ωs −ωs X(jω) Xδ(jω) X(ejΩ)

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

63

slide-64
SLIDE 64

CT to DT Conversion Comments X(ejΩ) = 1 Ts

  • k=−∞

X

  • j

Ω − k2π Ts

  • If the sampling theorem is satisfied, the DTFT is a scaled version
  • f the CTFT

– The amplitude of the DTFT is scaled by

1 Ts

– The frequency ωs is mapped to Ωs = 2π

  • This means we can theoretically calculate the CTFT of a

band-limited signal exactly using the DTFT of the sampled signal x(nT)

  • For spectral estimation, the signal must first be windowed and

then the FFT is used to calculate the DTFT

  • This is exactly how the sampling oscilloscopes use the FFT to

estimate the Fourier transform of a CT signal

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

64

slide-65
SLIDE 65

CT to DT Conversion Comments

1 1

ω Ω −π π −2π 2π ωs −ωs

1 2 ωs

− 1

2 ωs

H(jω) H(ejΩ)

  • This also means we can process band-limited CT signals with DT

systems without any loss

  • As long as the sampling theorem is satisfied, we simply design

H(z) such that H(ejΩ) = H(jω)|ω= Ω

Ts

for |Ω| < π

  • In this case, the DT & CT systems are equivalent
  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

65

slide-66
SLIDE 66

DT to CT Conversion Comments

Interpolation Filter Impulse Train DT to CT

y(t) yδ(t) y[n]

yδ(t) =

  • n=−∞

y[n] δ(t − nTs)

  • The interpolation filter is just a lowpass filter with a passband

gain of Ts and a cutoff frequency of ωs

2

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

66

slide-67
SLIDE 67

Summary of Key Concepts

  • If a signal is bandlimited, we can sample the signal without losing

any information

  • The original signal can be reconstructed from its samples exactly
  • The sampling theorem is the basis for discrete-time processing of

continuous-time signals

  • If the sampling theorem is satisfied, the CTFT can be calculated

exactly from the DTFT

  • There are many advantages to using this type of architecture
  • If the sampling theorem is not satisfied, sampling will result in

aliasing

  • If a signal is bandlimited, we can theoretically build an equivalent

DT system for any CT system

  • J. McNames

Portland State University ECE 223 Sampling

  • Ver. 1.15

67