www.gusucode.com > dsp 案例源码程序 matlab代码 > dsp/DesignFixedPointFilterExample.m

    %% Design Fixed-Point Filter
% Design fixed-point filter with a wordlength of at most 11 bits using
% |constraincoeffwl|
Hf = fdesign.lowpass('Fp,Fst,Ap,Ast',.4,.5,1,60);
Hd = design(Hf,'equiripple'); % 43 coefficients
Hq = constraincoeffwl(Hd,11); % 45 11-bit coefficients
hfvt = fvtool(Hd,Hq);
legend(hfvt,'Floating-point Filter','Fixed-point Filter');