Add Custom FIR Filter in FPGA of Reconfigurable Oscilloscope

Updated Mar 24, 2022



  • PXIe-5172
  • PXIe-5171
  • PXIe-5170
  • PXI FlexRIO Digitizer


  • LabVIEW
  • LabVIEW FPGA Module


  • LabVIEW Instrument Design Libraries for Reconfigurable Oscilloscopes

One of NI’s strengths is flexibility in the application based on FPGA. In Reconfigurable Oscilloscope, NI provides the FPGA source code to the customer for more flexible development.
With this strength, users can use this Reconfigurable Oscilloscope in many applications such as monitoring applications with custom triggers, IF applications, and other applications which need FPGA. In these applications, various ranges of digital filters are needed.
This article includes the steps of creating a custom 40MHz FIR filter in Reconfigurable Oscilloscope FPGA and setup parameters in Host. This article can help to create a variety of custom FIR filters in a Reconfigurable Oscilloscope and other FlexRIO FPGA environments.

Create Project

  1. Open LabVIEW "File >> Create Project".
  1. On Create Project window,  Create the example "Oscilloscope >> Multirecord Acquisition (NI5170)".
  1. Choose the right example based on hardware.
  2. In the sample project, Open Multirecord Acquisition (FPGA).vi in the FPGA tree. In the block diagram, the red box indicates the 'FIR' which is placed after the 'Digital'.
  1. Inside of that, there is a Single Channel FIR in the block diagram
  2. Open the Single Channel FIR block diagram. Inside of the Single Channel FIR, there are FIR filter functions ‘Parallel Non-sym FIR – 2 spc – 2x oc – 15’.FPGA_VI_Filter.PNG
  3. The parameters such as filter select, coef load, coef write, and coef data are shown.
  1. For custom use, the new coefficient should be created for the new filter range.
  2. Disconnect and delete the existing filter coefficients control and create a new control.
  1. Connect the terminal connecter pane in the front panel icon from this VI to the top-level VI for the host configuration.
  1. Connect the terminal until 'Filter Coefficients Control' is created on the Top level FPGA VI.
  1. Compile the FPGA code.

Create New Coefficients

  1. For custom filters, new coefficients are needed. In the host, create a new VI for new coefficient creation. Put the ‘FIR Windowed’ in the block diagram which is located in "Function Pallete >> Signal Processing >> Filters >> Advanced FIR >> FIR Win Coef".
  1. Set the sampling freq, filter type, cutoff freq, and taps. Then run the vi for the coefficients.
  2. Check the coefficients are created. taps are the number of coefficients.

Setting and Apply Custom Filters

  1. After the compilation is done, In the main host 'Multiple Record Fetch (HOST).vi', create the FPGA Read/Write Control function and select the filter coefficients.
  2. For applying new coefficients, the load and write coefficients process is needed. Refer to the code down below. Apply_Coeff.PNG
  3. Write the new coefficients for the custom filter.
  4. Check the load order of the coefficients, to ensure that the filter has the right setup because each filter has its own order according to the sample per cycle. See the detailed explanation of the filter.
  5. Run the new filter example and check the result of the filtered signal.
The other filters are located in <Program Files>\National Instruments\LabVIEW 2020\instr.lib\_niInstr\DSP\v1\FPGA\Public\Sub VIs\EqParallel.

In conclusion, this article explains how to use an FPGA filter in an easy way.