FIR filter o/p width

May 27, 2008 1 Replies

Hai,



Is there any formula or general rule to set output width of FIR filter given its input ,coefficients width and number of taps.??



I red in some data sheet of FIR filter deisgn as: output width = input width+coefficient width+logN(base 2)



In some other data sheet of FIR filter deisgn as: output width = 2*input width+logN(base 2)



which of the above is correct??pls give some link for refernce doc explaining the general rule to set o/p width..



regards, faz


Go do the sums...

That looks right. Each product (input*coeff) gives a width of (input bits) + (coeff bits). Assuming all your coefficients have that same width, your maximum output value cannot exceed N*(max_input*max_coeff), so giving a bit growth of ceiling(log2(N)) over the output width of each multiplier. Early stages in the pipeline obviously can use narrower words.

In the systolic form (input fed to all multipliers simultaneously) and assuming coefficient widths are the same for all taps, the sum's bit growth at each tap is:

tap# 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17... bits 0 1 2 2 3 3 3 3 4 4 4 4 4 4 4 4 5...

Looks like someone's assuming the coefficients and input are the same width, doesn't it?

FIR filters are really rather easy to reason about. At each step you can easily pre-calculate the largest possible numeric value that can be seen. You may be able to use knowledge of the input stream to set even tighter bounds on bit width, but the benefit is rarely worth the hassle.

IIR filters, of course, are much harder.

Try comp.dsp where there is some very heavy-duty filter expertise. (There's plenty of filter expertise here too, mind you!)

Jonathan Bromley, Consultant DOULOS - Developing Design Know-how VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK jonathan.bromley@MYCOMPANY.com http://www.MYCOMPANY.com The contents of this message may contain personal views which are not the views of Doulos Ltd., unless specifically stated.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required