You are on page 1of 57
UEEA 2183 DIGITAL SIGNAL PROCESSING JAN 2016 1 TOPIC 2 Discrete-Time Signal and System 2 Frequency of Sinusoidal Sequences • Consider 𝑥𝑥1 𝑛𝑛 = cos 𝜔𝜔1 𝑛𝑛 + 𝜙𝜙 and 𝑥𝑥2 𝑛𝑛 = cos 𝜔𝜔2 𝑛𝑛 + 𝜙𝜙 with 0 ≤ 𝜔𝜔1 < 2𝜋𝜋 and 2𝜋𝜋𝑘𝑘 ≤ 𝜔𝜔2 ≤ 2𝜋𝜋 𝑘𝑘 + 1 where k is any positive integer. • If 𝜔𝜔2 = 𝜔𝜔1 + 2𝜋𝜋𝜋𝜋, then 𝑥𝑥2 𝑛𝑛 = cos 𝜔𝜔2 𝑛𝑛 + 𝜙𝜙 = cos 𝜔𝜔1 + 2𝜋𝜋𝜋𝜋 𝑛𝑛 + 𝜙𝜙 = cos 𝜔𝜔1 𝑛𝑛 + 𝜙𝜙 + 2𝜋𝜋𝜋𝜋𝜋𝜋 = cos 𝜔𝜔1 𝑛𝑛 + 𝜙𝜙 = 𝑥𝑥1 𝑛𝑛 3 Frequency of Sinusoidal Sequences • Thus, 𝑥𝑥1 𝑛𝑛 = cos 𝜔𝜔𝑛𝑛 is the same as 𝑥𝑥2 𝑛𝑛 = cos 𝜔𝜔𝑛𝑛 + 2𝜋𝜋𝜋𝜋 where k is an integer. • It is similar to cos 𝜃𝜃 = cos 𝜃𝜃 + 2𝜋𝜋𝜋𝜋 , i.e., a cosine function is the same when it is shifted by integer values of 2π. • E.g., the signal 𝑥𝑥1 𝑛𝑛 = cos 0.1𝜋𝜋𝑛𝑛 is the same as the signal 𝑥𝑥2 𝑛𝑛 = cos 2.1𝜋𝜋𝑛𝑛 = cos 0.1𝜋𝜋𝑛𝑛 + 2𝜋𝜋𝜋𝜋 . • E.g. 𝑥𝑥3 𝑛𝑛 = cos 1.9𝜋𝜋𝑛𝑛 = cos 2𝜋𝜋𝜋𝜋 − 0.1𝜋𝜋𝑛𝑛 = cos 2𝜋𝜋𝑛𝑛 cos 0.1𝜋𝜋𝑛𝑛 + sin 2𝜋𝜋𝑛𝑛 sin 0.1𝜋𝜋𝑛𝑛 = cos 0.1𝜋𝜋𝑛𝑛 = 𝑥𝑥1 𝑛𝑛 4 Frequency of Sinusoidal Sequences • Consider 𝑥𝑥1 𝑛𝑛 = cos 𝜔𝜔1 𝑛𝑛 and 𝑥𝑥2 𝑛𝑛 = cos 𝜔𝜔2 𝑛𝑛 with 0 ≤ 𝜔𝜔1 < 𝜋𝜋 and 𝜋𝜋 ≤ 𝜔𝜔2 ≤ 2𝜋𝜋. • Let 𝜔𝜔2 = 2𝜋𝜋 − 𝜔𝜔1 , then 𝑥𝑥2 𝑛𝑛 = cos 2𝜋𝜋𝑛𝑛 − 𝜔𝜔1 𝑛𝑛 = cos 𝜔𝜔1 𝑛𝑛 = 𝑥𝑥1 𝑛𝑛 • Hence, a sinusoidal sequence with 𝜔𝜔2 in the range 𝜋𝜋 ≤ 𝜔𝜔2 ≤ 2𝜋𝜋 assumes the identity of a sinusoidal sequence with 𝜔𝜔1 = 2𝜋𝜋 − 𝜔𝜔2 in the range 0 ≤ 𝜔𝜔1 < 𝜋𝜋. • The frequency π is called the folding frequency. 5 Frequency of Sinusoidal Sequences 6 Frequency of Sinusoidal Sequences • The frequency of oscillation of 𝑥𝑥 𝑛𝑛 = A cos 𝜔𝜔𝑜𝑜 𝑛𝑛 increases as 𝜔𝜔𝑜𝑜 increases from 0 to π, and then the frequency of oscillation decreases as 𝜔𝜔𝑜𝑜 increases from π to 2π. • Therefore, for discrete-time sinusoidal sequence, the highest frequency possible is 𝜔𝜔 = ±𝜋𝜋 radians/sample. At this frequency, there are 2 samples for 1 complete cycle. 7 Frequency of Sinusoidal Sequences • The time variable, t of the continuous-time signal is related to the time variable, n of the discrete-time signal only at discrete-time instant, tn given by 𝑛𝑛 2𝜋𝜋𝜋𝜋 𝑡𝑡𝑛𝑛 = 𝑛𝑛𝑇𝑇𝑠𝑠 = = 𝑓𝑓𝑠𝑠 𝜔𝜔𝑠𝑠 where Ts = sampling interval 1 fs = sampling frequency, 𝑓𝑓𝑠𝑠 = 𝑇𝑇𝑠𝑠 𝜔𝜔𝑠𝑠 = sampling angular frequency, 𝜔𝜔𝑠𝑠 = 2𝜋𝜋𝑓𝑓𝑠𝑠 8 Frequency of Sinusoidal Sequences • Given 𝑥𝑥 𝑡𝑡 = 𝐴𝐴 sin 2𝜋𝜋𝜋𝜋𝜋𝜋 = 𝐴𝐴 sin 𝛺𝛺𝑡𝑡 . The corresponding discrete-time signal is 𝑛𝑛2𝜋𝜋𝜋𝜋 𝑥𝑥 𝑛𝑛 = 𝐴𝐴 sin 𝛺𝛺𝑛𝑛𝑇𝑇𝑠𝑠 = 𝐴𝐴 sin = 𝐴𝐴 sin 𝜔𝜔𝜔𝜔 𝑓𝑓𝑠𝑠 where 𝜔𝜔 = 2𝜋𝜋𝜋𝜋 𝑓𝑓𝑠𝑠 = 𝛺𝛺𝑇𝑇𝑠𝑠 is the normalized angular frequency of 𝑥𝑥 𝑛𝑛 (unit is radians per sample). • Analog sinusoidal functions with different frequencies may have the identical sampled signals with same period. 9 Frequency of Sinusoidal Sequences • E.g. sin 0.3𝜋𝜋𝜋𝜋 and sin 0.1𝜋𝜋𝜋𝜋 have the same period 2𝜋𝜋 20 2𝜋𝜋 20 20Ts = 𝑎𝑎𝑎𝑎𝑎𝑎 = , even though sin 0.3𝜋𝜋𝜋𝜋 0.3𝜋𝜋 3 0.1𝜋𝜋 1 has a rate of change 3 times as fast as sin 0.1𝜋𝜋𝜋𝜋 . • E.g. Consider 3 sequences generated by uniformly sampling the 3 cosine functions of frequencies 3 Hz, 7 Hz and 13 Hz, respectively with sampling rate of 10 Hz. 𝑔𝑔1 𝑡𝑡 = cos 6𝜋𝜋𝜋𝜋 , 𝑔𝑔1 𝑛𝑛 = cos 0.6𝜋𝜋𝜋𝜋 𝑔𝑔2 𝑡𝑡 = cos 14𝜋𝜋𝜋𝜋 , 𝑔𝑔2 𝑛𝑛 = cos 1.4𝜋𝜋𝜋𝜋 𝑔𝑔3 𝑡𝑡 = cos 26𝜋𝜋𝜋𝜋 , 𝑔𝑔3 𝑛𝑛 = cos 2.6𝜋𝜋𝜋𝜋 10 Frequency of Sinusoidal Sequences 𝑔𝑔1 𝑡𝑡 = solid line, 𝑔𝑔2 𝑡𝑡 = dashed line, 𝑔𝑔3 𝑡𝑡 = dashed-dot line 11 Frequency of Sinusoidal Sequences • From the plots, each sequence has exactly the same sample value for any given n. • It can be verified that 𝑔𝑔2 𝑛𝑛 = cos 1.4𝜋𝜋𝜋𝜋 = cos 2𝜋𝜋 − 0.6𝜋𝜋 𝑛𝑛 = cos 0.6𝜋𝜋𝜋𝜋 𝑔𝑔3 𝑛𝑛 = cos 2.6𝜋𝜋𝜋𝜋 = cos 2𝜋𝜋 + 0.6𝜋𝜋 𝑛𝑛 = cos 0.6𝜋𝜋𝜋𝜋 Therefore, 𝑔𝑔1 𝑛𝑛 , 𝑔𝑔2 𝑛𝑛 and 𝑔𝑔3 𝑛𝑛 are identical. • A continuous-time sinusoidal signal of higher frequency acquiring the identity of a sinusoidal sequence of lower frequency after sampling is called aliasing. 12 Frequency of Sinusoidal Sequences • Given 𝑥𝑥𝑎𝑎 𝑡𝑡 = 𝐴𝐴 cos 2𝜋𝜋𝜋𝜋𝜋𝜋 and 𝑥𝑥 𝑛𝑛 = 𝐴𝐴 cos 2𝜋𝜋𝜋𝜋𝜋𝜋𝑇𝑇𝑠𝑠 . • In general, the family of continuous-time sinusoids 𝑥𝑥𝑎𝑎,𝑘𝑘 𝑡𝑡 = 𝐴𝐴 cos ±2𝜋𝜋𝜋𝜋𝜋𝜋 + 2𝜋𝜋𝑓𝑓𝑠𝑠 𝑘𝑘𝑡𝑡 , k = 0, ±1, ±2, … leads to identical sampled signals: 2𝜋𝜋𝜋𝜋 𝑥𝑥𝑎𝑎,𝑘𝑘 𝑛𝑛𝑇𝑇𝑠𝑠 = 𝐴𝐴 cos 2𝜋𝜋𝜋𝜋𝜋𝜋𝑇𝑇𝑠𝑠 + 𝑛𝑛𝑇𝑇𝑠𝑠 𝑇𝑇𝑠𝑠 = 𝐴𝐴 cos 2𝜋𝜋𝜋𝜋𝜋𝜋𝑇𝑇𝑠𝑠 + 2𝜋𝜋𝜋𝜋𝜋𝜋 = 𝐴𝐴 cos 2𝜋𝜋𝜋𝜋𝜋𝜋𝑇𝑇𝑠𝑠 = 𝑥𝑥 𝑛𝑛 13 Frequency of Sinusoidal Sequences • E.g. sin 0.1𝜋𝜋𝜋𝜋 with sampling period Ts = 1 (fs = 1) can have the following continuous-time sinusoids: sin 𝛺𝛺𝑡𝑡 + 2𝜋𝜋𝑓𝑓𝑠𝑠 𝑘𝑘𝑘𝑘 = sin 0.1𝜋𝜋𝜋𝜋 + 2𝜋𝜋 1 𝑘𝑘𝑘𝑘 = sin 0.1𝜋𝜋𝜋𝜋 − 2𝜋𝜋𝜋𝜋 when k = -1 = sin 0.1𝜋𝜋𝜋𝜋 when k = 0 = sin 0.1𝜋𝜋𝜋𝜋 + 2𝜋𝜋𝜋𝜋 when k =1 which are sin 0.1𝜋𝜋𝜋𝜋 , sin 2.1𝜋𝜋𝜋𝜋 , sin −1.9𝜋𝜋𝜋𝜋 and so on. 𝜔𝜔 0.1𝜋𝜋 where 𝛺𝛺 = = = 0.1𝜋𝜋 𝑇𝑇𝑠𝑠 1 • Since 0.1π has the smallest magnitude, the frequency of 14 the digital sinusoid sin 0.1𝜋𝜋𝜋𝜋 is 0.1π rad/s. Frequency of Sinusoidal Sequences • Since −π ≤ 𝜔𝜔 ≤ 𝜋𝜋 −π ≤ 𝛺𝛺𝑇𝑇𝑠𝑠 ≤ 𝜋𝜋 𝜋𝜋 𝜋𝜋 − ≤ 𝛺𝛺 ≤ 𝑇𝑇𝑠𝑠 𝑇𝑇𝑠𝑠 where 𝜔𝜔 = digital frequency 𝛺𝛺 = analog frequency • Relationship of the frequencies between digital and Digital analog sinusoid. ω/T __ π Ts __ - 2π T s π 0 - __ Ts π - __ Ts s __ π Ts Analog 2π __ Ts Ω 15 Frequency of Sinusoidal Sequences Example 1 Find the frequency of the digital signal sin 4.4𝜋𝜋𝜋𝜋 sampling period is Ts = 0.1. Solution sin 4.4𝜋𝜋𝜋𝜋 = sin 4𝜋𝜋 + 0.4𝜋𝜋 𝑛𝑛 = sin 0.4𝜋𝜋𝜋𝜋 𝜔𝜔 = Ω𝑇𝑇𝑠𝑠 𝜔𝜔 0.4𝜋𝜋 Ω= = = 4𝜋𝜋 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠 𝑇𝑇𝑠𝑠 0.1 if the 16 Frequency of Sinusoidal Sequences Example 2 Determine the discrete-time signal v[n] obtained by uniformly sampling a continuous-time signal va(t) composed of a weighted sum of 5 sinusoidal signals of frequencies 30 Hz, 150 Hz, 170 Hz, 250 Hz and 330 Hz, at a sampling rate of 200 Hz, as given below: 𝑣𝑣𝑎𝑎 𝑡𝑡 = 6 cos 60𝜋𝜋𝜋𝜋 + 3 sin 300𝜋𝜋𝜋𝜋 + 2 cos 340𝜋𝜋𝜋𝜋 + 4 cos 500𝜋𝜋𝜋𝜋 + 10 sin 660𝜋𝜋𝜋𝜋 17 Frequency of Sinusoidal Sequences Solution 𝜔𝜔 = Ω𝑇𝑇𝑠𝑠 = Ω 𝑓𝑓𝑠𝑠 = Ω 200 𝑣𝑣 𝑛𝑛 = 6 cos 0.3𝜋𝜋𝑛𝑛 + 3 sin 1.5𝜋𝜋𝑛𝑛 + 2 cos 1.7𝜋𝜋𝑛𝑛 + 4 cos 2.5𝜋𝜋𝑛𝑛 + 10 sin 3.3𝜋𝜋𝑛𝑛 = 6 cos 0.3𝜋𝜋𝜋𝜋 + 3 sin 2𝜋𝜋 − 0.5𝜋𝜋 𝑛𝑛 + 2 cos 2𝜋𝜋 − 0.3𝜋𝜋 𝑛𝑛 + 4 cos 2𝜋𝜋 + 0.5𝜋𝜋 𝑛𝑛 + 10 sin 4𝜋𝜋 − 0.7𝜋𝜋 𝑛𝑛 = 6 cos 0.3𝜋𝜋𝜋𝜋 − 3 sin 0.5𝜋𝜋𝜋𝜋 + 2 cos 0.3𝜋𝜋𝜋𝜋 + 4 cos 0.5𝜋𝜋𝜋𝜋 − 10 sin 0.7𝜋𝜋𝜋𝜋 = 8 cos 0.3𝜋𝜋𝜋𝜋 + 5 cos 0.5𝜋𝜋𝜋𝜋 + 0.6435 − 10 sin 0.7𝜋𝜋𝜋𝜋 18 Frequency of Sinusoidal Sequences • The components 3 sin 1.5𝜋𝜋𝜋𝜋 , 2 cos 1.7𝜋𝜋𝜋𝜋 , 4 cos 2.5𝜋𝜋𝜋𝜋 , 10 sin 3.3𝜋𝜋𝜋𝜋 have been aliased into the components −3 sin 0.5𝜋𝜋𝜋𝜋 , 2 cos 0.3𝜋𝜋𝜋𝜋 , 4 cos 0.5𝜋𝜋𝜋𝜋 , −10 sin 0.7𝜋𝜋𝜋𝜋 . • The resulting discrete-time sequence composed of only 3 sinusoidal sequences of 𝜔𝜔 : 0.3π, 0.5π and 0.7π. 19 Frequency of Sinusoidal Sequences • Identical discrete-time signal is also generated by uniformly sampling at a 200 Hz sampling rate the following continuous-time signals: 𝑤𝑤𝑎𝑎 𝑡𝑡 = 8 cos 60𝜋𝜋𝜋𝜋 + 5 cos 100𝜋𝜋𝜋𝜋 + 0.6435 −10 sin 140𝜋𝜋𝜋𝜋 and 𝑢𝑢𝑎𝑎 𝑡𝑡 = 2 cos 60𝜋𝜋𝜋𝜋 + 4 cos 100𝜋𝜋𝜋𝜋 + 10 sin 260𝜋𝜋𝜋𝜋 + 6 cos 460𝜋𝜋𝜋𝜋 + 3 sin 700𝜋𝜋𝜋𝜋 20 Linear Systems • A linear system obeys the homogeneity and superposition principles. • Homogeneity means if the system output is 𝑦𝑦 𝑛𝑛 given input 𝑥𝑥 𝑛𝑛 , then given input 𝑎𝑎𝑎𝑎 𝑛𝑛 , the output is a𝑦𝑦 𝑛𝑛 . • Superposition principle states that if input 𝑥𝑥1 𝑛𝑛 and 𝑥𝑥2 𝑛𝑛 produces output 𝑦𝑦1 𝑛𝑛 and 𝑦𝑦2 𝑛𝑛 respectively, then an input of 𝑥𝑥1 𝑛𝑛 + 𝑥𝑥2 𝑛𝑛 produce an output 𝑦𝑦1 𝑛𝑛 + 𝑦𝑦2 𝑛𝑛 . • Thus a linear system fed with the input a𝑥𝑥1 𝑛𝑛 + 𝑏𝑏𝑏𝑏2 𝑛𝑛 will produce the output a𝑦𝑦1 𝑛𝑛 + b𝑦𝑦2 𝑛𝑛 . 21 Linear Systems • A useful property of linear systems is frequency preservation. If the input contains several frequencies, then the output will contain only those frequencies. • Non-linear system does not preserve frequencies. E.g. 𝑦𝑦 𝑛𝑛 = 𝑥𝑥 𝑛𝑛 2 . With 𝑥𝑥 𝑛𝑛 = sin 𝑛𝑛𝜔𝜔 , 1 − cos 2𝑛𝑛𝜔𝜔 2 𝑦𝑦 𝑛𝑛 = 𝑠𝑠𝑠𝑠𝑠𝑠 𝑛𝑛𝜔𝜔 = 2 which does not contain the original frequency 𝜔𝜔. 22 Time Invariant Systems • A time invariant system is one where system properties do not change with time. • The only effect of time-shifting an input will just result in a corresponding time-shift of the output. • An example of a time-invariant system with output 𝑦𝑦 𝑛𝑛 = 𝑥𝑥 𝑛𝑛 + 2𝑥𝑥 𝑛𝑛 − 1 If the input is delayed by 𝑛𝑛0 , then the output is 𝑥𝑥 𝑛𝑛 − 𝑛𝑛0 + 2𝑥𝑥 𝑛𝑛 − 𝑛𝑛0 − 1 = 𝑦𝑦 𝑛𝑛 − 𝑛𝑛0 which is the output delayed by 𝑛𝑛0 . 23 Time Invariant Systems • An example of a time-dependent system with output 𝑦𝑦 𝑛𝑛 = 𝑥𝑥 𝑛𝑛 − 1 + 0.5𝑛𝑛 𝑥𝑥 𝑛𝑛 If the input is delayed by 𝑛𝑛0 , then the output is 𝑥𝑥 𝑛𝑛 − 𝑛𝑛0 − 1 + 0.5𝑛𝑛 𝑥𝑥 𝑛𝑛 − 𝑛𝑛0 ≠ 𝑦𝑦 𝑛𝑛 − 𝑛𝑛0 • Time invariant system also preserves frequencies. • Time-shifting the input frequency components will only affect the phase of the output components. 24 Time Invariant Systems • Linear Time-Invariant (LTI) systems are easy to analyze, since Fourier techniques allow us to decompose any signals into sums of sinusoids. The output is a weighted sum of the same sinusoids shifted in phase. • The time-invariance property ensures that for a specified input, the output of the system is independent of the time the input is being applied. 25 Other System Properties • LTI systems also possess the properties of association and commutation. • The associative property allows us to break a big system into smaller ones and analyse separately. • The commutative property means that the order of cascaded subsystems in a large system can be rearranged without affecting the final output. • Causal systems are those where there is no output until the application of an input. 26 Other System Properties • Thus the present output of causal systems only depends on present and past samples of the input. • Changes in output samples do not precede changes in the input samples. • A stable system is one which produces a finite or bounded output if the input is bounded. • Such systems are sometimes described as bounded input bounded output (BIBO). 27 Other System Properties • E.g. Given an output 𝑛𝑛 𝑦𝑦 𝑛𝑛 = 𝛼𝛼 𝑛𝑛+1 𝑦𝑦 −1 + � 𝛼𝛼 𝑖𝑖 , 𝑖𝑖=0 where 𝑦𝑦 −1 = initial condition. If 𝛼𝛼 > 1, lim 𝑦𝑦 𝑛𝑛 = ∞ 𝑛𝑛 ≥ 0 𝑛𝑛→∞ The system is unstable since the output is unbounded given a bounded input. 28 Other System Properties • E.g. Given the output of the M-point moving average filter 𝑀𝑀−1 1 𝑦𝑦 𝑛𝑛 = � 𝑥𝑥 𝑛𝑛 − 𝑘𝑘 𝑀𝑀 𝑘𝑘=0 For a bounded input 𝑥𝑥 𝑛𝑛 < 𝐵𝐵𝑥𝑥 𝑀𝑀−1 1 � 𝑥𝑥 𝑛𝑛 − 𝑘𝑘 𝑦𝑦 𝑛𝑛 = 𝑀𝑀 𝑘𝑘=0 𝑀𝑀−1 1 1 ≤ � 𝑥𝑥 𝑛𝑛 − 𝑘𝑘 < 𝑀𝑀𝐵𝐵𝑥𝑥 < 𝐵𝐵𝑥𝑥 𝑀𝑀 𝑀𝑀 𝑘𝑘=0 indicating that the system is BIBO stable. 29 Other System Properties • An invertible system is one where 𝑦𝑦 𝑛𝑛 can be used to determine 𝑥𝑥 𝑛𝑛 . • An example of a non-invertible system is one with 𝑦𝑦 𝑛𝑛 = 𝑥𝑥 𝑛𝑛 2 . If output is 4, input can be ±2. • A memoryless system is one where the output depends only on the present input. 30 Digital Signals as Sum of Impulses • Any digital signal can be represented as a series of impulses, 𝑥𝑥 𝑛𝑛 = ⋯ + 𝑥𝑥 −2 𝛿𝛿 𝑛𝑛 + 2 + 𝑥𝑥 −1 𝛿𝛿 𝑛𝑛 + 1 + 𝑥𝑥 0 𝛿𝛿 𝑛𝑛 or +𝑥𝑥 1 𝛿𝛿 𝑛𝑛 − 1 + 𝑥𝑥 2 𝛿𝛿 𝑛𝑛 − 2 + ⋯ For causal signals, ∞ 𝑥𝑥 𝑛𝑛 = � 𝑥𝑥 𝑘𝑘 𝛿𝛿 𝑛𝑛 − 𝑘𝑘 𝑘𝑘=−∞ ∞ 𝑥𝑥 𝑛𝑛 = � 𝑥𝑥 𝑘𝑘 𝛿𝛿 𝑛𝑛 − 𝑘𝑘 𝑘𝑘=0 31 Digital Signals as Sum of Impulses • In graphical form, the signal 𝑥𝑥 𝑛𝑛 … -1 x[n] … … -1 0 1 n x[-1] δ[n+1] … 1 x[0] δ[n] … … -1 is just a sum of the various weighted impulses: 0 n 0 1 x[1] δ[n-1] … … -1 0 1 n n 32 Impulse Response • When the unit impulse, 𝛿𝛿 𝑛𝑛 is inputted into an LTI system, the output is called the natural or impulse response, ℎ 𝑛𝑛 of the system. 0 n LTI System 0 n 33 Impulse Response Example 3 Work out the first 4 sample values of the impulse response from the filter shown. x[n] y[n] + _ -0.9 z-1 Solution Here, 𝑦𝑦 𝑛𝑛 = −0.9𝑦𝑦 𝑛𝑛 − 1 + 𝑥𝑥 𝑛𝑛 By setting 𝑥𝑥 𝑛𝑛 = 𝛿𝛿 𝑛𝑛 , the impulse response is ℎ 𝑛𝑛 = −0.9ℎ 𝑛𝑛 − 1 + 𝛿𝛿 𝑛𝑛 34 Impulse Response The system is causal. Therefore, ℎ 0 = −0.9ℎ 𝑛𝑛 − 1 + 𝛿𝛿 0 = 0 + 1 = 1 ℎ 1 = −0.9ℎ 0 + 𝛿𝛿 1 = −0.9 1 + 0 = −0.9 ℎ 2 = −0.9ℎ 1 + 𝛿𝛿 2 = −0.9 −0.9 + 0 = 0.81 ℎ 3 = −0.9ℎ 2 + 𝛿𝛿 3 = −0.9 0.81 + 0 = −0.729 The impulse response oscillates about zero and decays as time passes by. 35 Digital Convolution • Consider the digital signal 𝑥𝑥 𝑛𝑛 shown: 1 2 0 3 x[n] n -1 2 1 0 h[n] n -1 • Suppose it is passed through an LTI system with impulse response ℎ 𝑛𝑛 shown: 36 Digital Convolution • The output due to the first non-zero component of 𝑥𝑥 𝑛𝑛 is ℎ 𝑛𝑛 weighted by 𝑥𝑥 −1 and shifted left one step because of homogeneity and time invariance properties of LTI systems. • The next output due to the second non-zero component of 𝑥𝑥 𝑛𝑛 is ℎ 𝑛𝑛 weighted by 𝑥𝑥 0 with no time shift. 1 2 0 -1 4 x[-1] h[n+1] 2 x[0] h[n] n n 0 -2 37 Digital Convolution • Similarly the output due to 𝑥𝑥 1 is 𝑥𝑥 1 ℎ 𝑛𝑛 − 1 , and the output due to the last non-zero input component is 𝑥𝑥 2 ℎ 𝑛𝑛 − 2 . • Since the LTI system also obeys the superposition principle, the total non-zero output due to 𝑥𝑥 𝑛𝑛 is 𝑦𝑦 𝑛𝑛 = 𝑥𝑥 −1 ℎ 𝑛𝑛 + 1 + 𝑥𝑥 0 ℎ 𝑛𝑛 + 𝑥𝑥 1 ℎ 𝑛𝑛 − 1 + 𝑥𝑥 2 ℎ 𝑛𝑛 − 2 38 Digital Convolution 1 2 x[-1] h[n+1] 0 n -1 4 n 0 2 -1 x[0] h[n] n 0 x[2] h[n-2] 1 -2 7 -2 6 3 1 1 3 x[1] h[n-1] n 0 y[n] 0 n 0 -2 -3 39 Digital Convolution • In general, the output due to an input 𝑥𝑥 𝑛𝑛 from an LTI system with impulse response ℎ 𝑛𝑛 is just ∞ 𝑦𝑦 𝑛𝑛 = � 𝑥𝑥 𝑘𝑘 ℎ 𝑛𝑛 − 𝑘𝑘 𝑘𝑘=−∞ • This is called the digital convolution of 𝑥𝑥 𝑛𝑛 with ℎ 𝑛𝑛 . It is done by flipping the impulse response (time-reversing it), then shifting, multiplying it with 𝑥𝑥 𝑛𝑛 and summing the products. • Thus the output of any digital LTI system is just the digital convolution of the input with the system’s impulse response. 40 Digital Convolution Example 4 The impulse response of an LTI system is ℎ 0 = 2; ℎ 1 = 1; ℎ 2 = −1 and ℎ 𝑛𝑛 = 0 for all other 𝑛𝑛. Input is: 𝑥𝑥 −1 = 1; 𝑥𝑥 0 = 2; 𝑥𝑥 1 = 3; 𝑥𝑥 2 = −1 and zero elsewhere. Find the output 𝑦𝑦 2 . 41 Digital Convolution Solution 2 𝑦𝑦 2 = � 𝑥𝑥 𝑘𝑘 ℎ 2 − 𝑘𝑘 𝑘𝑘=−1 = 𝑥𝑥 −1 ℎ 3 + 𝑥𝑥 0 ℎ 2 + 𝑥𝑥 1 ℎ 1 + 𝑥𝑥 2 ℎ 0 = 1 0 + 2 −1 + 3 1 + −1 2 = −1 42 Averaging Systems • Suppose we have a signal which fluctuates greatly, like stock prices, and we want to smooth out the signal. • We can do this by using a moving average filter. For example, a 5-point moving average filter will output 𝑦𝑦 𝑛𝑛 = 0.2 𝑥𝑥 𝑛𝑛 + 2 + 𝑥𝑥 𝑛𝑛 + 1 + 𝑥𝑥 𝑛𝑛 + 𝑥𝑥 𝑛𝑛 − 1 + 𝑥𝑥 𝑛𝑛 − 2 • Any short-term fluctuations will be made smaller because only 20% of each sample value contributes to the output. 43 Averaging Systems • This filter can be obtained by time convolving the input with the impulse response 0.2 −2 ≤ 𝑛𝑛 ≤ 2 ℎ 𝑛𝑛 = � 0 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 • In general, if we want a 2𝑚𝑚 + 1 point moving average filter, we can design the filter to have the impulse response 1/ 2𝑚𝑚 + 1 −𝑚𝑚 ≤ 𝑛𝑛 ≤ 𝑚𝑚 ℎ 𝑛𝑛 = � 0 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 44 Averaging Systems • Note that the filter is non-causal since it requires future inputs for present output. • This is not a problem if we pre-record the data first, or we delay the output until all the inputs required are available. 45 Properties of Convolution • Commutative: 𝑥𝑥 𝑛𝑛 ∗ ℎ 𝑛𝑛 = ℎ 𝑛𝑛 ∗ 𝑥𝑥 𝑛𝑛 Given the definition of the convolution sum: ∞ 𝑦𝑦 𝑛𝑛 = 𝑥𝑥 𝑛𝑛 ∗ ℎ 𝑛𝑛 = � 𝑥𝑥 𝑘𝑘 ℎ 𝑛𝑛 − 𝑘𝑘 𝑘𝑘=−∞ Substituting 𝑘𝑘 = 𝑛𝑛 − 𝑚𝑚, we get ∞ 𝑦𝑦 𝑛𝑛 = � 𝑥𝑥 𝑛𝑛 − 𝑚𝑚 ℎ 𝑚𝑚 = ℎ 𝑛𝑛 ∗ 𝑥𝑥 𝑛𝑛 𝑚𝑚=−∞ 46 Properties of Convolution • Distributive: 𝑥𝑥 𝑛𝑛 ∗ ℎ1 𝑛𝑛 + ℎ2 𝑛𝑛 𝑥𝑥 𝑛𝑛 ∗ ℎ1 𝑛𝑛 + ℎ2 𝑛𝑛 ∞ = 𝑥𝑥 𝑛𝑛 ∗ ℎ1 𝑛𝑛 + 𝑥𝑥 𝑛𝑛 ∗ ℎ2 𝑛𝑛 = � 𝑥𝑥 𝑘𝑘 ℎ1 𝑛𝑛 − 𝑘𝑘 + ℎ2 𝑛𝑛 − 𝑘𝑘 𝑘𝑘=−∞ ∞ ∞ 𝑘𝑘=−∞ 𝑘𝑘=−∞ = � 𝑥𝑥 𝑘𝑘 ℎ1 𝑛𝑛 − 𝑘𝑘 + � 𝑥𝑥 𝑘𝑘 ℎ2 𝑛𝑛 − 𝑘𝑘 = 𝑥𝑥 𝑛𝑛 ∗ ℎ1 𝑛𝑛 + 𝑥𝑥 𝑛𝑛 ∗ ℎ2 𝑛𝑛 47 Properties of Convolution • Associative: 𝑥𝑥 𝑛𝑛 ∗ ℎ 𝑛𝑛 ∗ 𝑔𝑔 𝑛𝑛 𝑥𝑥 𝑛𝑛 ∗ ℎ 𝑛𝑛 ∗ 𝑔𝑔 𝑛𝑛 ∞ ∞ 𝑚𝑚=−∞ ∞ 𝑙𝑙=−∞ = 𝑥𝑥 𝑛𝑛 ∗ ℎ 𝑛𝑛 ∗ 𝑔𝑔 𝑛𝑛 = � 𝑥𝑥 𝑛𝑛 − 𝑚𝑚 � ℎ 𝑚𝑚 − 𝑙𝑙 𝑔𝑔 𝑙𝑙 = � ∞ � 𝑥𝑥 𝑛𝑛 − 𝑚𝑚 ℎ 𝑚𝑚 − 𝑙𝑙 𝑔𝑔 𝑙𝑙 𝑙𝑙=−∞ 𝑚𝑚=−∞ 48 Properties of Convolution Substituting 𝑘𝑘 = 𝑚𝑚 − 𝑙𝑙, ∞ = � ∞ � 𝑥𝑥 𝑛𝑛 − 𝑙𝑙 − 𝑘𝑘 ℎ 𝑘𝑘 𝑔𝑔 𝑙𝑙 𝑙𝑙=−∞ 𝑘𝑘=−∞ ∞ = � 𝑥𝑥 𝑛𝑛 − 𝑙𝑙 ∗ ℎ 𝑛𝑛 − 𝑙𝑙 𝑔𝑔 𝑙𝑙 𝑙𝑙=−∞ = 𝑥𝑥 𝑛𝑛 ∗ ℎ 𝑛𝑛 ∗ 𝑔𝑔 𝑛𝑛 49 Properties of Convolution • Two subsystems in parallel is equivalent to a single system with impulse response the sum of the 2 subsystem impulse responses. 50 Transient Response • When a signal is applied to a system, the output will experience a start-up transient before settling to the steady-state response. • A stop transient is also generated when the input is removed. • Transients are important because they mask the steadystate response, and may also be large enough to damage the system. 51 Transient Response • If a system is described with a difference equation 𝑁𝑁 𝑀𝑀 𝑘𝑘=0 𝑘𝑘=0 � 𝑎𝑎𝑘𝑘 𝑦𝑦 𝑛𝑛 − 𝑘𝑘 = � 𝑏𝑏𝑘𝑘 𝑥𝑥 𝑛𝑛 − 𝑘𝑘 where 𝑥𝑥 𝑛𝑛 = input of the system 𝑦𝑦 𝑛𝑛 = output of the system 𝑎𝑎𝑘𝑘 , 𝑏𝑏𝑘𝑘 = constants max(N, M) = order of the discrete-time system (order of the difference equation) 52 Transient Response • If the system is assumed to be causal, then 𝑁𝑁 𝑀𝑀 𝑘𝑘=1 𝑘𝑘=0 𝑎𝑎𝑘𝑘 𝑏𝑏𝑘𝑘 𝑦𝑦 𝑛𝑛 = − � 𝑦𝑦 𝑛𝑛 − 𝑘𝑘 + � 𝑥𝑥 𝑛𝑛 − 𝑘𝑘 𝑎𝑎0 𝑎𝑎0 provided 𝑎𝑎0 ≠ 0. • The output response 𝑦𝑦 𝑛𝑛 consists of 2 components 𝑦𝑦 𝑛𝑛 = 𝑦𝑦𝑐𝑐 𝑛𝑛 + 𝑦𝑦𝑝𝑝 𝑛𝑛 where 𝑦𝑦𝑐𝑐 𝑛𝑛 = complementary or homogeneous solution 𝑦𝑦𝑝𝑝 𝑛𝑛 = particular solution 53 Transient Response • The transient or natural response is given by the homogeneous solution or zero-input (𝑥𝑥 𝑛𝑛 = 0) response. 𝑁𝑁 � 𝑎𝑎𝑘𝑘 𝑦𝑦 𝑛𝑛 − 𝑘𝑘 = 0 𝑘𝑘=0 • The steady-state or forced response is given by the particular solution ( 𝑥𝑥 𝑛𝑛 ≠ 0 ) or zero-state response (response with initial state of zero). 54 Transient Response • The transient response is caused by the non-zero initial conditions in the system decaying to zero. • The steady-state response is due entirely to the input signal. • Convolving the input with the impulse response of an LTI system produces the total response from the system. 55 Transient Response Example 5 A causal FIR discrete-time system is characterized by an impulse response ℎ 𝑛𝑛 = 4, −5,6, −3 , 0 ≤ 𝑛𝑛 ≤ 3 . Its output samples for an input 𝑥𝑥 𝑛𝑛 are then computed using 𝑦𝑦 𝑛𝑛 = 4𝑥𝑥 𝑛𝑛 − 5𝑥𝑥 𝑛𝑛 − 1 + 6𝑥𝑥 𝑛𝑛 − 2 − 3𝑥𝑥 𝑛𝑛 − 3 For a unit step sequence input, 𝑦𝑦 0 = 4𝑥𝑥 0 = 4 𝑦𝑦 1 = 4𝑥𝑥 1 − 5𝑥𝑥 0 = −1 𝑦𝑦 2 = 4𝑥𝑥 2 − 5𝑥𝑥 1 + 6𝑥𝑥 0 = 5 56 Transient Response 𝑦𝑦 3 = 4𝑥𝑥 3 − 5𝑥𝑥 2 + 6𝑥𝑥 1 − 3𝑥𝑥 0 = 2 𝑦𝑦 4 = 4𝑥𝑥 4 − 5𝑥𝑥 3 + 6𝑥𝑥 2 − 3𝑥𝑥 1 = 2 𝑦𝑦 5 = 4𝑥𝑥 5 − 5𝑥𝑥 4 + 6𝑥𝑥 3 − 3𝑥𝑥 2 = 2 It follows from the above that 𝑦𝑦 𝑛𝑛 = 2 for 𝑛𝑛 ≥ 3, or the output has reached the steady-state at 𝑛𝑛 = 3. The output samples for 𝑛𝑛 = 0,1,2 are composed of the samples of the transient and the steady-state responses. 57