0
$\begingroup$

I want to plot poles and zeros as well as impulse response of a transfer function that is given below:

$$H(z) = -0.0625z^4 + 0.25z^3 + 0.625z^2 + 0.25z -\frac{0.0625}{z^4}$$

For poles and zeros, I used MATLAB function residuez. However, I got error which is similar in impulse response plot.

code:

 b = [-0.0625 0.25 0.625 0.25 -0.0625];
 a = [0 0 0 0 1];
 [R,p,C] = residuez(b,a); % for poles 
 y = impz(b,a); %for impulse response
 figure(1);
 stem(y);

Could someone help.

Thanks

$\endgroup$
0
$\begingroup$

Two hints:

  1. The standard way of writing a transfer function in the $\mathcal Z$ domain is a rational function in $z^{-1}$, not in $z$. Try this
  2. Use tf2zp() instead of residuez()
| improve this answer | |
$\endgroup$
0
$\begingroup$

Here you go:

b = [-0.0625, 0.25, 0.625, 0.25, 0, 0, 0, 0, -0.0625];

a = 1;

% **** Plot impulse response  *****

[ImpResp,T] = impz(b,a,31);

figure(1), clf

plot(T,real(ImpResp),':bs','MarkerFaceColor','b','markersize',4)

title('Filter Impulse Response'), grid on, zoom on

% **** Plot poles & zeros  *****

[Z,P,Q] = tf2zpl(b,a);  % Calc poles and zeros

figure(2), clf

zplane(Z,P)  

axis([-1.2,1.2, -1.2, 1.2]), zoom on

% Poles/Zeros

disp(' '), disp('Poles at (mag and degrees)'); 

[abs(P), angle(P)*180/pi]

disp(' '), disp('Zeros at (mag and degrees)'); 

[abs(Z), angle(Z)*180/pi]
| improve this answer | |
$\endgroup$
  • $\begingroup$ Hi Richard thanks. $\endgroup$ – RohitM Jun 28 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.