You are on page 1of 40

Sampling: a frequency domain view

ECE2111: Signals and Systems week9

Dr. Faezeh Marzbanrad


faezeh.marzbanrad@monash.edu
This lecture

By the end of this lecture you will learn about:

• Sampling continuous time signals to obtain


discrete-time signals,
• Frequency domain model of sampling,
• The aliasing effect and how to avoid it.

2
Introducing sampling and reconstruction

• Most physical signals and systems are best modeled as being


continuous-time

• For storage and implementation in computers, they are best


modelled as being discrete-time.

Sampling

Reconstruction

3
Introducing sampling and reconstruction

Sampling: A natural way to convert continuous-time


physical signals into discrete-time signals.
• Sampled continuous-time signals can be processed as
discrete-time signals.

Sampling

Reconstruction

Reconstruction: sampled signal may be converted back


to continuous-time to be used to affect a physical system.

4
Introducing sampling and reconstruction

What might go wrong?

5
Introducing sampling and reconstruction

What might go wrong?

6
Introducing sampling and reconstruction

How well can we reconstruct a signal from its samples?

7
Sampling

• If 𝑥𝑥 is a CT signal and 𝑇𝑇𝑠𝑠 is a sampling period, we can define the sampled (DT)
signal 𝑥𝑥𝑠𝑠 :

𝑥𝑥𝑠𝑠 𝑛𝑛 = 𝑥𝑥 𝑛𝑛𝑇𝑇𝑠𝑠 for all 𝑛𝑛


• If 𝑻𝑻𝒔𝒔 is the sampling period in seconds then:
𝐬𝐬𝐬𝐬𝐬𝐬𝐬𝐬𝐬𝐬𝐬𝐬𝐬𝐬
Sampling frequency is 𝒇𝒇𝒔𝒔 = 1/𝑇𝑇𝑠𝑠 ( )
𝐬𝐬𝐬𝐬𝐬𝐬𝐬𝐬𝐬𝐬𝐬𝐬

• The higher the sampling frequency is, the better 𝑥𝑥𝑠𝑠 approximates 𝑥𝑥 .

8
Sampling and aliasing with sinusoids

• Sampling 𝑥𝑥 𝑡𝑡 = cos(𝜔𝜔0 𝑡𝑡) with sampling period 𝑇𝑇𝑠𝑠 . The resulting DT


signal is:
𝑥𝑥𝑠𝑠 𝑛𝑛 = 𝑥𝑥 𝑛𝑛𝑇𝑇𝑠𝑠 = cos 𝜔𝜔0 𝑛𝑛𝑇𝑇𝑠𝑠 for all n

9
Sampling and aliasing with sinusoids

• Sampling 𝑥𝑥 𝑡𝑡 = cos(𝜔𝜔0 𝑡𝑡) with sampling period 𝑇𝑇𝑠𝑠 . The resulting DT


signal is:
𝑥𝑥𝑠𝑠 𝑛𝑛 = 𝑥𝑥 𝑛𝑛𝑇𝑇𝑠𝑠 = cos 𝜔𝜔0 𝑛𝑛𝑇𝑇𝑠𝑠 for all n

• Sampling cos 𝜋𝜋𝜋𝜋 and cos 9𝜋𝜋𝜋𝜋 with sampling period 𝑇𝑇𝑠𝑠 = 0.25
seconds:

10
Sampling and aliasing with sinusoids

• Sampling 𝑥𝑥 𝑡𝑡 = cos(𝜔𝜔0 𝑡𝑡) with sampling period 𝑇𝑇𝑠𝑠 . The resulting DT


signal is:
𝑥𝑥𝑠𝑠 𝑛𝑛 = 𝑥𝑥 𝑛𝑛𝑇𝑇𝑠𝑠 = cos 𝜔𝜔0 𝑛𝑛𝑇𝑇𝑠𝑠 for all n

• Sampling cos 𝜋𝜋𝜋𝜋 and cos 9𝜋𝜋𝜋𝜋 with sampling period 𝑇𝑇𝑠𝑠 = 0.25
seconds:

The sampled signals are identical!!

