image thumbnail
from kaiser FIR by zhang yong
Including Bandpass,Highpass,Lowpass FIR

freqz_m.m
function[db,mag,pha,grd,w]=freqz_m(b,a);
%db0ڵmag0ڵľpha0ڵλӦ
%grd0ڵȺӳ٣w0ڵ501Ƶ
%bֱ˲Ӷʽϵaֱ˲ĸʽϵ
[H,w]=freqz(b,a,1000,'whole');
H=(H(1:1:501))';
w=(w(1:1:501))';
mag=abs(H);
db=20*log10((mag+eps)/max(mag));    %num2str(eps) ֵ2.22e-16
pha=angle(H);
grd=grpdelay(b,a,w);

Contact us at files@mathworks.com