Sampling Sampling: period = T y(k) d
@
y(t)
T
Example (single pole signal) â&#x2C6;&#x2019;at e , tâ&#x2030;Ľ0 Consider, y(t) = 0 t<0 Laplace transform: Sampled signal:
with a > 0.
1 . s+a
k
y(k) = y(t)
= eâ&#x2C6;&#x2019;akT = eâ&#x2C6;&#x2019;aT .
y(s) =
t=kT
Z-transform,
y(z) =
z . z â&#x2C6;&#x2019; eâ&#x2C6;&#x2019;aT
The s-plane pole is at s1 = â&#x2C6;&#x2019;a, and the corresponding z-plane pole is at z1 = eâ&#x2C6;&#x2019;aT . Roy Smith: ECE 147b 3: 1
Sampling Example: (second order) Now consider a damped sinusoidal signal, Laplace transform: Sampled signal:
Z-transform:
y(s) =
β , (s + ι)2 + β 2
y(k) = eâ&#x2C6;&#x2019;ÎąkT sin(βkT ),
y(t) = eâ&#x2C6;&#x2019;Îąt sin(βt),
t â&#x2030;Ľ 0, with Îą > 0.
Poles: s1,2 = â&#x2C6;&#x2019;Îą Âą jβ. k â&#x2030;Ľ 0.
z â&#x2C6;&#x2019;1 eâ&#x2C6;&#x2019;ÎąT sin(βT ) y(z) = . â&#x2C6;&#x2019;1 1 â&#x2C6;&#x2019; z 2eâ&#x2C6;&#x2019;ÎąT cos(βT ) + z â&#x2C6;&#x2019;2 eâ&#x2C6;&#x2019;2ÎąT
Z domain poles given by: z 2 â&#x2C6;&#x2019; 2eâ&#x2C6;&#x2019;ÎąT cos(βT )z + eâ&#x2C6;&#x2019;2ÎąT = 0. q z1,2 = eâ&#x2C6;&#x2019;ÎąT cos(βT ) Âą e2ÎąT cos2 (βT ) â&#x2C6;&#x2019; eâ&#x2C6;&#x2019;2ÎąT p = eâ&#x2C6;&#x2019;ÎąT cos(βT ) Âą j 1 â&#x2C6;&#x2019; cos2 (βT )
Imaginary z-plane
eâ&#x2C6;&#x2019;ÎąT
βT Real
= eâ&#x2C6;&#x2019;ÎąT (cos(βT ) Âą j sin(βT )) = eâ&#x2C6;&#x2019;ÎąT eÂąjβT = e(â&#x2C6;&#x2019;ι¹jβ)T .
Roy Smith: ECE 147b 3: 2
Sampling General case: Sampling maps the s-domain poles to the z-domain via: zi = esi T . Stable continuous-time signals (Re {si } < 0) map to stable discrete-time signals (|zi | < 1). Pole locations under sampling: Imaginary
s-plane
Imaginary
z-plane
ω = π/T
1 Real
Real
ω = -π/T
Roy Smith: ECE 147b 3: 3
Sampling Sampled pole locations: (in detail) z-plane
Imaginary
N=4 N=3
N=5
ω n = 0.6π/T
ζ = 0.1 ωn = 0.3π/T
ω n = 0.7π/T ζ = 0.2
N=8 ζ = 0.3 ω n = 0.2π/T
ωn = 0.8π/T
N = 20
ωn = 0.9π/T
N=2
ζ = 0.9
Real
ω n = π/T
-1.0
-0.5
0
0.5
1.0
Changing the sampling frequency. (recall that zi = esi T . ) Decreasing T : decrease decay rate (r → 1) decrease oscillation frequency (θ → 0) poles track constant damping curves towards 1 This is simply because there are more samples taken in the same time period. Roy Smith: ECE 147b 3: 4
Sampling Sample rate effects: zi = esi T , changing T changes the pole positions. 1.2
Continuous closed-loop system step response:
1.0
0.8
T1 = 0.25 seconds
G(s) =
T2 = 0.11 seconds
0.6
s2
ωn2 + 2ζωn s + ωn2
ζ = 0.6,
0.4
ωn = 5 rad./sec., s1,2 = −3 ± 4i.
0.2
0
0.5
1.0
1.5 Time [seconds]
z-plane
2.0
Imaginary
N=4 N=3
2.5
N=5
ω n = 0.6π/T
ζ = 0.1 ωn = 0.3π/T
ω n = 0.7π/T
ζ = 0.2
Discrete pole positions:
N=8 ζ = 0.3 ω n = 0.2π/T
ωn = 0.8π/T
N = 20
ωn = 0.9π/T
N=2
ζ = 0.9
Real
ω n = π/T
-1.0
-0.5
0
0.5
Period T1 : z1,2 = 0.255 ± 0.398i Period T2 : z1,2 = 0.650 ± 0.306i
1.0
Roy Smith: ECE 147b 3: 5
Aliasing Aliasing: What happens to signals of high frequencies (ω > π/T ) ? As zi = esi T , sinusoids of frequencies from -π/T to π/T radians/second are mapped onto the unit disk by sampling. Consider
y(t) = sin ω1 t,
which has Laplace transform:
ω1 . s2 + ω12
y(s) =
Poles are s1,2 = ±jω1 .
Imaginary z-plane
Sample at period T :
y(k) = sin ω1 kT , −jω1T
e jωaT = e
Z-transform:
y(z) =
z sin w1 T . z 2 − 2 cos ω1 T z + 1 ±jω1 T
Poles of y(z) are z1,2 = e
.
ωaT
Real 1
-1
−ω1T
Slow sampling, T > π/ω1 , implies that ω1 T > π. The pole angle is greater than π.
Roy Smith: ECE 147b 3: 6
Aliasing Having w1 T > π, means that, e−jω1 T = ej(2π−ω1 T ) ,
and ejω1 T = e−j(2π−ω1 T ) .
Now, if (2π − ω1 T ) lies in the range 0 to π radians, the pole pattern is identical to that of a sinusoid of a lower frequency, ωa , where ωa T = 2π − ω1 T. 2π Equivalently, the apparent frequency is, ωa = − ω1 . (sampling freq: 2π/T rad/sec). T
Example: 55 Hz Signal: y(t) = cos(2π55t) Sampling frequency: 1/T = 60 Hz Then y(k) = cos(2π55t)|t=kT = cos(2π5t)|t=kT Indistinguishable from a sampled 5 Hz signal!
Roy Smith: ECE 147b 3: 7
Aliasing Example: 55 Hz signal sampled at 60 Hz
1.5
Apparent (5 Hz) signal
Original (55 Hz) signal
1 0.5 0
0.1
0.2 time [seconds]
0.5 1 Sample points 1.5
Roy Smith: ECE 147b 3: 8
Aliasing Sampled signals The unit disk can only represent signals of frequency up to 1/2 the sampling frequency. (Nyquist frequency). Sampling operation maps signal poles via: zi = esi T . Maps the horizontal strip from −jπ/T to jπ/T onto the whole z-plane. s-plane
Imaginary
π/T
z-plane
Imaginary
Mapping via sampling 1
-1 Real
Real
−π/T
And Re {s} < 0 in this strip maps to the inside of the unit disk.
Roy Smith: ECE 147b 3: 9
Aliasing Aliasing: (ambiguous mapping of higher frequency signals) Sampling also maps the next strip (from jπ/T to j3π/T ) onto the whole z-plane and adds it into the result. Imaginary 3π/T Imaginary
Mapping via sampling π/T -1 Real
1 Real
−π/T s-plane
z-plane
Also true for all (infinite) 2π/T wide strips above and below the lowest frequency strip.
Roy Smith: ECE 147b 3: 10
Aliasing Consequences of aliasing: â&#x20AC;˘ Ambiguity. Our computer/controller cannot distinguish between frequencies inside the â&#x2C6;&#x2019;Ď&#x20AC;/T to Ď&#x20AC;/T range and those outside of it. â&#x20AC;&#x201C; Controller will respond incorrectly to an aliased signal (e.g. disturbance or error). â&#x20AC;&#x201C; An aliased signal cannot be reconstructed (signal processing). Amelioration of the problem: y(k) e
@ @
F (s)
y(t)
T
â&#x20AC;˘ Anti-aliasing filter. Low pass, rejecting |Ď&#x2030;| > Ď&#x20AC;/T . â&#x20AC;&#x201C; High frequency signals no longer enter loop erroneously. â&#x20AC;&#x201C; High frequency disturbances/errors are â&#x20AC;&#x153;invisible.â&#x20AC;? â&#x20AC;&#x201C; Filter adds phase lag to the loop. (Potentially destabilizing!) Roy Smith: ECE 147b 3: 11