There are (infinitely many) CT signals that, if sampled with sampling period 𝑇𝑇𝑠𝑠 ,
give us exactly the same 𝑥𝑥𝑠𝑠 .
11
Sampling and aliasing with sinusoids

• There are (infinitely many) other CT signals that, if we


sample them with sampling period 𝑇𝑇𝑠𝑠 , give us exactly 𝑥𝑥𝑠𝑠 .
• For any integer 𝑙𝑙 let:
2𝜋𝜋𝜋𝜋
𝑥𝑥𝑙𝑙 𝑡𝑡 = cos[ 𝜔𝜔0 + t]
𝑇𝑇𝑠𝑠
If we sample 𝑥𝑥𝑙𝑙 with sampling period 𝑇𝑇𝑠𝑠 we obtain:
𝑥𝑥𝑙𝑙,𝑠𝑠 𝑛𝑛 = 𝑥𝑥𝑙𝑙 𝑛𝑛𝑇𝑇𝑠𝑠 = cos 𝜔𝜔0 𝑛𝑛𝑇𝑇𝑠𝑠 + 2𝜋𝜋𝜋𝜋𝜋𝜋 = cos 𝜔𝜔0 𝑛𝑛𝑇𝑇𝑠𝑠 = 𝑥𝑥𝑠𝑠 [𝑛𝑛]

So there are many different (sinusoidal) signals that are indistinguishable


once we sample with sampling period 𝑇𝑇𝑠𝑠 .

Many different CT signals appear the same once we sample them.


This phenomenon is called aliasing.

12
Example: Sampling and aliasing with sinusoids

A sinusoid with fundamental frequency 𝜋𝜋 rad/sec is sampled with 𝑇𝑇𝑠𝑠 = 0.1

13
Example: Sampling and aliasing with sinusoids

A sinusoid with fundamental frequency 𝜋𝜋 rad/sec is sampled with 𝑇𝑇𝑠𝑠 = 0.2

14
Example: Sampling and aliasing with sinusoids

A sinusoid with fundamental frequency 𝜋𝜋 rad/sec is sampled with 𝑇𝑇𝑠𝑠 = 0.5

15
Example: Sampling and aliasing with sinusoids

A sinusoid with fundamental frequency 𝜋𝜋 rad/sec is sampled with 𝑇𝑇𝑠𝑠 = 1.0

16
Example: Sampling and aliasing with sinusoids

A sinusoid with fundamental frequency 𝜋𝜋 rad/sec is sampled with 𝑇𝑇𝑠𝑠 = 1.2

17
Example: Sampling and aliasing with sinusoids

A sinusoid with fundamental frequency 𝜋𝜋 rad/sec is sampled with 𝑇𝑇𝑠𝑠 = 1.2

Aliasing: when a lower frequency sinusoid than 𝑥𝑥 agrees with the


samples of 𝑥𝑥
Critical sampling period: Ts = 1

18
Example: Sampling and aliasing with sinusoids

A sinusoid with fundamental frequency 𝜋𝜋 rad/sec is sampled with 𝑇𝑇𝑠𝑠 = 1.5

Aliasing: when a lower frequency sinusoid than 𝑥𝑥 agrees with the


samples of 𝑥𝑥
Critical sampling period: Ts = 1

19
Example: Sampling and aliasing with sinusoids

A sinusoid with fundamental frequency 𝜋𝜋 rad/sec is sampled with 𝑇𝑇𝑠𝑠 = 1.5

Aliasing: when a lower frequency sinusoid than 𝑥𝑥 agrees with the


samples of 𝑥𝑥
Critical sampling period: Ts = 1

20
Example: Sampling and aliasing with sinusoids

A sinusoid with fundamental frequency 𝜋𝜋 rad/sec is sampled with 𝑇𝑇𝑠𝑠 = 2.0

Aliasing: when a lower frequency sinusoid than 𝑥𝑥 agrees with the


samples of 𝑥𝑥
Critical sampling period: Ts = 1

21
Example: Sampling and aliasing with sinusoids

A sinusoid with fundamental frequency 𝜋𝜋 rad/sec is sampled with 𝑇𝑇𝑠𝑠 = 2.0

Aliasing: when a lower frequency sinusoid than 𝑥𝑥 agrees with the


