<<

INF4420 Discrete time signals

Jørgen Andreas Michaelsen Spring 2013

1 / 37

Outline

• Impulse sampling • z-Transform • Frequency response • Stability

Spring 2013 Discrete time signals 2

2 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Introduction

• More practical to do processing on sampled signals in many cases • Sampled + quantized signals = digital • Inputs and outputs are not sampled • How does sampling affect the signals? • Tools for analyzing sampled signals and systems (“discrete ”, the z-transform)

Spring 2013 Discrete time signals 3

3 / 37

Introduction

• We have already seen sample and hold circuits • We can also realize integrators, filters, etc. as sampled analog systems—switched capacitor techniques. Discrete time, continuous amplitude. • Digital processing is efficient and robust, usually preferred where applicable. Sampling also applies to digital.

Spring 2013 Discrete time signals 4

4 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Introduction

Spring 2013 Discrete time signals 5

5 / 37

Introduction

• Sample a continuous time input signal at uniformely spaced time points. • Output is a discrete sequence of values (in theory).

Spring 2013 Discrete time signals 6

6 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Introduction

Spring 2013 Discrete time signals 7

7 / 37

Sampling

Laplace transform: Input signal

Fourier transform:

Spring 2013 Discrete time signals 8

8 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Sampling

Spring 2013 Discrete time signals 9

9 / 37

Sampling

Impulse sampling • Choose 휏 infinitely narrow 1 • Choose the gain 푘 = . 휏

→ The area of the pulse at 푛푇 is equal to the instantaneous value of the input at 푛푇, 푓(푛푇).

The signal is still defined for all time, so we can use the Laplace transform for analysis.

Spring 2013 Discrete time signals 10

10 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Sampling

• Modelling the sampled output, 푓∗ 푡 • We will model the sampled output in the time domain • Then find an equivalent representation in the Laplace domain • We will model each pulse independently and the whole signal by summing all pulses

Spring 2013 Discrete time signals 11

11 / 37

Sampling

Modeling a single pulse using step functions

Step function:

1, 푡 ≥ 0 푢 푡 ≡ 0, 푡 < 0

Single pulse:

푓 푛푇 ⋅ 푢 푡 − 푛푇 − 푢 푡 − 푛푇 − 휏

Spring 2013 Discrete time signals 12

12 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Sampling

Sum all the pulses to get the sampled signal:

∞ 푓∗ 푡 = 푘 푓 푛푇 ⋅ 푢 푡 − 푛푇 − 푢 푡 − 푛푇 − 휏 푛=0

Spring 2013 Discrete time signals 13

13 / 37

Sampling

Transforming the time domain model to the Laplace domain

Relevant Laplace transforms

푓(푡) ↔ 퐹(푠) 푢(푡) ↔ 푠−1 푓 푡 − 푎 푢 푡 − 푎 , 푎 ≥ 0 ↔ 푒−푎푠퐹(푠)

Spring 2013 Discrete time signals 14

14 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Sampling

Time domain model from before ∞ 푓∗ 푡 = 푘 푓 푛푇 ⋅ 푢 푡 − 푛푇 − 푢 푡 − 푛푇 − 휏 푛=0

Laplace domain ∞ 푒−푠푛푇 푒−푠 푛푇+휏 퐹∗ 푠 = 푘 푓 푛푇 − 푠 푠 푛=0 ∞ 푘 1 − 푒−푠휏 = 푓 푛푇 푒−푠푛푇 푠 푛=0

Spring 2013 Discrete time signals 15

15 / 37

Sampling and the 풛-transform

∞ 푘 1 − 푒−푠휏 퐹∗ 푠 = 푓 푛푇 푒−푠푛푇 푠 푛=0

1 Impulse sampling: 푘 = , 휏 → 0 (푒푥 ≈ 1 + 푥) 휏

∞ ∞ 퐹∗ 푠 ≈ 푓 푛푇 ⋅ 푒−푠푛푇 ≡ 푓 푛푇 ⋅ 푧−푛 푛=0 푛=0

Spring 2013 Discrete time signals 16

16 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) The 풛-transform

푧 ≡ 푒푠푇

∞ ∞ 푋 푧 ≡ 푥 푛푇 ⋅ 푧−푛 = 푥 푛 ⋅ 푧−푛 푛=0 푛=0

• Delay by 푘 samples, 푧−푘 ⋅ 푋(푧) • Convolution in time ↔ multiplication in 푧

Spring 2013 Discrete time signals 17

17 / 37

Frequency response

• Use the Laplace domain description of the sampled signal • As before, substitute 푠 = 푗휔 ∞ 푋 푗휔 = 푥 푛푇 ⋅ 푒−푗휔푛푇 푛=−∞ • 푋(푗휔) is the Fourier transform of the impulse sampled input signal, 푥(푡). • 푒푗푥 is cyclic, 푒푗푥 = cos 푥 + 푗 sin 푥

Spring 2013 Discrete time signals 18

18 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Frequency response

• We go from the 푧-transform to the frequency response by substituting 푧 = 푒푗휔푇 • As we sweep 휔 we trace out the unit circle

Spring 2013 Discrete time signals 19

19 / 37

Frequency response

Rewriting to use frequency (Hz), rather than radian frequency

∞ 푋 푓 = 푥 푛푇 ⋅ 푒−푗2휋푓푛푇 푛=−∞

