# Different phase response plots using MATLAB's $\tt freqz$ and $\tt fvtool$?

I have a butterworth filter in MATLAB:

[B, A] = butter( 2, 3000/16000*2, 'high' );


I plot it in two ways:

• using freqz:

[h,w] = freqz(B,A,8000);
plot(w);

• and using fvtool:

h = fvtool(B,A);
h.Analysis = 'phase';
h.Fs = 16000;
h.FrequencyRange='[-Fs/2, Fs/2)';

First plot gives me linear phase, and second one not.

Why do I get different plots?

• plot(w) only plots the frequencies while h is the response. Same mistake as in your previous question. – msm Mar 28 '17 at 7:11
• yes, goti it, thanks. w are only x-axis frequencies, phase needs to be calculated from the complex amplitudes. thanks. – Danijel Mar 28 '17 at 7:30

[H,W] = freqz(B,A,N) returns the N-point complex frequency response

plt(w, angle(h));