samples of 𝑥𝑥
Critical sampling period: Ts = 1

22
Avoiding aliasing with sinusoids

How fast must we sample sinusoid to avoid aliasing?

𝜋𝜋
• Sample with 𝑇𝑇𝑠𝑠 < → no aliasing
𝜔𝜔0
𝜋𝜋
• Sample with 𝑇𝑇𝑠𝑠 > → aliasing
𝜔𝜔0

23
Avoiding aliasing with sinusoids

How fast must we sample cos 𝜔𝜔0 𝑡𝑡 to avoid aliasing?

𝜋𝜋
• Sample with 𝑇𝑇𝑠𝑠 < → no aliasing
𝜔𝜔0
𝜋𝜋
• Sample with 𝑇𝑇𝑠𝑠 > → aliasing
𝜔𝜔0

𝜋𝜋
If 𝑇𝑇𝑠𝑠 = then sampled signal is
𝜔𝜔0
𝜋𝜋 𝑛𝑛
cos 𝜔𝜔0 𝑇𝑇𝑠𝑠 𝑛𝑛 = cos 𝜔𝜔0 𝑛𝑛 = cos 𝜋𝜋𝜋𝜋 = −1
𝜔𝜔0
which is the fastest oscillating DT signal possible.
24
Example

If 𝑥𝑥 𝑡𝑡 = sin 3𝑡𝑡 , how fast do we need to sample to


avoid aliasing?

𝜋𝜋
A. 𝑇𝑇𝑠𝑠 <
2
𝜋𝜋
B. 𝑇𝑇𝑠𝑠 <
6
C. 𝑇𝑇𝑠𝑠 < 𝜋𝜋
𝜋𝜋
D. 𝑇𝑇𝑠𝑠 <
3

25
Frequency-domain model of sampling

• CTFT of signal 𝑥𝑥 t = cos(𝜔𝜔0 𝑡𝑡):

• DTFT of sampled signal x𝑠𝑠 𝑛𝑛 = cos(𝜔𝜔0 𝑇𝑇𝑠𝑠 𝑛𝑛):

26
Frequency-domain model of sampling

• CTFT of signal 𝑥𝑥 t = cos(𝜔𝜔0 𝑡𝑡):

• DTFT of sampled signal x𝑠𝑠 𝑛𝑛 = cos(𝜔𝜔0 𝑇𝑇𝑠𝑠 𝑛𝑛):

27
Nyquist Frequency

If sample with sampling period 𝑇𝑇𝑠𝑠

𝜋𝜋
• Sinusoids with frequency 𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏 𝑇𝑇𝑠𝑠
are not aliased
𝜋𝜋
• Sinusoids with frequency 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝑇𝑇𝑠𝑠
are aliased

𝜋𝜋
Nyquist Frequency: rad/sec
𝑇𝑇𝑠𝑠

28
Frequency domain model of sampling

Suppose 𝑥𝑥 is a CT signal and 𝑥𝑥𝑠𝑠 is the DT signal obtained by sampling 𝑥𝑥


with sampling period Ts :

𝑥𝑥𝑠𝑠 𝑛𝑛 = 𝑥𝑥 𝑛𝑛𝑇𝑇𝑠𝑠 𝑓𝑓𝑓𝑓𝑓𝑓 𝑎𝑎𝑎𝑎𝑎𝑎 𝑛𝑛

Then the DTFT X𝑠𝑠 of 𝑥𝑥𝑠𝑠 and the CTFT X of 𝑥𝑥 are related by:

1 𝜔𝜔 − 2𝜋𝜋𝜋𝜋
X𝑠𝑠 𝜔𝜔 = � 𝑋𝑋( )
𝑇𝑇𝑠𝑠 𝑇𝑇𝑠𝑠
𝑙𝑙=−∞
(see notes for a derivation)
• The case 𝑇𝑇𝑠𝑠 = 1:
• one sample takes one second.
• The CTFT is aperiodic and the DTFT must be periodic.
• We can make the CTFT periodic by the shift-and-add summation: X𝑠𝑠 𝜔𝜔 =
∑∞
𝑙𝑙=−∞ 𝑋𝑋(𝜔𝜔 − 2𝜋𝜋𝜋𝜋)

