S 11.1 (P 4.4) ______________ (i) H(z) = 1 - z^(-1} - *z^(-2) + z^(-3) (ii) H(exp(j*omega)) = 1 - exp(-j*omega) - exp(-j*2*omega) + exp(-j*3*omega) = exp(-j*3*omega/2)... *(exp(j*3*omega/2) - exp(j*omega/2) - exp(-j*omega/2) + exp(-j*3*omega/2)) = exp(-j*3*omega/2)*(2*cos(3*omega/2)-2*cos(omega/2)) Thus |H(exp(j*omega)| = |2*cos(3*omega/2)-2*cos(omega/2)| and |H(exp(j*omega)|^2 = (2*cos(3*omega/2)-2*cos(omega/2))^2 (Note: An alternative expression for |H(exp(j*omega)|^2 is found by expanding H(exp(j*omega))*H(exp(-j*omega)) ) To plot |H(exp(j*omega)|: h = [1 -1 -1 1]; f = (0:511)/512; % 512 points chosen (arbitrarily) H = fft(h,512); plot(f,abs(H)), title('Amplitude Response'), xlabel('\Omega/2\pi') (iii) x[n] = 1 = exp(j*0*n) y[n] = H(exp(j*0)*x[n] = 0 x[n] = (-1)^n = exp(j*pi*n) y[n] = H(exp(j*pi))*x[n] = 0 x[n] = exp(j*pi*n/4) y[n] = H(exp(j*pi/4))*x[n] = (1 - exp(-j*pi/4) - exp(-j*2*pi/4) + exp(-j*3*pi/4))*x[n] = (-sqrt(2)+1+j)*exp(j*pi*n/4) x[n] = cos(pi*n/4+q) y[n] = |H(exp(j*pi/4))| * cos((pi*n/4) + q + angle(H(exp(j*pi/4))) = (4-2*sqrt(2))*cos((pi*n/4)+ q + 3*pi/8) = |2*cos(3*pi/8)-2*cos(pi/8)|cos((pi*n/4)+ q - 3*pi/8 + pi) = (sqrt(2+sqrt(2))-sqrt(2-sqrt(2)))cos((pi*n/4)+ q + 5*pi/8) = 1.0824*cos((pi*n/4)+ q + 5*pi/8) x[n] = 2^(-n) y[n] = H(1/2)*x[n] = (1-2-4+8)*x[n] = 3*(1/2)^n x[n] = 2^(-n)cos(pi*n/4) = Real( 2^(-n)*exp(j*pi*n/4) ) We need H(z) for z = exp(j*pi/4)/2 H( exp(j*pi/4)/2 ) = -6.0711 - 0.2426*j = 6.0759*exp(-j*3.1016) So y[n] = 6.0759*(1/2)^n*cos((pi*n/4) - 3.1016) S 11.2 (P 4.8) ______________ H1(z) = 3 + 2*z^(-1) + z^(-2) + 2*z^(-3) + 3*z^(-4) H2(z) = 1 - 2*z^(-1) + 2*z^(-2) - z^(-3) (i) The cascade has system function H(z) = H1(z)*H2(z) = 3 - 4*z^(-1) + 3*z^(-2) + z^(-3) - z^(-4) -3*z^(-5) + 4*z^(-6) - 3*z^(-7) (ii) The impulse response of the cascade is h[0:7] = [3 -4 3 1 -1 -3 4 -3].' h[n] = 0 for n<0 and n>7 (iii) We factor out z^(-7/2) = exp(-j*7*w/2), then use the identity exp(j*k*w/2) - exp(-j*k*w/2) = 2*j*sin(k*w/2) to obtain H(exp(j*w)) = -2*j*exp(-j*7*w/2) *( sin(w/2) + 3*sin(3*w/2) - 4*sin(5*w/2) + 3*sin(7*w/2) ) Taking the modulus of each term on the right-hand side, we have |H(exp(j*w)} = 2*| sin(w/2) + 3*sin(3*w/2) - 4*sin(5*w/2) + 3*sin(7*w/2) | S 11.3 (P 4.9) ______________ (i) H(z) = (1 + z^(-1) + z^(-2) + z^(-3))^2 = 1 + 2*z^(-1) + 3*z^(-2) + 4*z^(-3) + 3*z^(-4) + 2*z^(-5) + z^(-6) Coefficient vector of cascade: b = [1 2 3 4 3 2 1].' (ii) The frequency of the sinusoid is w=pi/2. We have H(exp(j*w)) = (1 + exp(-j*w) + exp(-j*2*w) + exp(-j*3*w)).^2 = (1 - j - 1 + j).^2 = 0 Therefore y[n] = 0*cos(n*pi/2 + 0) = 0 for all n S 11.4 (P 4.3) ______________ Divide by 2*pi to express the three frequencies in cycles per sample: 3/28, 9/35 and 17/48 Since these are rational (i.e., integer fractions), the signal is periodic. The period is the smallest integer L such that each frequency can be expressed as k/L. With irreducible fractions (as above), this is given by the least common multiple (LCM) of the denominators: LCM(28,35,48) = 1680 S 11.5 (P 4.7) ______________ The output y is also periodic with period L=7. If xL = x[0:6] and yL = y[0:6] then the DFT's of xL and yL are related by YL[k] = H(exp(j*2*pi*k/8))*XL[k] for k=0:7. The easiest way to obtain the values H(exp(j*2*pi*k/8)) numerically is to zero-pad b to 2*L = 14 points, then take every *other* coefficient in the DFT. The MATLAB code is b = [ 1 2 -2 -1 4 -1 -2 2 1 ].' ; B = fft(b,14); H = B(1:2:13); xL = [ 1 -1 0 3 1 -2 0 ].' ; XL = fft(xL); YL = H.*XL; yL = ifft(YL) bar(0:6,yL) and the resulting yL vector is [20 3 -20 10 21 -14 -12]' Alternatively: b = [ 1 2 -2 -1 4 -1 -2 2 1].' ; B = fft(b,14); xL = [ 1 -1 0 3 1 -2 0 ].' ; xL2 = [xL ; xL]; % two periods of xL XL2 = fft(xL2); % odd-indexed entries are zero YL2 = B.*XL2; % no need to sample even-indexed entries yL2 = ifft(YL2); % two periods of yL yL = yL2(1:7) S 11.6 (P 4.13) ______________ (i) The response to delta[n-m] is h[n-m]. Therefore the response to x = delta[n+1] - delta[n-1] is y = h[n+1] - h[n-1] The first nonzero value of h occurs at n=0 and the last one at n=4. The first nonzero value of y occurs at n=-1 (produced by h[n+1]), and the last one is at n=5 (produced by h[n-1]). y[-1:5] = [1 -2 0 3 -2 0 0].' - [0 0 1 -2 0 3 -2].' = [1 -2 -1 5 -2 -3 2]' y = 0 for n<-1 and n>5 (ii) The duration of h is 5 time units, that of x is 4 time units, thus the duration of y is 5+4-1=8 time units, from n=0 until n=7. k: 0 ____________________________________________________ h[k]: 1 -2 0 3 -2 y ____________________________________________________ x[-k] -1 3 2 1 1 x[1-k] -1 3 2 1 0 x[2-k] -1 3 2 1 -1 x[3-k] -1 3 2 1 -4 x[4-k] -1 3 2 1 6 x[5-k] -1 3 2 1 5 x[6-k] -1 3 2 1 -9 x[7-k] -1 3 2 1 2 So y[0:7] = [1 0 -1 -4 6 5 -9 2].' (iii) We multiply the polynomials H(z) = 1 - 2*z^(-1) + 3*z^(-3) - 2*z^(-4) and X(z) = 1 + 2*z^(-1) +3*z^(-2) - z^(-3) together to obtain H(z)X(z) = 1 - z^(-2) - 4*z^(-3) + 6*z^(-4) + 5*z^(-5) - 9*z^(-6) + 2*z^(-7) This is Y(z), and the coefficients equal y[0:7]. S 11.7 (P 4.14) ______________ (i) x has duration n=0:M, thus conv(x,x) has duration n=0:2*M (length = 2*M+1). For n in 0:2*M: y[n] = x[0]*x[n] + x[1]*x[n-1] + ... + x[n-1]*x[1] + x[n]*x[0] There are a total of n+1 terms (summands) in the above sum. If n<=M, then all the summands are nonzero; they are in fact equal to 1, and thus y[n] = number of terms in the sum = n+1 If n>M, then 2*(n-M) summands will contain exactly one x[i] with i>M, which equals zero. Thus y[n] = (number of terms in the sum) - 2*(n-M) = 2*M-n+1 The result is symmetric about n = M; this is a triangular signal with peak at n = M. To illustrate in the case M = 4: x[k]: 1 1 1 1 1 y ___________________________________________________________ x[-k] 1 1 1 1 1 1 x[1-k] 1 1 1 1 1 2 x[2-k] 1 1 1 1 1 3 x[3-k] 1 1 1 1 1 4 x[4-k] 1 1 1 1 1 5 x[5-k] 1 1 1 1 1 4 x[6-k] 1 1 1 1 1 3 x[7-k] 1 1 1 1 1 2 x[8-k] 1 1 1 1 1 1 (ii) An advance of M time units would make y a symmetric signal. S 11.8 (P 4.15) ______________ Since both sequences x and h equal zero for n<0, so does y=conv(x,h). Since h has infinite duration (over the positive time axis), so does y. This is expected, since a single impulse in the input generates a response that never turns off. For n = 0:3 y[0] = h[0]*x[0] = 1 y[1] = h[0]*x[1] + h[1]*x[0] = -1 + a y[2] = h[0]*x[2] + h[1]*x[1] + h[2]*x[0] = 1 -a + a^2 y[3] = h[0]*x[3] + h[1]*x[2] + h[2]*x[1] + h[3]*x[0] = -1 +a - a^2 + a^3 For n>3, the convolution sum has four nozero terms only: y[n] = h[n-3]*x[3] + h[n-2]*x[2] + h[n-1]*x[1] + h[n]*x[0] = a^(n-3)*(h[0]*x[3] + h[1]*x[2] + h[2]*x[1] + h[3]*x[0]) = a^(n-3)*(-1 +a - a^2 + a^3)