DIGITAL CONTROL SYSTEM WEEK 3 NUMERICAL APPROXIMATION Given the set of discrete values 𝑐 𝑁𝑇 , 𝑐 𝑁−1 𝑇 ,…,𝑐 0 , where 𝑁= 1,2,3,.., one defines the 𝑓𝑖𝑟𝑠𝑡−𝑏𝑎𝑐𝑘𝑤𝑎𝑟𝑑 Difference 𝛻𝑐 𝑁𝑇 =𝑐 𝑁𝑇 −𝑐 𝑁−1 𝑇 This permits its solution on a digital computer. Dr. Kalyana Veluvolu
𝑐 𝑘+1 𝑇 −𝑐 𝑘𝑇 = 𝑒 𝑘+1 𝑇 +𝑒(𝑘𝑇) 2 𝑇 Integral approximation of 𝑐 𝑡 = 0 𝑡 𝑒 𝑓 𝑑𝑓 First forward difference (Euler’s Technique) 𝑐 𝑘+1 𝑇 −𝑐 𝑘𝑇 =𝑇𝑒 𝑘𝑇 Trapezoidal: 𝑐 𝑘+1 𝑇 −𝑐 𝑘𝑇 = 𝑒 𝑘+1 𝑇 +𝑒(𝑘𝑇) 2 𝑇 Dr. Kalyana Veluvolu
Example: Evaluate 𝑐 𝑡 = 0 𝑡 𝑒 𝑓 𝑑𝑓 by a numerical integration technique 𝑐 𝑁𝑇 = 0 𝑁𝑇 𝑒 𝑓 𝑑𝑓 ≈ 𝑘=0 𝑁−1 𝑒 𝑘𝑇 ∆𝑡= 𝑘=0 𝑁−1 𝑇𝑒(𝑘𝑇) Dr. Kalyana Veluvolu
Notice that due to finite word length, Decreasing T increases N and hence the computation time required and increases the roundoff and truncation errors by use of recursive equation. If it is not small enough, aliasing or frequency folding problems will exist. Thus the selection of T is based on trade-off when all factors are considered Dr. Kalyana Veluvolu
SAMPLING AND SIGNAL RECONSTRUCTION (for Ideal Samplers) Continuous-time signals often need to be sampled for storage, transmission and processing. Applications are found in control and communications. Here we study how to sample a continuous–time signal, how to analyze a sampled signal, and how to reconstruct a continuous-time signal from its sampled version. Dr. Kalyana Veluvolu
Where T is the sampling period Sampling: Continuous-time signal: x(t), -∞<𝑡<∞ Sampled signal: x(nT), n = 0 ,±1,±2, … Where T is the sampling period Dr. Kalyana Veluvolu
Representation of sampled signal using impulse train function: Impulse train function: 𝑝 𝑡 = 𝑛=−∞ ∞ 𝛿(𝑡−𝑛𝑇) Sampled signal: 𝑥 𝑠 𝑡 =𝑥 𝑡 𝑝 𝑡 = 𝑛=−∞ ∞ 𝑥 𝑡 𝛿 𝑡−𝑛𝑇 = 𝑛=−∞ ∞ 𝑥(𝑛𝑇)𝛿(𝑡−𝑛𝑇) Dr. Kalyana Veluvolu
Fourier transform of sampled signal: Fourier series of pulse train function: Since p(t) is periodic, it can be expressed as Fourier series as below; 𝑝 𝑡 = 𝑘=−∞ ∞ 𝑐 𝑘 𝑒 𝑗𝑘 𝜔 𝑠 𝑡 Where 𝜔 𝑠 = 2𝜋 𝑇 is the sampling frequency in rad/sec. and 𝑐 𝑘 = 1 𝑇 −𝑇 2 𝑇 2 𝑝(𝑡) 𝑒 −𝑗 𝜔 𝑠 𝑡 𝑑𝑡= 1 𝑇 −𝑇 2 𝑇 2 𝛿 𝑡 𝑒 −𝑗𝑘 𝜔 𝑠 𝑑𝑡= 1 𝑇 Dr. Kalyana Veluvolu
And the sampled signal is rewritten as Hence, 𝑝 𝑡 = 𝑘=−∞ ∞ 1 𝑇 𝑒 𝑗𝑘 𝜔 𝑠 𝑡 And the sampled signal is rewritten as 𝑥 𝑠 𝑡 =𝑥 𝑡 𝑝 𝑡 = 𝑘=−∞ ∞ 1 𝑇 𝑥(𝑡) 𝑒 𝑗𝑘 𝜔 𝑠 𝑡 Using the property of multiplication by complex exp.: 𝑋 𝑠 𝜔 = 𝑘=−∞ ∞ 1 𝑇 𝑋(𝜔−𝑘 𝜔 𝑠 ) Sum of shifted Fourier transforms Dr. Kalyana Veluvolu
Graphical illustration: Dr. Kalyana Veluvolu
Aliasing: From the figure in previous page, we see that the shifted copies of 𝑋(𝜔) do not overlap if the sampling frequency is at least twice of the signal bandwidth, i.e.: 𝜔 𝑠 >2𝐵 If the sampling frequency is too low or the signal bandwidth is too high, it will result in aliasing (overlap of the shifted copies of 𝑋(𝜔)) as below. Dr. Kalyana Veluvolu
Signal Reconstruction: From the analysis above, we know that Fourier transform of the original signal, 𝑋(𝜔), can be perfectly reconstructed from the spectrum of the sampled signal if and only if To do so, we simply need to apply an ideal lowpass filter to cut the copies of 𝑋(𝜔) in 𝑋 𝑠 (𝜔). Since 𝑋(𝜔) and x(t) have a one-to-one relationship, we can also recover x(t) if and only if the above criterion is satisfied. This criterion is the famous Nyquist sampling criterion or Shannon sampling theorem. 𝝎 𝒔 >𝟐𝑩 Dr. Kalyana Veluvolu
Example: Consider the continuous-time signal 𝑒(𝑡)=sin( 𝑓 1 𝑡+𝑓) Which is sampled with a sampling time of 𝜔 1 = 𝜋 𝑇 , Where 0< 𝜔 1 < 𝜔 𝑠 2 .Thus letting 𝑡=𝑘𝑇 yields 𝑒 𝑡 = sin 𝑓 1 𝑘𝑇+𝑓 Next consider the continuous-time signal 𝑞 𝑡 = sin 𝑓 1 + 2𝜋𝑗 𝑇 𝑡+𝑓 Where j = 1,2,3... And which is sampled with the same sampling time T. 𝑞 𝑘𝑇 = sin 𝑓 1 + 2𝜋𝑗 𝑇 𝑘𝑇+𝑓 = sin 𝑘𝑇 𝑓 1 +2𝑘𝜋𝑗+𝑓 =sin(𝑘𝑇 𝑓 1 +𝑓) Dr. Kalyana Veluvolu
Comparing the equations reveals that they are identical Comparing the equations reveals that they are identical. Thus, it is impossible to differentiate between two sampled sinusoids whose radian frequencies differ by an integral multiple of 2𝜋 𝑇 . It must be avoided by selecting small-enough T in accordance with the Shannon sampling theorem 𝑓 𝑠 >2 𝜔 𝑠 𝑜𝑟 𝜋 𝑇 > 𝜔 𝑐 Effectively, all radian frequencies are then folded into the interval 0< 𝜔 1 < 𝜔 𝑠 2 .The frequency 2𝜋 𝑇 rad/s is commonly referred to as the folding Dr. Kalyana Veluvolu
Example: Voice signals over telephone lines Analog voice signals need to be sampled for digital transmission. A bandwidth of 4kHz is allocated for digital transmission. The analog voice signals has signal bandwidth up to 20kHz or so. So it needs to be lowpass filtered before sampling in order to avoid aliasing (i.e. overlapping of high frequencies signals with low frequency signals). Determine the cutoff frequency of the lowpass filter and the sampling frequency. Answer: cutoff freq <=4KHz, Sampling freq = 8kHz Dr. Kalyana Veluvolu
Formula for signal reconstruction (assuming no aliasing): Proof: we may recover 𝑋(𝜔) using the following lowpass filter. 𝐻 𝜔 = 𝑇, 0, Its impulse response is given by (see F.T. pairs table) ℎ 𝑡 = 𝐵𝑇 𝜋 𝑠𝑖𝑛𝑐 𝐵 𝜋 𝑡 𝑥 𝑡 = 𝐵𝑇 𝜋 𝑘=−∞ ∞ 𝑥 𝑛𝑇 𝑠𝑖𝑛𝑐 𝐵 𝜋 (𝑡−𝑛𝑇) −𝐵≤𝜔≤B otherwise Dr. Kalyana Veluvolu
The F.T of the filtered output is given by 𝑌(𝜔)=𝐻(𝜔) 𝑋 𝑆 (𝜔) Using the property of convolution, we get 𝑦 𝑡 =ℎ 𝑡 ∗ 𝑥 𝑠 𝑡 = −∞ ∞ 𝑥 𝑠 𝜏 ℎ 𝑡−𝜏 𝑑𝜏 Recall: 𝑥 𝑠 𝑡 =𝑥 𝑡 𝑝 𝑡 = 𝑛=−∞ ∞ 𝑥(𝑛𝑇)𝛿(𝑡−𝑛𝑇) We have : 𝑦 𝑡 = −∞ ∞ −∞ ∞ 𝑥 𝑛𝑇 𝛿 𝜏−𝑛𝑇 ℎ 𝑡−𝜏 𝑑𝜏 −∞ ∞ 𝑥(𝑛𝑇) −∞ ∞ 𝛿 𝜏−𝑛𝑇 ℎ 𝑡−𝜏 𝑑𝜏 = −∞ ∞ 𝑥 𝑛𝑇 ℎ 𝑡−𝑛𝑇 = 𝐵𝑇 𝜋 𝑛=−∞ ∞ 𝑥 𝑛𝑇 𝑠𝑖𝑛𝑐 𝐵 𝜋 (𝑡−𝑛𝑇) = Dr. Kalyana Veluvolu
NON-IDEAL SAMPLERS 𝑒 𝑝 ∗ 𝑡 =𝑝 𝑡 𝑒 𝑡 A modulation process: Dr. Kalyana Veluvolu
Sampled signal: Dr. Kalyana Veluvolu
Dr. Kalyana Veluvolu
IDEAL SAMPLER & LAPLACE TRANSFORM If the duration 𝛾 of the sampling pulse is much less than the sampling time T and the smallest time constant of e(t), the output of the pulse modulator can be approximated as an ideal impulse train. 𝑒 𝑝 ∗ 𝑡 ≈ 1 𝛾 𝑘=0 ∞ 𝑒 𝑘𝑇 [𝑢 𝑡−𝑘𝑇 −𝑢(𝑡−𝑘𝑇−𝛾)] Where 𝑒 𝑝 ∗ 𝑘𝑇 = 𝑒(𝑘𝑇) 𝑓 𝛾 0 𝑓𝑜𝑟 𝑘𝑇≤𝑡≤𝑘𝑇+ 𝑓 𝛾 𝑓𝑜𝑟 𝑘𝑇+𝑓≤𝑡≤𝑘𝑇+1 k = 0,1,2,3,…. Dr. Kalyana Veluvolu
Taking the Laplace transformation, 𝐸 𝑝 ∗(𝑠)≈ 𝑘=0 ∞ 𝑒 𝑘𝑇 1− 𝑒 −𝛾𝑠 𝛾𝑠 𝑒 −𝑘𝑇𝑠 Assuming 𝛾 is very small, such that 1− 𝑒 −𝛾𝑠 = 1−[1−𝛾𝑠+ 𝛾𝑠 2 2! − 𝛾𝑠 3 3! +…]≈𝛾𝑠 Then 𝐸 ∗ 𝑠 = 𝑘=0 ∞ 𝑒(𝑘𝑇) 𝑒 −𝑘𝑇𝑠 Dr. Kalyana Veluvolu
Z TRANSFORM The Laplace transform of a sampled function e*(t) is 𝐸 ∗ 𝑠 = 𝑘=0 ∞ 𝑒(𝑘𝑇) 𝑒 −𝑘𝑇𝑠 Let 𝑧≡ 𝑒 𝑇𝑠 𝑠= 1 𝑇 lnz We have the z transform: 𝐸 𝑧 = 𝐸 ∗ (𝑠) 𝑧= 𝑒 𝑇𝑠 = 𝑘=0 ∞ 𝑒(𝑘𝑇) 𝑧 −𝑘 That is, 𝐸 𝑧 =𝑍 𝑒 ∗ 𝑡 = 𝐸 ∗ (𝑠) 𝑧= 𝑒 𝑇𝑠 Dr. Kalyana Veluvolu
𝐸 𝑧 = 𝐾 𝑧− 𝑧 1 𝑧− 𝑧 2 …(𝑧− 𝑧 𝑤 ) 𝑧− 𝑝 1 𝑧− 𝑝 2 …(𝑧− 𝑝 𝑛 ) The z-transform as defined above is also called one-sided z-transform because the summation starts from 0. For most practical application, the one sided z-transform has a closed-form representation in its region of convergence. 𝐸 𝑧 = 𝐾( 𝑧 𝑤 + 𝑐 𝑤−1 𝑧 𝑤−1 +…+ 𝑐 1 𝑧+ 𝑐 0 ) 𝑧 𝑛 + 𝑑 𝑛−1 𝑧 𝑛−1 +…+ 𝑑 1 𝑧+ 𝑑 0 = 𝐾( 𝑧 −𝑛+𝑤 +…+ 𝑐 1 𝑧 −𝑛+1 + 𝑐 0 𝑧 −𝑛 ) 1+ 𝑑 𝑛−1 𝑧 −1 +…+ 𝑑 1 𝑛 −𝑛+1 + 𝑑 0 𝑧 −𝑛 Factoring the polynomials, yields 𝐸 𝑧 = 𝐾 𝑧− 𝑧 1 𝑧− 𝑧 2 …(𝑧− 𝑧 𝑤 ) 𝑧− 𝑝 1 𝑧− 𝑝 2 …(𝑧− 𝑝 𝑛 ) Where 𝑝 𝑗 and 𝑧 𝑖 are the poles and zeros of E(z) Dr. Kalyana Veluvolu
Example: Given 𝑒 𝑡 =𝑢 𝑡 , determine 𝐸(𝑧) 𝑒 ∗ 𝑡 = 𝑘=0 ∞ 𝛿 𝑡−𝑘𝑇 = 𝛿 𝑡 + 𝛿 𝑡−𝑇 + 𝛿 𝑡−2𝑇 +… 𝐸 ∗ 𝑠 =𝐿 𝑒 ∗ 𝑡 = 𝑘=0 ∞ 𝑒 −𝑘𝑇𝑠 =1+ 𝑒 −𝑇𝑠 + 𝑒 −2𝑇𝑠 + … The z-transform is given by 𝐸 𝑧 = 𝑘=0 ∞ 𝑧 −𝑘 =1+ 𝑧 −1 + 𝑧 −2 + 𝑧 −3 +… It is an open-form expression of E(z). The closed form is 𝐸 𝑧 = 1 1− 𝑧 −1 = 𝑧 𝑧−1 Note that the region of convergence is 𝑧 >1. Dr. Kalyana Veluvolu
Dr. Kalyana Veluvolu
Converting Laplace transform to z-transform Step 1: Perform a partial-fraction expansion on E(s). 𝐸 𝑠 = 𝐴 0 (𝑠+ 𝛼 0 ) + 𝐴 1 (𝑠+ 𝛼 1 ) +…+ 𝐴 𝑛 (𝑠+ 𝛼 𝑛 ) Step 2: Convert each term using the Transforms Table. 𝐸 𝑧 =𝑍 𝐸 𝑠 =𝑍 𝐴 0 (𝑠+ 𝛼 0 ) +𝑍 𝐴 1 (𝑠+ 𝛼 1 ) +…+𝑍 𝐴 𝑛 (𝑠+ 𝛼 𝑛 ) Dr. Kalyana Veluvolu
Example: Determine E(z) for the following: 𝐸 𝑠 = 5 𝑠(𝑠+1)(𝑠+5) Step 1: Partial fraction expansion 𝐸 𝑠 = 1 𝑠 − 1.25 𝑠+1 + 0.25 (𝑠+5) Step 2: Convert each term 𝐸 𝑧 = 𝑧 𝑧−1 − 1.25𝑧 𝑧− 𝑒 −𝑇 + 0.25𝑧 (𝑧− 𝑒 −5𝑇 ) Dr. Kalyana Veluvolu
SUMMARY Digital representation of continuous-time signals Linear time-invariant systems Sampled-data systems Sampling and signal reconstruction Shannon (Nyquist) sampling criterion Aliasing Laplace transform of sampled signals Z-transform Dr. Kalyana Veluvolu