29
Frequency domain model of sampling

Suppose 𝑥𝑥 is a CT signal and 𝑥𝑥𝑠𝑠 is the DT signal obtained by sampling 𝑥𝑥


with sampling period Ts :

𝑥𝑥𝑠𝑠 𝑛𝑛 = 𝑥𝑥 𝑛𝑛𝑇𝑇𝑠𝑠 𝑓𝑓𝑓𝑓𝑓𝑓 𝑎𝑎𝑎𝑎𝑎𝑎 𝑛𝑛

Then the DTFT X𝑠𝑠 of 𝑥𝑥𝑠𝑠 and the CTFT X of 𝑥𝑥 are related by:

1 𝜔𝜔 − 2𝜋𝜋𝜋𝜋
X𝑠𝑠 𝜔𝜔 = � 𝑋𝑋( )
𝑇𝑇𝑠𝑠 𝑇𝑇𝑠𝑠
𝑙𝑙=−∞
(see notes for a derivation)

X: continuous frequency in radians/second.


Xs: discrete-frequency in radians/sample.
Ts is in seconds/sample.

𝜔𝜔 radians radians seconds


( ) = 𝜔𝜔( )/𝑇𝑇𝑠𝑠 ( )
𝑇𝑇𝑠𝑠 second sample sample

30
Frequency-domain model of sampling

Case 𝑇𝑇𝑠𝑠 = 1
• To check the DTFT X𝑠𝑠 is 𝑥𝑥𝑠𝑠 :

1 2𝜋𝜋 1 2𝜋𝜋
� X𝑠𝑠 𝜔𝜔 𝑒𝑒 𝑗𝑗𝑗𝑗𝑗𝑗 𝑑𝑑𝑑𝑑 = � � 𝑋𝑋(𝜔𝜔 − 2𝜋𝜋𝜋𝜋) 𝑒𝑒 𝑗𝑗𝑗𝑗𝑗𝑗 𝑑𝑑𝑑𝑑
2𝜋𝜋 0 2𝜋𝜋 0
𝑙𝑙=−∞
∞2𝜋𝜋𝑙𝑙+2𝜋𝜋
1 ′
= � � 𝑋𝑋(𝜔𝜔′) 𝑒𝑒 𝑗𝑗(𝜔𝜔 +2𝜋𝜋𝜋𝜋)𝑛𝑛 𝑑𝑑𝜔𝜔′
2𝜋𝜋 2𝜋𝜋𝜋𝜋
𝑙𝑙=−∞
∞2𝜋𝜋𝜋𝜋+2𝜋𝜋
1 ′
= � � 𝑋𝑋(𝜔𝜔𝜔) 𝑒𝑒 𝑗𝑗𝜔𝜔 𝑛𝑛 𝑑𝑑𝜔𝜔′
2𝜋𝜋 2𝜋𝜋𝜋𝜋
𝑙𝑙=−∞
1 ∞ 𝑗𝑗𝜔𝜔 ′ 𝑛𝑛
= � 𝑋𝑋(𝜔𝜔𝜔) 𝑒𝑒 𝑑𝑑𝜔𝜔′
2𝜋𝜋 −∞
= 𝑥𝑥 𝑛𝑛 = 𝑥𝑥𝑠𝑠 𝑛𝑛 .

31
General sampling period

Consider sampling the signal with period 𝑇𝑇𝑠𝑠 as a composition of time-scaling and then
sampling with period 1, If 𝑥𝑥 is a CT signal,
• Let y t = 𝑥𝑥 𝑡𝑡𝑇𝑇𝑠𝑠 be a signal obtained by time-scaling 𝑥𝑥.
• Then xs n = 𝑥𝑥 𝑛𝑛𝑇𝑇𝑠𝑠 = 𝑦𝑦(𝑛𝑛) for all 𝑛𝑛.
• Sampling y with sampling period 1 is the same as sampling x with sampling period 𝑇𝑇𝑠𝑠 .
• If 𝑌𝑌is the CTFT of 𝑦𝑦 then:
X𝑠𝑠 𝜔𝜔 = ∑∞
𝑙𝑙=−∞ 𝑌𝑌(𝜔𝜔 − 2𝜋𝜋𝜋𝜋)

