# MATLAB: Compute pole-zero diagram of FIR using only impulse response

Given a discrete time impulse response $h[n]$ of a system, is there a way to plot its poles and zeros in MATLAB? The input impulse response can be variable, so I can't compute its transfer function before hand. I have seen several options where given the $H(z)$ you can plot the Pole-Zero diagram but couldn't find any which computes it using just $h[n]$.

• only a system has zeros and poles. A time-signal $h[n]$ is not a system. Do you mean you want to have the Zero-poles of a system which has impulse response h[n]? Commented Jan 16, 2017 at 9:03
• Yeah I meant that. I'll edit the question. Commented Jan 16, 2017 at 9:04
• is it a finite or infinite impulse response? Do you just have the samples of the impulse response or also a math. expression? in case its IIR, you need to have an equation, otherwise, you would not even be able to represent the response accurately. Commented Jan 16, 2017 at 9:07
• It is finite. It's actually just summation of weighted delta functions at different positions. For eg: h[n] = d[n] -2*d[n-2] + 3*d[n-5] Commented Jan 16, 2017 at 9:09

Since your response is finite, your system corresponds to a FIR filter, where the coefficients are given by the values of the impulse response. Hence, you can perform Z-Transform of the FIR and find its zeros. Finally, since you would just need to calculate the zeros of the nominator polynomial. See this MATLAB code, following your impulse response example:

h = [1 0 -2 0 0 3];
b = h; % the FIR coefficients of a filter

roots(b)

zplane(b,1);


Output:

ans =

-1.6379
1.2438 + 0.4498i
1.2438 - 0.4498i
-0.4248 + 0.9309i
-0.4248 - 0.9309i


So, the zeros are directly given by the roots. For the poles, you have (N-1) poles at the origin.

Also, have a look at e.g. this answer.

• Many thanks for the help. Not sure how did I miss this trivial thing!!!! Commented Jan 16, 2017 at 9:27