Digital Signal Processing

Lab 4

Exercise 1

Poles, zeros, and impulse responses

 

b = [1 -0.5];

a = [1 0.75 0.125];

g=filt(b,a)       % define the filter

pp=pole(g);       % find the poles of the filter

zz=tzero(g);      % find the zeros of the filter

t=-1:0.001:1;

                  % plot the unit circle, as well as poles and zeros

figure(1)

plot(t,sqrt(1-t.^2),'k:',t,-sqrt(1-t.^2),'k:',real(pp),imag(pp),'kX',real(zz),imag(zz),'kO');

axis square

axis([-2 2 -2 2])

line([0 0], [-2 2])

line([-2 2], [0 0])

 

num = 30;

nn = 0:num-1;

d=[1 zeros(1,num-1)];     % create unit impulse function

h=filter(b,a,d);          % find and plot impulse response

 

figure(2)

clf

stem(nn,h)

 

for i=1:num,                     % input x[n]

    d(i) = 0.9^(i-1);

end

h=filter(b,a,d);          % plot the response

 

figure(3)

clf

stem(nn,h)

 

 

 

Exercise 2

Try simulink

dspafxr.mdl

 

What would you hear if the input is set to be one of the sounds in Lab 1?

 

 

 

Sources:

Fundamentals of Digital Signal Processing, by Joyce Van de Vegte, Prentice Hall, 2002.