• Using the time-scaling property:


1 𝜔𝜔
𝑌𝑌 𝜔𝜔 = 𝑋𝑋( )
𝑇𝑇𝑠𝑠 𝑇𝑇𝑠𝑠
• and hence:

1 𝜔𝜔 − 2𝜋𝜋𝜋𝜋
X𝑠𝑠 𝜔𝜔 = � 𝑋𝑋( )
𝑇𝑇𝑠𝑠 𝑇𝑇𝑠𝑠
𝑙𝑙=−∞

32
Bandwidth

Signal x with Fourier transform X has bandwidth W


(radians/second) if
𝑋𝑋 𝜔𝜔 = 0 whenever |𝜔𝜔| > 𝑊𝑊
Also often called the baseband bandwidth

Example:

33
Bandwidth and aliasing
CTFT of x is:

Sampling period Ts < 𝜋𝜋/𝑊𝑊 gives DTFT X s :


1 𝜔𝜔 − 2𝜋𝜋𝜋𝜋
X𝑠𝑠 𝜔𝜔 = � 𝑋𝑋( )
𝑇𝑇𝑠𝑠 𝑇𝑇𝑠𝑠
𝑙𝑙=−∞ 34
Bandwidth and aliasing
CTFT of x is:

Sampling period Ts < 𝜋𝜋/𝑊𝑊 gives DTFT X s :


fast enough for no aliasing


1 𝜔𝜔 − 2𝜋𝜋𝜋𝜋
X𝑠𝑠 𝜔𝜔 = � 𝑋𝑋( )
𝑇𝑇𝑠𝑠 𝑇𝑇𝑠𝑠
𝑙𝑙=−∞ 35
Bandwidth and aliasing
If Ts ≥ 𝜋𝜋/𝑊𝑊gives overlapping copies:
1 𝜔𝜔
taking copies of 𝑋𝑋( ) shifted by multiples of 2𝜋𝜋:
𝑇𝑇𝑠𝑠 𝑇𝑇𝑠𝑠

and summing them up, to obtain: Too slow  aliasing!!

36
Bandwidth and aliasing

Suppose we sample a CT signal 𝑥𝑥 to get 𝑥𝑥𝑠𝑠

Aliasing happens when there is a signal with lower bandwidth


than 𝑥𝑥 that agrees with 𝑥𝑥𝑠𝑠

37
Bandwidth and aliasing

Suppose we sample a CT signal 𝑥𝑥 to get 𝑥𝑥𝑠𝑠

Aliasing happens when there is a signal with lower bandwidth


than 𝑥𝑥 that agrees with 𝑥𝑥𝑠𝑠

For a CT signal with bandwidth W radians/second:


𝜋𝜋
• If sample with 𝑇𝑇𝑠𝑠 < no aliasing occurs
𝑊𝑊
𝜋𝜋
• If sample with 𝑇𝑇𝑠𝑠 ≥ aliasing occurs
𝑊𝑊

38
Nyquist Frequency (revisited)

If sample with sampling period 𝑇𝑇𝑠𝑠

𝜋𝜋
• Signals with bandwidth 𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏 𝑇𝑇𝑠𝑠
are not aliased
𝜋𝜋
• Signals with bandwidth 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝑇𝑇𝑠𝑠
are aliased

𝜋𝜋
Nyquist Frequency: rad/sec
𝑇𝑇𝑠𝑠

39
Conclusion

• Sampling converts CT signals into DT signals.


• Aliasing: when we sample a signal, and yet there is
a lower bandwidth signal that agrees with the
samples.
• If W is bandwidth in rad/sec:
• Aliasing occurs if Ts > 𝜋𝜋/𝑊𝑊
• Aliasing does not occur if Ts < 𝜋𝜋/𝑊𝑊
• DTFT of a sampled signal is related to the CTFT of
1 ∞ 𝜔𝜔−2𝜋𝜋𝜋𝜋
the original CT signal: X 𝑠𝑠 𝜔𝜔 = ∑𝑙𝑙=−∞ 𝑋𝑋( )
𝑇𝑇𝑠𝑠 𝑇𝑇𝑠𝑠

40

You might also like