DSP Builder for Intel® FPGAs (Advanced Blockset): Handbook

ID 683337
Date 5/01/2023

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents
Give Feedback

7.4.13. Interpolating FIR Filter with Multiple Coefficient Banks

This design example builds an interpolating FIR filter that regularly switches between coefficient banks.

Multiple sets of coefficients requires storage in memory so that the design can switch easily from one set, or bank, of coefficients in use to another in a single clock cycle.

The design must perform the following actions:

  • Specify the number of coefficient banks
  • Initialize the banks
  • Update the coefficients in a particular bank
  • Select the bank in use in the filter

You specify the coefficient array as a matrix rather than a vector—(bank rows) by (number of coefficient columns).

The addressing scheme has address offsets of base address + (bank number * number of coefficients for each bank).

If the number of rows is greater than one, DSP Builder creates a bank select input port on the FIR filter. In a design, you can drive this input from either data or bus interface blocks, allowing either direct or bus control. The data type is unsigned integer of width ceil(log2(number of banks)).

The bank select is a single signal. For example, for a FIR filter with four input channels over two timeslots:



The corresponding input channel signal is:


Here the design receives more than one channel at a time, but can only choose a single bank of coefficients. Channels 0 and 2 use one set of coefficients and channels 1 and 3 another. Channel 0 cannot use a different set of coefficients to channel 2 in the same filter.

For multiple coefficient banks, you enter an array of coefficients sets, rather than a single coefficient set. For example, for a MATLAB array of 1 row and 8 columns [1 x 8], enter:

fi(fir1(7, 0.5 ),1,16,15)

For a MATLAB array of 2 rows and 8 columns [2 x 8] enter:

[fi(fir1(7, 0.5 ),1,16,15);fi(fir1(7, 0.5 ),1,16,15)]

Therefore, you can determine the number of banks by the number of rows without needing the number of banks. If the number of banks is greater than 1, add an additional bank select input on the block.

The model file is demo_firi_multibank.mdl.