%% 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');

% Copyright 2012 The MathWorks, Inc.