푗푥 Because 푒 is cyclic, 푓1 = 푘 ⋅ 푓푠 + 푓1, where 푓1 is an arbitrary frequency, 푘 is any integer and 푓푠 is the sampling frequency (푇−1).

Spring 2013 Discrete time signals 20

20 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Frequency response

The frequency spectrum repeats. We can only 푓 uniquely represent frequencies from DC to 푠 (the 2 Nyquist frequency).

Important practical consequence: We must band limit the signal before sampling to avoid . A non-linear distortion.

Spring 2013 Discrete time signals 21

21 / 37

Frequency response

Spring 2013 Discrete time signals 22

22 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Frequency response

푓 If the signal contains frequencies beyond 푠, 2 sampling results in in aliasing. Images of the signal interfere.

Spring 2013 Discrete time signals 23

23 / 37

Sampling rate conversion

• Changing the sampling rate after sampling • We come back to this when discussing oversampled converters • = sampling faster than the Nyquist frequency would indicate • is increasing the sampling rate (number of samples per unit of time) • Downsampling is decreasing the sampling rate

Spring 2013 Discrete time signals 24

24 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Downsampling

Keep every n-th sample. Downsample too much: Aliasing

Spring 2013 Discrete time signals 25

25 / 37

Upsampling

Insert n zero valued samples between each original sample, and low-pass filter. Requires gain to maintain the signal level.

Spring 2013 Discrete time signals 26

26 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Discrete time filters

Analog filters use integrators, 푠−1, as building blocks to implement filter functions. Discrete time filters use delay, 푧−1.

Example: Time domain: 푦 푛 + 1 = 푏푥 푛 + 푎푦[푛] z-domain: 푧푌 푧 = 푏푋 푧 + 푎푌(푧)

푌 푧 푏 퐻 푧 ≡ = 푋 푧 푧 − 푎

Spring 2013 Discrete time signals 27

27 / 37

Discrete time filters

Frequency response, 푧 = 푒푗휔 (휔 normalized to the sampling frequency, really 푧 = 푒푗휔푇)

푏 퐻 푒푗휔 = 푒푗휔 − 푎

DC is 푧 = 푒푗0 = 1. The sampling frequency is 푧 = 푒푗2휋 = 1 (also). Sufficient to evaluate the frequency response from 0 to π due to symmetry (for real signals).

Spring 2013 Discrete time signals 28

28 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Stability

푦 푛 + 1 = 푏푥 푛 + 푎푦[푛]

If 푎 > 1, the output grows without bounds. Not stable. 푏 퐻 푧 = 푧 − 푎

In a stable system, all poles are inside the unit circle • 푎 = 1: Discrete time integrator • 푎 = −1: Oscillator

Spring 2013 Discrete time signals 29

29 / 37

IIR filters

푦 푛 + 1 = 푏푥 푛 + 푎푦[푛] is an infinite impulse response filter.

Single impulse input (푥 0 = 1, 0 otherwise) results in an output that decays towards zero, but (in theory) never reaches zero. If we try to characterize the filter by its impulse response, we need an infinite number of outputs to characterize it.

Spring 2013 Discrete time signals 30

30 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) FIR filters

1 푦 푛 = 푥 푛 + 푥 푛 − 1 + 푥 푛 − 2 3

Is a FIR ( filter).

2 1 퐻 푧 = 푧−푖 3 푖=0

FIR filters are inherently stable but require higher order (more delay elements) than IIR.

Spring 2013 Discrete time signals 31

31 / 37

Bilinear transform

• Mapping between continuous and discrete time • Design the filter as a continuous time transfer function and map it to the z-domain 푧−1 1+푠 푠 = , conversely, 푧 = 푧+1 1−푠 • 푠 = 0 maps to 푧 = 1 (DC) 푓 • 푠 = ∞ maps to 푧 = −1 푠 2 • First order approximation

Spring 2013 Discrete time signals 32

32 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Sample and hold

We modeled impulse sampling by letting 휏 → 0.

For the sample and hold, we use the same model, but let 휏 → 푇.

Use this to find the transfer function of SH

Spring 2013 Discrete time signals 33

33 / 37

Sample and hold

∞ 푘 1 − 푒−푠휏 퐹∗(푠) = 푓 푛푇 푒−푠푛푇 푠 푛=0 Impulse sampling ≈ 1

The pulse lasts for the full Sample and hold: sampling period, 푇

∞ 푘 1 − 푒−푠푇 퐹∗(푠) = 푓 푛푇 푒−푠푛푇 푠 푛=0 Spring 2013 Discrete time signals 34

34 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) Sample and hold

The sample and hold shapes spectrum

1 − 푒−푠푇 퐻 푠 ≡ 푆퐻 푠

Frequency (magnitude) response of the SH

sin 휔푇 2 퐻 푗휔 = 푇 푆퐻 휔푇 2

Spring 2013 Discrete time signals 35

35 / 37

Sample and hold

Sampled signal spectrum

Sample and hold sinc sin 푥 response, 푥

Spring 2013 Discrete time signals 36

36 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected]) References

Gregorian and Temes, Analog MOS Integrated Circuits for , Wiley, 1986

Spring 2013 Discrete time signals 37

37 / 37

INF4420 Spring 2013 Discrete time signals Jørgen Andreas Michaelsen ([email protected])