Forum Discussion
Altera_Forum
Honored Contributor
14 years agoFor any filter you need to target unity gain at some ref point. For LPF this ref point is the dc. For HPF it is the .5(Nyquist). For bandpass filter, the best way is to compute the mean power(rms) of filter response within the band then inverse of that should be your filter gain. e.g. if this mean power turns out to be .9 then 1/.9 should be your gain. i.e. multiply coeffs by 1/.9 Whats left is how to scale it for hardware. If your coeffs are 16 bits signed then scale up as follows:
coeff = round(2^15*coeff); then truncate 15 LSBs and hence any remaining MSBs plus saturation logic. To get mean power you need to do fft on coeffs or use freqz.