b = [1 2 2 1].' H = fft(b,512); w = 2*pi*(0: 1/512 : 1-1/512).'; Hmag = abs(H); % amplitude response Hphs = angle(H); % phase response plot(w,Hmag) plot(w,Hphs)