Maximize stopband attenuation of fixed-point filter
Hq = maximizestopband(Hd,Wordlength)
Hq = maximizestopband(Hd,Wordlength,'Ntrials',N)
Hq = maximizestopband(Hd,Wordlength) quantizes
the single-stage or multistage FIR filter
returns the fixed-point filter
Hq with wordlength
maximizes the stopband attenuation.
Hd must be
For multistage filters,
wordlength can either be
a scalar or vector. If
wordlength is a scalar,
the same wordlength is used for all stages. If
a vector, each stage uses the corresponding element in the vector.
The vector length must equal the number of stages.
a stochastic noise-shaping procedure by default to minimize the wordlength.
To obtain repeatable results on successive function calls, initialize
the uniform random number generator
Hq = maximizestopband(Hd,Wordlength,'Ntrials',N) specifies
the number of Monte Carlo trials to use in the maximization.
the fixed-point filter with the largest stopband attenuation among
the trials. The number of Monte Carlo trials
You must have the Fixed-Point Designer™ software installed to use this function.
Maximize stopband attenuation for 16–bit fixed-point filter.
Hf = fdesign.lowpass('Fp,Fst,Ap,Ast',0.4,0.45,0.5,60); Hd = design(Hf,'equiripple'); WL = 16; % use 16 bits to represent coefficients Hq = maximizestopband(Hd,WL); % Compare stopband attenuation md = measure(Hd); mq = measure(Hq); hfvt=fvtool(Hd,Hq,'showreference','off'); legend(hfvt,'Floating-point Filter','Fixed-point Filter');