Detailed Solutions to Exercises Digital Signal Processing Mikael Swartling Nedelko Grbic rev. 205 Department of Electrical and Information Technology Lund University
Detailed solution to problem E3.4 A system with initial condition and an input signal is given, and the task is to determine the following: a) The zero-input solution: the output from the system when no input is applied zero input); the output signal is coming only from the initial conditions of the system. b) The zero-state solution: the output from the system when the input signal is applied but the initial conditions are assumed to be zero zero state). d) The stationary solution: the output from the system as the time approaches infinity when the initial conditions and transients have dissipated from the system and only the stationary input signal remains. c) The transient solution: the output from the system due to transients in the input signal when the input signal is turned on at time n = 0) but that is not part of the stationary solution. Difference equations with initial conditions are solved using the z + -transform. The z + -transform The given difference equation is yn) yn ) + yn 2) = xn) ) 2 with the initial conditions y ) = 0 and y 2) = 2. The z-transform of the difference equation is Y z) z Y z) + 2 z 2 Y z) = Xz). 2) When taking the initial conditions into account the z + -transform becomes Y + z) z [Y + z) + z y ) ] + 2 z 2 [Y + z) + z y ) + z 2 y 2) ] = X + z). 3) Notice how the z + -transform is mostly equivalent to the z-transform, except that the transforms of the terms yn ) and yn 2) also include the initial conditions. If all initial conditions are zero, then the z-transform and the z + -transform are the same. Inserting the actual initial condition values into the equations yields Y + z) z Y + z) + 2 z 2 [Y + z) z 2 2 ] = X + z). 4) Expand the brackets. Y + z) z Y + z) + 2 z 2 Y + z) 2 z 2 z 2 2 = X + z). 5) ollect the factors of Y + z). [ Y + z) z + 2 z 2] + = X + z) 6) Rearrange the equation by subtracting both sides by and dividing both sides by the collected factors. Y + z) = z + 2 z 2 X+ z) z + 2 z 2 7) The given input signal is xn) = un) with corresponding z + -transform X + z) =. 8) z Note that the input signal has no initial conditions and so its z + -transform is identical to the z-transform. Finally, inserting the input signal into the equation for the output signal yields Y + z) = z + 2 z 2 z z +. 9) 2 z 2 The denominator polynomial z + 2 z 2 has two complex conjugated poles at p,2 = 2 ± j 2. 2
Partial fraction expansion The right hand side is now expanded into partial fractions. Observer that the partial fraction with two complex conjugated poles must be written on the form A + Bz. Y + z) = A + Bz z + 2 z 2 } {{ } two complex conjugated poles + z } {{ } one pole Our partial fraction expansion now states that z + 2 z 2 z } {{ } from earlier equation = z + 2 z 2 } {{ } already on partial fraction form 0) A + Bz z + 2 z 2 + z. ) } {{ } partial fractions First ensure that the denominator of all terms are equal in order to solve for A, B and. A + Bz ) z + 2 z 2) z ) = z ) z + 2 z 2) z ) + z + 2 z 2) z + 2 z 2) 2) z ) We can now conclude that = A + Bz ) z ) + and expanding the right hand side yields z + 2 z 2) 3) = A Az + Bz Bz 2 + z + 2 z 2 4) and after collecting the factors of z we have that = A + ) A B + )z B 2 ) z 2. 5) Identifying the left hand side with the right hand side now yields a linear equation system in the coefficients A, B and that we can solve. A + = the constant on the left hand side is ) A B + = 0 the left hand side has no factor of z ) 6) B 2 = 0 the left hand side has no factor of z 2 ) On matrix form the equation system and its solution is 0 A A B = 0 0 2 0 B =. 7) 2 The partial fraction expansion has been completed. Substituting the coefficients into the z + -transform of the output signal yields Y + z z) = z + 2 z 2 } {{ } Inverse transformation Y + z)=fraction + 2 z } {{ } Y + 2 z)=fraction 2 z + 2 z 2 } {{ } Y + 3 z)=fraction 3 The three fractions can now be inverse transformed individually into time sequences. Fraction 2 is directly inverse transformed according to the table of formulas. Y + 2 z) = z y 2 n) = un) 9) Fraction is inverse transformed by separating terms in the numerator and identifying with known transforms in the table of formulas. Y + z) = z z + 2 z 2 = 2 z z + 2 z 2 } {{ } α n cosβn) un) 2 z z + 2 z 2 } {{ } α n sinβn) un) 8) 20) 3
Identify the coefficients of the cosine term transform. α cosβ) = α = 2 2 α 2 = β = π 2 4 2) Identify the coefficients of the sine term transform accordingly. The inverse transform of fraction is therefore Y + z) y n) = ) n [ ) )] π π 2 cos 4 n sin 4 n un). 22) Fraction 3 is inverse transformed with a similar approach as with fraction. The fraction is separated into a sine and a cosine term, their parameters are identified and then inverse transformed. Y 3 + z) = z + 2 z 2 = 2 z z + 2 z 2 + 2 z z + 2 z 2 23) Y + 3 z) y 3n) = ) n [ ) )] π π 2 cos 4 n + sin 4 n un) 24) Finally, the output signal is the sum of all individual sequences. Y + z) = Y + z) + 2 Y + 2 z) Y + 3 z) yn) = y n) + 2 y 2 n) y 3 n) 25) Answers The four different responses that were asked for can be identified from the three fractions. We can identify the origin of the tree fractions by looking back at where the fractions originate from in the problem formulation. It can be seen by backtracking than fraction 2 originates from the input signal, fraction 3 originates from the initial conditions, and fraction is the remaining transient from the input signal. a) Assume that the input signal is xn) = 0. Then fraction and 2 are both become zero, because X + z) = 0, and the only remaining term in the output signal is fraction 3 originating from the initial conditions. The zero-input solution therefore becomes y zi n) = y 3 n). 26) b) Assume that the initial conditions are zero. Then fraction 3 becomes zero, because y ) = 0 an y 2) = 0, and two fractions and 2 remain. The zero-state solution therefore becomes y zs n) = y n) + 2y 2 n). 27) d) Assume that both the initial conditions and the transients are zero. Then fraction and 3 becomes zero, and only fraction 2 remains. Therefore, the stationary solution becomes y st n) = 2y 2 n). 28) c) The transient solution is what remains after the stationary solution and the zero-input solution has been removed from the total solution. Therefore, the transient solution becomes y tr n) = y n). 29) An alternative definition of the transient solution includes the transients caused by the initial conditions and not only the transient from the input signal. In that case, the transient solution becomes y tr n) = y n) y 3 n). 30) The total solution the full output from the system given the input signal and the initial conditions) is yn) = y n) + 2 y 2 n) y 3 n) 3) = 2 un) ) n [ ) )] ) n [ ) )] π π π π 2 cos 4 n sin 4 n un) cos 2 4 n + sin 4 n un) 32) = 2 un) ) n ) π 2 2 sin 4 n un) 33) 4
Detailed solution to problem 5.25 The problem asks to sketch the amplitude response of four pole-zero plots. The corresponding amplitude responses is given in the answers section. This detailed solution aims at explaining how to interpret the pole-zero plot and how the amplitude can be approximated by hand. The unit circle The most important detail about the pole-zero plot is the unit circle. The unit circle defines the frequency and therefore we use the unit circle and the location of the poles and the zeros to estimate the frequency response. The top half of unit circle is the positive frequencies, and the bottom half is the negative frequencies. All the systems in this problem are symmetric the bottom half of the pole-zero plot is the same as the top half) so we will ignore the bottom half. The negative side of the frequency axis will be a mirror image of the positive side just like the bottom half of the pole-zero plot is a mirror image of the top half. The relationship between a normalised frequency ω and a point z on the unit circle is z = e jω. We can therefore conclude that: the point z corresponding to ω = 0 is z =, the point z corresponding to ω = π/2 is z = j where j is the complex unit), the point z corresponding to ω = π is z =, and the point z moves counter-clockwise along the unit circle as the frequency increases. The figure below shows a pole-zero plot where the frequency axis and some points of interest have been emphasised. The red arrow shows the movement of the point z as the frequency increases from ω = 0 on the right hand side and moves counter-clockwise to ω = π on the left hand side. The blue marks indicates the location of some frequencies along the unit circle. ω = 0.5 π ω = 0.75 π ω = 0.25 π ω = π ω = 0 Estimating the frequency response response from a pole-zero plot.. Start at ω = 0 and follow the unit circle counter-clockwise to ω = π. The following guideline can be used to identify a very coarse frequency 2. Assume that the frequency response is approximately equal to unity one) at every frequency to begin with. 3. In the proximity of a pole, the frequency response increases. 4. In the proximity of a zero, the frequency response decreases. 5. The closer the pole/zero is to the unit circle, the greater the increase/decrease. The actual frequency response may not be that close to unity when not in the proximity of a pole or a zero. The key point of that assumption is to serve as a baseline from which the frequency typically deviates significantly. The frequency response approaches significant peaks near poles, or significant valleys near near zeros. We can thus observe the following from applying these points to pole-zero plots A and B given by the problem and as illustrated in the figures below. Point A: There are no poles or zeros nearby. We therefore assume a frequency response around unity. Line B: The frequency response decreases as we approach the location of a zero. Point : The frequency response is at a minimum at ω = 0.25 π. The zero is located on the unit circle and the frequency response is therefore exactly zero at this frequency. Line D: The frequency response increases as we move away from the zero and approaches unity. Point E: The frequency axis ends at around unity. 5
This is a pattern than can be observed from the figure given in the answer. The same reasoning applies to pole-zero plot B with the difference that there is a pole instead of a zero at ω = 0.25 π. Line B: The frequency response increases as we approach the location of a pole. Point : The frequency response is at a maximum at ω = 0.25 π. The pole is near the unit circle and the frequency response shows a peak at this frequency. If the pole was located on the unit circle, like the zero in pole-zero plot A, the frequency response would approach infinity. Such a filter is not stable due to the infinite frequency response. Line D: The frequency response decreases as we move away from the pole and approaches unity. This is again a pattern than can be observed from the figure given in the answer. Pole-zero plot A Pole-zero plot B D D B B E 2 A E 2 A Furthermore, along the same process, observe the five zeros evenly distributed near the unit half-circle in pole-zero plot and the resulting comb-shaped frequency response, and in pole-zero plot D where the zeros are located at ω = 0 and ω = π and the pole is located at ω = 0.5 π. Relation to the corresponding system equation The poles and zeros are also related to the system equation. The location of the poles and the zeros corresponds to the roots of the denominator and the numerator polynomials, respectively. The order of the polynomials are therefore determined by the number of poles and zeros which can be used to identify the corresponding system equation. From pole-zero plot A, we can identify that the system has two poles and two zeros. The denominator and the numerator polynomials must therefore both be of order two. We also observe that the poles are located at the origin, and the system equation must therefore be on the form Hz) = z z 0)z z ) z p 0 )z p ) = z z 0)z z ) z 2 = z 0 z ) z z ). 34) The pole-zero plot A is therefore a second order FIR system. Likewise, from pole-zero plot B, we observe the opposite configuration since the zeros are now located at the origin and the system equation must therefore be on the form Hz) = z z 0)z z ) z p 0 )z p ) = z 2 z p 0 )z p ) = p 0 z ) p z ) 35) The pole-zero plot B is therefore a second order IIR system a second order all-pole system even, which is a special case of IIR). From pole-zero plot we can identify the system as an eighth order FIR system. Pole-zero plot D can be identified as a second order IIR system. However, the difference between the systems B and D is that B is an all-pole system no numerator polynomial as a result of having all zeros at the origin) while system D as a second order polynomials in both the numerator and the denominator. 6
Detailed solution to problem E4.4 The following system is given in the problem statement with some additional signal names added that will be used for the solution. cos π 4 n) cos π 4 n) xn) xmn) yn) xmn) xt) Sampling hn) Rekonstruktion yt) Sampling and folding The input signal is xt) = cos2π F t) + cos2π F 2 t) where F = 000 and F 2 = 6000. Sampling at a frequency of F s = 8000 yields the two digital frequencies f = F F s = 000 8000 = 8 36) and f 2 = F 2 = 6000 F s 8000 = 6 8 = 2 8 + = f 2 ± k. 37) The digital frequency of the second cosine component is thus folded from f 2 = 6 /8 to f 2 = 2 /8 due to the insufficient sampling rate. The folding is performed by adding or subtracting integers from the digital frequency until the observed frequency is in the range /2 f < /2. In this case, we have to subtract from f 2 = 6 /8 so that f s = 2 /8. The two observed digital frequencies are therefore f = /8 and f 2 = 2 /8 and the sampled signal is therefore xn) = cos2π f n) + cos2π f 2 n) 38) = cos 2π ) 8 n + cos 2π 2 ) 8 n. 39) whose Fourier transform is Xf ) = [ 2 δ f 8 ) + δ f + ) + δ f 2 ) + δ f + 2 )]. 40) 8 8 8 Please observe that we are only focusing on the observed spectrum here. The actual spectrum has to consider that all the frequencies repeat with ±k for all integers k. The ±k has been left out from the answer. Modulation The modulation operation is a multiplication of two time sequences which corresponds to convolution in the frequency domain. When one of the modulation operands is a sinusoid the convolution simplifies to the identity found in the table of formulas) xn) cos2π f m n) 2 [Xf f m) + Xf + f m )]. 4) Pay attention to the cosine modulator in the table of formulas which is the desired one; the sine modulator has a phase shift and a minus sign between the sidebands. The spectrum of the modulated signal is thus shifted up and down by the modulation frequency f m. The two terms on the right hand side will be denoted the lower sideband and the upper sideband, respectively. The modulator is cos2π /8 n) and so the modulation frequency is f m = /8. The signal after modulation is therefore X m f ) = [ 2 X f ) + X f + )] 8 8 = 2 [ 2 δ f 0 ) + δ f + 2 ) + δ f ) + δ f + 3 )] + 43) 8 8 8 8 2 2 = 2 δf ) + 4 [ δ f 2 ) + δ f 0 ) + δ f 3 ) + δ f + )] 8 8 8 8 44) [ δ f ) + δ f + ) + δ f 2 ) + δ f + 2 ) + δ f 3 ) + δ f + 3 )]. 8 8 8 8 8 8 45) 42) Filtering The modulated signal x m n) has seven frequency components; at f = 0, f = ± /8, f = ± 2 /8 and at f = ± 3 /8, corresponding to f ± f m and f 2 ± f m. Since the filter has real coefficients and therefore has a symmetric frequency response, we are only interested in analysing one side of the spectrum. We naturally choose the positive side, and recognise that Hf ) = H f ); the amplitude response is even symmetric and the phase response is odd symmetric. 7
The frequency response of the filter hn) = un) un 8) is 7 Hf ) = hn)e j2π f n = e j2π f n 46) n= n=0 = sin 2π 82 f ) sin 2π 2 f ) e j2π f 7 2. 47) We can then insert the seven or four positive) frequencies into the frequency response to determine the filtered output signal: H 0) = 8 ) ) ) H = 0 H = 0 H = 0. 48) 8 8 8 We thus conclude that the output signal from the filter is Y f ) = X m f ) Hf ) = 8 δf ) 49) 2 since the filter blocks the components and the remaining six or three positive) frequencies. Modulation The second modulation step is performed in the same way the same as the first one. The signal ym) is modulated and the resulting signal is y m n) = 8 2 [ 2 cos 2π ) 8 n + cos 2π )] 8 n = 8 2 cos 2π 8 n ). 5) Reconstruction In ideal reconstruction of sinusoidal signals the sample index n is replaced by the continuous time t based on the relationship n = t F s between the time and sample index. The continuous output signal after ideal reconstruction, and the output signal from the entire system, becomes yt) = y m n n = t F s ) = 8 2 cos 2π ) 8 t F s = 4 cos2π 000 t). 52) 50) 8